Font family and alignment is collapsing

Hello, When I convert few PDFs to HTML. I noticed there are issues with converted html files such as alignment, fonts, and image resolution.
I have attached two pdf files for you to verify the issue.,

  1. “Axa_ France_ AR2018.pdf” - html produced has alignment and font issues - please check page no 124 content.
  2. "AB INBEV Belgium_ AR 2018.pdf "- page no. 27. paragraph truncated and alignment has changed
  3. Html files generated by Aspose.pdf lost most/all the image resolution. So please let me know how I can over come mentioned issues.

AB INBEV Belgium_ AR 2018.pdf (5.5 MB)
Axa_ France_ AR2018.pdf (3.4 MB)
Axa_ France_ AR2018.png (133.8 KB)
AB INBEV Belgium_ AR 2018.png (548.3 KB)

@ajimr11

Thank you for contacting support.

We have worked with the data and have been able to reproduce the problem which you have explained with AB INBEV Belgium_ AR 2018.png. A ticket with ID PDFNET-46522 has been logged in our issue management system for further investigations and resolution.

About image resolution, HtmlSaveOptions class exposes several properties which can be used to control image resolution, as under:

// Open the source PDF document
Document pdfDocument = new Document(dataDir + "Axa_ France_ AR2018.pdf");

HtmlSaveOptions options = new HtmlSaveOptions();
options.ImageResolution = 300;

// Save the file into HTML format
pdfDocument.Save(dataDir + "Axa_ France_19.6.html", options);

Moreover, about the first issue you have listed above, we are unable to reproduce it in our environment with latest version of the API. We have attached a screenshot for your kind reference. Axa_ France_ AR2018_19.6.PNG

Please ensure using Aspose.PDF for .NET 19.6 and feel free to contact us if you need any further assistance.

Thanks for the response.It is good to know that you have property for image resolution and will check with 19.6 version for font issue.

Hi, Image resolution goes down when I embedded images (newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;) into html file, but in normal option images go to separate folder and image quality is OK for some extend. Could you please tell me how I can create html with good resolution embedded images…

Document doc = new Document(pdfFile);
HtmlSaveOptions newOptions = new HtmlSaveOptions();

        //newOptions.ImageResolution = 300  //this property is not doing anything on my output!

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

        // 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;

        doc.Save(outHtmlFile, newOptions);

options.ImageResolution = 300 is not working with single html option (embedded) could you please help me on this.

@ajimr11

Thank you for elaborating it further.

We have logged another ticket, PDFNET-46526, for the problem with images during PDF to HTML rendering and will let you know once any further update will be available in this regard.

Hi Any Update on this?

@ajimr11

Thank you for getting back to us.

As the issues have been logged under free support model, it may take some time to resolve. As soon as we have some definite updates or ETA regarding resolution, we will let you know.