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

Free Support Forum - aspose.com

Render HTML inside PDF - Display HtmlFragment Value correctly inside PDF document

Hi Team,
I am passing Html content to HtmlFragment class to generate pdf,
My HTML content contains
</INPUT readonly>
Element which shows “Sri Lanka” value on UI, but the same value is able display in PDF.

@abhijitsavant

Would you kindly share complete HTML string which you are trying to add in PDF along with some screenshot of error that you are facing. We will test the scenario in our environment and address it accordingly.

HTML.JPG (52.6 KB)
PDF.JPG (16.0 KB)Constant.zip (1.4 KB)

HTML.jpg On UI The Domicile Country value is displayed
PDF.jpg In PDF the Domicile Country value is missing
Constant.zip Contains java file contains String HTML fragment, which is passed as input to new com.aspose.pdf.HtmlFragment(Constant.HTML);

@abhijitsavant,

Can you please share which version of Aspose.PDF you are using on your end. Also please share complete working sample code so that we may further investigate scenario in our environment to help you out.

We are using ASPOSE JAVA 19.3 version.
In com.aspose.pdf.HtmlFragment summaryOfInv = new com.aspose.pdf.HtmlFragment(Constant.HTML); pass Constant declared in Constant.java
Java Code.zip (2.3 KB)

@abhijitsavant,

Can you please try to use Aspose.PDF latest version 19.11 on your end and share feedback with us if there is still an issue.

Hey Adnan,
Thanks for your response, We cant upgrade to new version for this change(The migration impacts heavy burden on entire project) please suggest us any solution with 19.3 only.

@abhijitsavant

We would like to share with you that Support is provided on the basis of latest version of the API. We have tested the scenario in our environment using Aspose.PDF for Java 19.11 and noticed that output PDF was not in correct format. html19.11.pdf (1.3 MB)

Hence, we have logged an issue as PDFJAVA-39062 in our issue tracking system. We will further check the details of why API was unable to render the HTML correctly and let you know about the updates regarding ticket resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.

Thanks…Let us know once you receive any response.

@abhijitsavant,

Sure, we will inform you as soon as possible if there is any update.

Hey Ahmad,
Any updates on the ticket?

@abhijitsavant

Please note that the issue has been logged recently in our issue tracking system and is pending for analysis. As it was logged under free support model, it has low priority and will be resolved on first come first serve basis. We will let you know in case we have some definite updates regarding its resolution. Please spare us some time.

We are sorry for the inconvenience.