For more details, please visit Convert PUB to HTML Webpage File with Java
Last active
December 23, 2021 05:59
-
-
Save aspose-com-gists/b4f7d3d35bcf8bc8de43294ef3b80a97 to your computer and use it in GitHub Desktop.
Convert Publisher file PUB to HTML webpage 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
// Initialize ByteArrayOutputStream to hold intermediary PDF file. | |
final ByteArrayOutputStream os = new ByteArrayOutputStream(); | |
// Load input PUB file | |
IPubParser parser = PubFactory.createParser("Sample.pub"); | |
// Parse the input publisher file | |
com.aspose.pub.Document doc = parser.parse(); | |
// Convert the PUB file to PDF and save result in a ByteArrayOutputStream | |
PubFactory.createPdfConverter().convertToPdf(doc, os); | |
// Load input PDF file from the ByteArrayOutputStream | |
com.aspose.pdf.Document document = new com.aspose.pdf.Document(os.toByteArray()); | |
// Initialize HtmlSaveOptions class object | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Convert PUB file to HTML webpage | |
document.save("Output.html", options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment