The conversion of HTML to PDF and PDF to HTML are one of the features most requested by our customers. Although the HTML format is quite complex because there are so many custom tags and their exact rendering inside PDF is a complex job, our developers are working to provide support for all HTML tags.
Many of our customers generate PDF files and want to display them ins web browsers. One approach is to load custom PDF viewing controls provided by Adobe or other companies or, the PDF files can be converted to HTML format and then HTML can be rendered in the web browser. The simplest conversion of PDF to HTML can be accomplished with two-lines of code and the output can be displayed in a web browser.
Advanced PDF to HTML Conversion
You can also use the advanced features offered by our API during PDF to HTML conversion. Some of the recent enhancements include:
MHT to PDF conversion
Another exciting feature introduced in Aspose.Pdf for .NET 9.0.0 is the conversion of MHT to PDF format. The single web archive can now be converted to PDF format using MhtLoadOptions class.
string inFile = "@F:\\ExternalTestsData\\email.mht"; string outFile = "@F:\\ExternalTestsData\\email.pdf"; MhtLoadOptions options = new MhtLoadOptions(); // Load PDF document Aspose.Pdf.Document document = new Document(inFile, options); // Save the output as PDF document document.Save(outFile);
For further details, please take a look at Convert MHT to PDF Format
Working with Digital Signatures
Aspose.Pdf for .NET provides the capability to digitally sign PDF files by adding digital signatures. While adding a signature, we add signer information and assign an image for the signature’s appearance. The recent release of Aspose.Pdf for .NET now offers the feature to extract signature information from digitally signed PDF file. For further details, please visit:
- How to extract signature information using the PdfFileSignature class
- How to extract signature information using the SignatureField class
- Extract image from signature field using the PdfFileSignature class
- Extract image from signature field using the SignatureField class
Export Bookmarks to XML
As well as the features mentioned above, other enhancements have also been introduced in this release. The methods ExportBookmarksToXML(...) and ImportBookmarksWithXML(...) with Stream arguments are implemented in the PdfBookmarkEditor class. So now extracted bookmarks can be saved into stream object.
PdfBookmarkEditor editor = new PdfBookmarkEditor(); Document pdf = new Aspose.Pdf.Document("36394.pdf"); editor.BindPdf(pdf); MemoryStream ms = new MemoryStream(); editor.ExportBookmarksToXML(ms);
For more information, please take a look at Export Bookmarks to XML Format.
Improved Performance for PDF Concatenation
In some cases, when there are a lot of outlines, users may disable them by setting CopyOutlines to false and improve performance of concatenation. Therefore, the CopyOutlines property has been added in PdfFileEditor class.
PdfFileEditor pfe = new PdfFileEditor(); string files = Directory.GetFiles(dir); pfe.CopyOutlines = false; pfe.Concatenate(files, TestSettings.GetOutputFile("out.pdf"));
Be the first to download and start exploring the features of Aspose.Pdf for .NET 9.0.0.