PDF to HTML - embeded CSS

I am converting PDF to HTML.

after convertion I get external CSS file.
Do I have option to get the CSS inside the output html ?

Thanks.

Hi Yehuday,


Thanks for contacting support.

MHT is a format where Images/Fonts/CSS etc are embedded inside the HTML. I am afraid Aspose.Pdf for .NET does not support the feature to convert PDF file to MHT format. For the sake of correction, we already have logged this requirement as PDFNEWNET36340 in our issue tracking system. The development team will further look into the details of this requirement and will keep you posted on the status of correction.

We are sorry for this inconvenience.

my purpose was not to convert to MHT.

my question was if I have option to get the CSS values by In-page Style Tags or inline style attribute
in the html file instead of external css file ( )

Tיק Desired result:









yehuday:
my purpose was not to convert to MHT.
my question was if I have option to get the CSS values by In-page Style Tags or inline style attribute
in the html file instead of external css file ( )

Tיק Desired result:



....



....

Hi Yehuday,

Thanks for sharing the details.

I am afraid the above stated requirement is not supported. However for the sake of implementation, I have logged this requirement as PDFNEWNET-36608 in our issue tracking system under New Features list. The development team will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

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


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

Hi Yehuday,


Thanks for your patience.

In order to accomplish your requirement, please try using following code snippet.

[C#]

//
load source PDF file
<o:p></o:p>

Document doc = new Document(@"F:\ExternalTestsData\36608.pdf");

// instanatiate HTML Save options object

HtmlSaveOptions newOptions = new HtmlSaveOptions();

// this is usage of tested feature

newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedCssOnly;

// this is just optimozation for IE and can be omitted

newOptions.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;

newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;

newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;

// output file path

string outHtmlFile = @"F:\ExternalTestsData\36340.html";

doc.Save(outHtmlFile, newOptions);