Pdf to html with base64 embeded image

Hi,

I’m testing aspose PDF for converting pdf files to xhtml and text.
I’ve no problem to convert my documents to text.
Exporting document as html work fine but, i would know if there is a way to embed images as base64.
I’ve seen that aspose words have an option to do that with HtmlSaveOptions.setExportImagesAsBase64 but i can’t found something like that with aspose pdf .

Cordialy

Hi Pepin,


Thanks for contacting support.

I am afraid the request feature is currently not supported. However for the sake of implementation, I
have logged it in our issue tracking system as PDFNEWJAVA-34415. We will investigate this
issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Hi Pepin,


Thanks for your patience. Please use following code snippet to embed images as base64 data in HTML. It will help you to accomplish the task.

Document doc = new Document(“the_little_prince.pdf”);<o:p></o:p>

HtmlSaveOptions htmlOptions = new HtmlSaveOptions();

htmlOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;

htmlOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;

htmlOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;

doc.save("the_little_prince.html", htmlOptions);


Please feel free to contact us for any further assistance.

Best Regards,