Convert PUB to PDF Programmatically in C#

PUB to PDF C#

PUB files are frequently used to publish data on a large scale. In this article, we will explore PUB to PDF conversion as well as Editing the metadata of a PUB document. You can create PDF documents with good fidelity. Likewise, you can work with different metadata properties of a publisher file. Let us explore the following sections related to PUB files:

Convert or Manipulate PUB File – API Installation

You can quickly install Aspose.PUB for .NET API by downloading it from the New Releases section, or via NuGet package manager in Visual Studio. The following command will configure the API in your project.

PM> Install-Package Aspose.PUB

Once configured, you will be able to work with Publisher files without needing to understand the basic details of the PUB file format. The API will perform the tasks as per the API calls in your application.

Convert PUB to PDF Programmatically in C#

You can convert PUB files to PDF using C# language in your .NET based applications. You need to follow the steps below for Microsoft Publisher Document conversion (PUB) to PDF:

  1. Load the input PUB file with PubFactory class
  2. Parse the input file
  3. Save the output PDF file

The following code shows how to convert PUB to PDF file programmatically using C#:

Edit Metadata of PUB File using C#

PUB files contain metadata including Author, Title, Subject, Keyword, etc. You can edit or manipulate the metadata with these steps:

  1. Load the PUB file in the PubFactory class instance
  2. Parse the input PUB document
  3. Set different metadata properties

The code below shows how to edit metadata of PUB file in C#:

Conclusion

You have explored how to manipulate or convert PUB to PDF programmatically in C#. You can download the Examples project as a quick test and demonstration of these features. In case of any queries, you can reach out to us at Free Support Forums.

See Also

Convert PUB to PDF file Programmatically using C++