Convert PUB to Word Document (DOC/DOCX) in C#

PUB to Word DOCX DOC

Microsoft Publisher files are popularly used for professional designing and editing tasks. You can convert a PUB file to a Word document in DOC and DOCX format. This article covers how to convert the publisher files programmatically using C#:

PUB to Word DOC/DOCX Converter – C# APIs Installation

Aspose.PUB for .NET API supports PUB to PDF file conversion where you can further convert the output PDF file to a Word Document in DOC or DOCX format as per your requirements. Therefore, you need to download the DLL files of Aspose.PUB for .NET and Aspose.PDF for .NET API. You can also install these APIs with the following NuGet installation commands:

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

Convert PUB to Word DOC/DOCX Programmatically using C#

You can convert Microsoft Publisher (.PUB) file to a Word document in DOC or DOCX format with the following steps:

  1. Initialize a MemoryStream to hold output document.
  2. Load and parse the input PUB file with IPubParser.Parse() method.
  3. Convert the PUB file to PDF and save the result in a MemoryStream.
  4. Load the PDF file and initialize the DocSaveOptions class object.
  5. Finally, specify the output format (DOC/DOCX) and save the Word file.

The below code shows how to convert a PUB file to a Word document in DOC or DOCX format programmatically using C#:

Get Free API License

You can test the PUB to Word file conversion without any limitations by requesting a Free Temporary License.

Conclusion

In this article, you have learned how to convert Microsoft Publisher (PUB) files to Microsoft Word files in DOC or DOCX format programmatically using C#. You can check the high fidelity conversion by following the simple steps listed above. Moreover, you can further explore the API by visiting the Documentation, or please feel free to write to us at the Free Support Forum in case of any queries. We look forward to getting in touch with you!

See Also

Convert PUB to PNG, JPEG, or TIF Image using C#