Free Support Forum - aspose.com

Facing problem converting an HTML5 HTML to PDF using Aspose.PDF java library

Hi Team,

I am trying convert an HTML file which contains style attributes to a PDF document using the below java code.

Code:
String basePath = “C:\HTML to PDF\”;
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
// Load HTML file
Document doc = new Document(basePath + “input.html”, htmloptions);
// Save HTML file
doc.save(“c:/HTML to PDF/output.pdf”);

I have attached a zip with the input and output files. And as you can see from the PDF some of its contents are getting squished.

Could you please help me resolve this problem?
Happy to provide any other information you might require.

Thanks,
Vikram

files.zip (121.2 KB)

@VikramR

Thank you for contacting support.

We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFJAVA-37637 has been logged in our issue management system for further investigation and resolution. The issue ID has been linked with this thread so that you will receive notification as soon as the issue is resolved.

Furthermore, once the issue is resolved, the content in output PDF will look like attached screenshot. Expected_Output.JPG

We are sorry for the inconvenience.

Thanks for acknowledging my post Farhan.
Looking forward for a resolution :slight_smile:

Hi Farhan,

Just following up this ticket.

I had a go with the new 18.4 release to see if this problem was resolve but unfortunately it wasn’t resolve as expected (release notes did not list a fix for PDFJAVA-37637).

I was just wondering if it might make it into 18.5 at the end of May.

Cheers,
Vikram

@VikramR

We would like to share with you that the issue reported by you, PDFJAVA-37637, has not been investigated owing to previously logged issues. It will be investigated on its due turn, that can take several months. We will notify you as soon as this ticket will be resolved. Please be patient and spare us little time.