.NET Publisher API to Process and Convert PUB Files Easily

Build .NET solutions to effortlessly read and manipulate Microsoft Publisher files using the PUB document API for .NET by Aspose. Convert PUB files to PDF, DOCX, HTML, and raster images.

Download Free TrialView All APIs

Advanced Publisher File Processing in .NET

Aspose.PUB for .NET is a reliable Microsoft Publisher files processing API that helps software and app developers programmatically access, read, edit, and convert PUB files within their .NET apps. It offers advanced PUB file processing capabilities to users looking to integrate editing and conversion of the Publisher files into their existing solutions or build new solutions from scratch. Users can manipulate the metadata of PUB files using the API and further optimize Publisher document workflows.

In addition to the excellent PUB file reading and editing abilities, the robust .NET Publisher API supports converting PUB files to different formats. .NET developers can enhance their file conversion software by adding the functionality to accurately convert PUB to PDF, HTML, Word (DOC/DOCX), JPEG, PNG, and more. Aspose.PUB for .NET is the preferred choice for developers to build cross-platform MS Publisher file reading, modification, and conversion solutions that work on multiple OS and platforms.

Getting Started

Please review the following information to help easily set up the PUB files library for .NET. To check if your system meets the recommended settings and prerequisites in terms of the OS, development environment, and frameworks, please visit the System Requirements page of the library.

Aspose.PUB for .NET Installation

To directly download the MSI installer or the DLLs and install the library, please visit the downloads section of Aspose.PUB for .NET. Or, you can obtain the NuGet package and install it from the Visual Studio package manager console with the help of the below-given command:

PM > Install-Package Aspose.PUB

Effortless PUB to PDF and Word Document Conversion in .NET

Aspose.PUB for .NET library includes conversion functionality that developers can utilize to convert Publisher files to multiple file formats. One of the primary conversion options is PUB to PDF, which allows saving the Publisher documents as PDF documents. Furthermore, the PUB format conversion API enables effortlessly exporting to other files, including documents and raster images.

Convert Publisher Files to PDF in C#

PDF format has become the standard for file sharing and collaboration as it can easily be accessed and viewed on devices running on any OS. The .NET Publisher API supports converting PUB files to PDF documents, making it possible for programmers to integrate this feature into their MS Publisher file converter apps. In the following C# coding example, we will learn how to convert PUB to PDF.

  • Load the input PUB file using the PubFactory class.
  • Parse the PUB file.
  • Convert and save the output PDF document.
string fileName = dataDir + "halloween-flyer.pub";

var parser = PubFactory.CreateParser(fileName);

var doc = parser.Parse();

Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, dataDir + "result_out.pdf");

Convert PUB Files to Word Documents in C#

Microsoft Word is the leading word-processing software used globally by individual and corporate users. Converting a file to Word format makes for convenient access across multiple OS. Users can seamlessly convert PUB documents to DOC and DOCX formats with the PUB file manipulation library. The following code example shows how to convert PUB to DOCX in C#.

  • Initialize a MemoryStream for the output document.
  • Load and parse the PUB file using IPubParser.Parse() method.
  • Convert the PUB file to PDF and add it to a MemoryStream.
  • Load the PDF file by initializing a DocSaveOptions class object.
  • Specify the output format (DOC/DOCX) to save the Word document.
string fileName = "ConvertTest.pub";

// Initialize a MemoryStream to hold the output document
MemoryStream stream = new MemoryStream();

// Load input PUB file
Aspose.Pub.IPubParser parser = Aspose.Pub.PubFactory.CreateParser(fileName);

// Parse the input publisher file
Aspose.Pub.Document doc = parser.Parse();

// Convert the PUB file to PDF and save the result in a MemoryStream
Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream);

// Load input PDF file from the MemoryStream
Aspose.Pdf.Document document = new Document(stream);

// Initialize DocSaveOptions class object
Aspose.Pdf.DocSaveOptions options = new DocSaveOptions();

// Specify the format of the output Word file (DOC/DOCX)
options.Format = DocSaveOptions.DocFormat.Doc;

// Save output word file (DOC/DOCX)
document.Save(dataDir + "Output.doc", options);

You can view more working code examples at the Aspose.PUB for .NET GitHub examples page. If you are looking to read, view, or convert Microsoft Publisher documents on the fly using your mobile device, please check out the Free Online PUB File Processing Apps we provide.

PUB File Manipulation with No Dependencies

Aspose.PUB for .NET is a standalone API that does not need additional software installations. Users are not required to set up Microsoft Publisher to work with PUB files on the .NET platform. The .NET Publisher API ensures a no-dependency user experience for anyone working with it to process PUB documents. If you are looking to read and manipulate PUB files or convert them to PDF and various other document and image file formats, Aspose.PUB for .NET is an excellent option for your Windows or Web-based services.

FAQ

1. How can I convert PUB files on the .NET platform?

Converting PUB files in .NET is quick and easy using the .NET Publisher API. It helps you convert PUB files to different formats such as PDF, Word, HTML, JPEG, PNG, and more.

2. How long it takes to process Publisher files and convert them?

The PUB file manipulation API for .NET works fast and completes your PUB file reading, editing, converting, and processing requests in no time.

3. Is it safe to process PUB data files using the .NET API?

You can be sure of the security of your data files while processing them using the PUB document API. We ensure the privacy of your data and take all required measures to provide you with a secure user experience.

4. Can I process Microsoft Publisher files on different operating systems?

Yes, the .NET PUB files library works across different OS, frameworks, and operating environments. You can use it on the platform of your choice, and it does not require any additional software installation to function.

PUB File Manipulation Tools

Looking for help?

Checkout our support channels for help with your questions related to Aspose product API features and working.

Ready to get started?

Download Free Trial View All APIs