Convert PUB to PDF file Programmatically using C++

PUB files are usually used to create or edit the publications. Pamphlets, brochures, visiting cards, and many other types of files are created in Microsoft Publisher application thus saved as the file extension .pub. However, because of the popularity and support of PDF format, you may need to convert PUB to PDF. For such scenarios, Aspose.PUB for C++ API is the answer to your requirements.

C++ PUB to PDF Converter API

Looking at the background information about the API, previously only Aspose.PUB for .NET API was available so one could use that with C# or VB.NET programming language. However, the increasing and repeating requests for supporting the C++ platform resulted in the conception of Aspose.PUB for C++ API. Now you can edit, manipulate, and convert PUB files in your C++ applications.

Installation

The API is available at the Downloads section as well as on the NuGet gallery. Where you can simply run the following command or install using NuGet Manager for Solution, in Visual Studio IDE.

PM> Install-Package Aspose.PUB.Cpp

Convert PUB to PDF in C++

Since you have installed and set up the API by now. We are good to convert a PUB file to PDF. Let us work with a sample Microsoft Publisher file to PDF with below steps:

  1. Load input PUB file
  2. Convert PUB to PDF with ConvertToPdf method
  3. Save the output PDF file

Following C++ code is based on these steps which show how to convert PUB to PDF in your C++ applications.

Below screenshot shows the output PDF file generated with the C++ code snippet we have just tested:

Convert PUB to PDF

It is important to note here that Aspose.PUB for C++ API supports input PUB file with several pages to be converted to a PDF file containing many pages. Moreover, we will keep enhancing the PUB to PDF rendering with upcoming releases.

Free Temporary License for Evaluation of Aspose.PUB for C++

Like other APIs offered by Aspose, we also offer a free trial license for 30 days for Aspose.PUB for C++ API as well. This allows you to test the API in its full capacity. However, the trial period can be extended a few times, upon request, if your POC, Feasibility, or any other organizational procedure needs some time. You can learn detailed information on Temporary License page if you want to test before paying for the API.

Conclusion

Publisher files are frequently used in modern times and the feature of PUB to PDF file format is very important. That is why it is one of the first features being included in the C++ version of the API. In case you need any assistance while installing or converting PUB files, get in touch with us via Free Support Forum.

See Also

Convert EPUB to PDF