PUB to Word | Convert Publisher files to Word | PUB to DOCX

Microsoft Publisher is a widely used tool for creating attractive brochures, flyers, and other types of publications. However, when it comes to sharing or collaborating on publisher files, it might be a little stressful to work with publisher files. In such cases, we can convert PUB to Word. In this article, we will explore a free online tool to convert Publisher files to Word online.

Convert PUB to Word Online - PUB to DOCX

Convert your publisher files to Word documents using this free PUB to Word online converter app, and save the output in DOCX format. It runs entirely within your web browser, eliminating the need for additional software.

How to convert PUB file to Word Online

  1. Drag & drop the PUB file or use the online link to access the file from OneDrive, Google Drive, etc.
  2. Click the Convert button to perform the PUB conversion.
  3. The output in DOCX format will be prepared for download.
  4. Save the resultant DOCX file to your computer or mobile device.

For your privacy, your data is not stored on our servers. Download links expire after 24 hours for security reasons.

Convert Publisher Files to Word: A Developer’s Guide

As a developer, you can easily transform your Publisher files (PUB) into Word documents in two steps. First, convert the PUB file to a PDF format using the Aspose.PUB API. Then, convert the PDF pages into DOCX format using the Aspose.PDF API.

The following sections provide steps and code samples to convert PUB files to Word programmatically in .NET or Java.

Convert Publisher files to Word in C#

We can easily convert any PUB file to a Word document in C# by following the steps below:

The following code sample shows how to convert a PUB file to a Word document in C#.

// This code example demonstrates how to convert PUB to DOCX in C#.
using Aspose.Pdf.Devices;
using Aspose.Pdf;
using Aspose.Pub;
// Initialize a MemoryStream to hold output document
MemoryStream stream = new MemoryStream();
// Load the input PUB file
Aspose.Pub.IPubParser parser = Aspose.Pub.PubFactory.CreateParser("Sample.pub");
// Parse the input publisher file
Aspose.Pub.Document doc = parser.Parse();
// Convert the PUB file to PDF and save result in a MemoryStream
Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream);
// Load input PDF file from the MemoryStream
Aspose.Pdf.Document document = new Aspose.Pdf.Document(stream);
// Initialize DocSaveOptions class object
Aspose.Pdf.DocSaveOptions options = new DocSaveOptions();
// Specify the format of output word file (DOC/DOCX)
options.Format = DocSaveOptions.DocFormat.DocX;
// Save output word file (DOC/DOCX)
document.Save("PUBToWord.docx", options);

Convert Publisher files to Word in Java

Similarly, we can convert a PUB file to DOCX in Java by following the steps below:

The following code sample shows how to convert a PUB file to a Word document in Java.

// This code example demonstrates how to convert PUB to DOCX in Java.
// Initialize ByteArrayOutputStream to hold intermediary PDF file.
final ByteArrayOutputStream os = new ByteArrayOutputStream();
// Initialize Pub Parser for the PUB file
IPubParser parser = PubFactory.createParser("Sample.pub");
// Parse the Publisher file
com.aspose.pub.Document doc = parser.parse();
// Convert PUB to PDF file and save output into the stream
PubFactory.createPdfConverter().convertToPdf(doc, os);
// Load the intermediary PDF document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(os.toByteArray());
// Convert or Export the file to MS Word DOCX or DOC format
pdfDocument.save("PUBToDOCX.docx", SaveFormat.DocX);

Publisher files to Word Converter in C++

We can also convert a PUB file to DOCX in C++ by following the steps below:

The following code sample shows how to convert a PUB file to a Word document in C++.

// This code example demonstrates how to convert PUB to DOCX in C++.
// Source PUB and output PDF file paths
System::String filePub = u"C:\\Files\\Sample.pub";
System::String filePdf = u"C:\\Files\\Output.pdf";
// Load the PUB file
System::SharedPtr<IPubParser> parser = PubFactory::CreateParser(filePub);
System::SharedPtr<Aspose::Pub::Document> document = parser->Parse();
// Convert the PUB file to PDF
PubFactory::CreatePdfConverter()->ConvertToPdf(document, filePdf);
// Load the generated PDF file
auto pdfDocument = MakeObject<Aspose::Pdf::Document>(filePdf);
// Create an instance of the DocSaveOptions class
auto saveOptions = MakeObject<Aspose::Pdf::DocSaveOptions>();
// Set the format as DocX
saveOptions->set_Format(DocSaveOptions::DocFormat::DocX);
// Save the DocX file
pdfDocument->Save(u"C:\\Files\\PUBToWord.docx", saveOptions);

PUB to DOCX – Free License & Learning Resources

You can get a free temporary license to try the libraries without evaluation limitations.

Besides converting Publisher files to Word documents, you may also explore various other features of the library using the following resources:

Conclusion

In conclusion, converting Publisher files to Word is a simple and effective way to make your documents more accessible and easier to work with. By following the steps outlined in this article, you may choose to use an online PUB to DOCX conversion tool or develop your own converter application to transform your PUB file to Word format. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also