Convert PUB to Image using C++

Convert PUB to Image using C++

Microsoft Publisher (PUB) files are used for printing or publishing information. There might be scenarios where you need to share these files, and the receiving party does not have access to Microsoft Publisher. In such cases, converting these files to images before sharing can prove to be helpful. To that end, this article will teach you how to convert PUB files to various image formats using C++.

C++ APIs for Converting PUB Files to Image Format

We will use the Aspose.PUB for C++ and Aspose.PDF for C++ APIs to perform this conversion. The former is a library for working with Microsoft Publisher (PUB) files, whereas the latter is the library for creating, reading, and modifying PDF files. We will use the Aspose.PUB for C++ API to convert PUB files to PDF format and Aspose.PDF for C++ API to convert the generated PDF files to image format. You can either install the APIs through NuGet or download them directly from the Downloads section.

PM> Install-Package Aspose.PUB.Cpp
PM> Install-Package Aspose.PDF.Cpp

Convert PUB Files to JPG Images using C++

The following are the steps to convert PUB files to JPG images.

The following sample code shows how to convert PUB files to JPG images using C++.

Convert PUB Files to PNG Images using C++

In order to convert PUB files to PNG images, follow the steps given below.

The following sample code shows how to convert PUB files to PNG images using C++.

Converting PUB Files to TIFF Images using C++

The following are the steps to convert PUB files to TIFF images.

The following sample code demonstrates how to convert PUB files to TIFF images using C++.

Get a Free License

You can try the API without evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to convert Microsoft Publisher (PUB) files to JPG, PNG, and TIFF images using C++. We used the Aspose.PUB for C++ and Aspose.PDF for C++ APIs to achieve this. You can explore these APIs in detail by visiting their official documentation. In case of any questions, please feel free to reach us at our free support forum.

See Also