We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Pdf to Html

Using Aspose.Pdf to Html, is it possible to generate an Html file with all of the images and fonts embedded within it, rather than storing resource in a folder?

Hi Bill,

Thanks for contacting support.

When converting PDF file to HTML format, the resources including Font, Images, css etc are stored in separate folder and I am afraid the current release versions of Aspose.Pdf for .NET does not support the feature to convert PDF to single web archive (MHT). However for the sake of implementation, we already have logged this requirement as PDFNEWNET-36340 in our issue tracking system under New Features list. The development will further investigate this requirement in
details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

The issues you have found earlier (filed as PDFNEWNET-36340) have been fixed in Aspose.Pdf for .NET 9.6.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Bill,

Thanks for your patience. As stated above your reported issue has been fixed, now you can create a single HTML file output with embedded resources using Aspose.PDF for .NET 9.6.0. Please download the release and try using it as following.

Document doc = new Document(myDir + "36608.pdf");
HtmlSaveOptions newOptions = new HtmlSaveOptions();

// this is usage of tested feature
newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;

// this is just optimization for IE ( Internet Explorer ) and can be omitted
newOptions.LettersPositioningMethod =HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;

newOptions.RasterImagesSavingMode =HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;

newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
string outHtmlFile = myDir + "ExternalTestsData/36340.html";
doc.Save(outHtmlFile, newOptions);