Microsoft Publisher is a desktop publishing tool designed for crafting diverse publications, including newsletters, brochures, flyers, and more in the PUB format. Nevertheless, the PUB file format lacks broad compatibility. Therefore, there are instances when it becomes necessary to transform PUB files into TIFF images. In this article, we will learn how to convert PUB to TIFF in C#. We will furnish you with a comprehensive, step-by-step tutorial along with code examples to facilitate your journey.
This article covers the following topics:
- C# API to Convert PUB to TIFF
- Steps to Convert a PUB File to a TIFF
- Convert PUB to TIFF in C#
- Convert PUB to TIFF Online
- Free Learning Resources
C# API to Convert PUB to TIFF
Conversion of publisher PUB files into TIFF images can be done in two steps. Firstly, we will use the Aspose.PUB for .NET API to load and convert the PUB file into PDF format. After that, we will use the Aspose.PDF for .NET API to render the pages of the PDF file into TIFF images.
PM> Install-Package Aspose.PUB PM> Install-Package Aspose.PDF
How to Convert a PUB File to a TIFF
We can easily save a PUB file as a TIFF image by following the steps below:
- Create a PUB parser and parse the PUB file.
- Convert a PUB to a PDF file stream.
- Create a TIFF device and process PDF to save as TIFF.
Now, let’s see how to perform these steps in C# to convert a Publisher PUB file to a TIFF.
Convert PUB to TIFF in C#
Please follow the steps below to convert the Publisher file to a TIFF image programmatically in C#:
- Create a PUB parser using the CreateParser() method of the PubFactory class.
- Parse the loaded Publisher file using the Parse() method.
- Initialize the MemoryStream object to hold the PDF file.
- Convert PUB to PDF using the ConvertToPdf() method.
- Create an instance of the Document class with the PDF stream.
- Optionally, specify the TiffSettings.
- After that, create an instance of the TiffDevice with resolution and the TiffSettings object.
- Finally, call the Process() method to save the document as a TIFF.
The following code sample shows how to convert PUB to TIFF in C#.
Get a Free License
You can get a free temporary license to try the libraries without evaluation limitations.
PUB to TIFF Converter - Free Online
You can try this free online PUB to TIFF Converter app to convert publisher files to TIFF images without installing any software or plugin.
PUB to TIFF – Learning Resources
Besides converting Publisher PUB files into TIFF format, you may also explore various other features of the library using the following resources:
In this blog post, we have shown you how to convert PUB to TIFF in C#. We have provided a step-by-step guide and code snippets to help you get started. Converting Publisher files to TIFF is a relatively simple task, and the code snippets provided in this blog post can be used as a starting point for developing your own Publisher to TIFF converter application. In case of any ambiguity, please feel free to contact us on our free support forum.