You can find all the details at: Convert PUB to HTML webpage Programmatically using C#
Last active
June 29, 2021 21:56
-
-
Save aspose-com-gists/ee7d21b2b6c232a60bb673d9aca3bdac to your computer and use it in GitHub Desktop.
Convert PUB to HTML XHTML HTML5 Programmatically using C#
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
string fileName = "1.pub"; | |
MemoryStream stream = new MemoryStream(); | |
// Load input PUB file | |
Aspose.Pub.IPubParser parser = Aspose.Pub.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 | |
Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream); | |
// Load input PDF file from the MemoryStream | |
Aspose.Pdf.Document document = new Document(stream); | |
// Initialize HtmlSaveOptions class object | |
Aspose.Pdf.HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Save output HTML webpage | |
document.Save("Output.html", options); |
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
string fileName = "1.pub"; | |
MemoryStream stream = new MemoryStream(); | |
// Load input PUB file | |
Aspose.Pub.IPubParser parser = Aspose.Pub.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 | |
Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream); | |
// Load input PDF file from the MemoryStream | |
Aspose.Pdf.Document document = new Document(stream); | |
// Initialize HtmlSaveOptions class object | |
Aspose.Pdf.HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Set Html document type | |
options.DocumentType = HtmlDocumentType.Xhtml; | |
// Save output 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