You can find more details at: Convert PUB to PPT or PPTX in Java
Last active
January 13, 2022 09:07
-
-
Save aspose-com-gists/fe646f67623ee908e0403f3f1f6ae2ee to your computer and use it in GitHub Desktop.
Convert PUB to PPT PPTX PowerPoint Presentation Programmatically in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment