Explore the ease and efficiency of converting Publisher to PowerPoint online.
https://blog.aspose.com/pub/convert-publisher-to-powerpoint/
Explore the ease and efficiency of converting Publisher to PowerPoint online.
https://blog.aspose.com/pub/convert-publisher-to-powerpoint/
// This code example demonstrates how to convert Publisher file into PowerPoint presentation in C#. | |
string fileName = "Test.pub"; | |
// Initialize a MemoryStream to hold output document | |
MemoryStream stream = new MemoryStream(); | |
// Load input PUB file | |
IPubParser parser = PubFactory.CreateParser(fileName); | |
// Parse the input publisher file | |
Aspose.Pub.Document doc = parser.Parse(); | |
// Convert the PUB file to PDF and save result in a MemoryStream | |
PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream); | |
// Load input PDF file from the MemoryStream | |
Document document = new Document(stream); | |
// Initialize PptxSaveOptions class object | |
PptxSaveOptions options = new PptxSaveOptions(); | |
// Save output presentation file (PPT/PPTX) | |
document.Save("Output.pptx", options); |
// This code example demonstrates how to convert Publisher file into PowerPoint presentation in Java. | |
// Specify path for input Publisher file | |
String fileName = "Test.pub"; | |
// Initialize ByteArrayOutputStream to hold intermediary PDF file. | |
final ByteArrayOutputStream os = new ByteArrayOutputStream(); | |
// Initialize Pub Parser for the PUB file | |
IPubParser parser = PubFactory.createParser(fileName); | |
// 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 | |
Document pdfDocument = new Document(os.toByteArray()); | |
// Convert or Export the file to PPTX format | |
pdfDocument.save("Output.pptx", new PptxSaveOptions()); |