Microsoft Publisher files are usually used to design and create documents for publishing on large scale. In some scenarios, you might need to convert PUB to PPT or PPTX Presentation file. In accordance with that, the article describes how to convert a Publisher PUB file to a PPT or PPTX Presentation file in Java.
- Java API to Convert PUB file to Presentation
- Convert PUB to PPT/PPTX Presentation File Programmatically in Java
Java API to Convert PUB file to PPT/PPTX Presentation
You will convert a PUB file to a PowerPoint Presentation as PPT or PPTX file in two steps. Firstly, you need to convert a PUB file to PDF using Aspose.PUB for Java API. Then you need to convert the intermediate PDF file to a Presentation file with Aspose.PDF for Java API. You can get the JAR files from the New Releases section, or specify the following configurations in the pom.xml file of your Maven-based projects:
<repositories> <repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>http://repository.aspose.com/repo/</url> </repository> </repositories>
<dependencies> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-pub</artifactId> <version>20.8</version> </dependency> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-pdf</artifactId> <version>21.8</version> </dependency> </dependencies>
Convert PUB to PPT/PPTX Presentation File Programmatically in Java
You can convert a Microsoft Publisher PUB file to a Presentation file in PPT or PPTX format with the steps below:
- Initialize ByteArrayOutputStream to hold intermediate PDF file.
- Initialize Pub Parser for the PUB file.
- Parse the input Publisher file.
- Convert PUB to PDF file and save output into the stream.
- Load the intermediate PDF file using the Document class object.
- Save the output PPT or PPTX file.
The following code snippet shows how to convert a PUB file to a PPT or PPTX PowerPoint Presentation programmatically in Java:
Try Online Demo
Please try the PUB to PPTX web app developed using this API.
Get Free API License
You can evaluate the Aspose APIs without any limitations by requesting a free temporary license.
In this article, you have learned how to convert or export Microsoft Publisher PUB file to a Presentation file as PPT or PPTX file programmatically in Java. You can embed this feature in your Java-based applications. Moreover, you can explore several other features offered by Aspose APIs by visiting the documentation. In case of any concerns, please feel free to reach out to us at the forum.