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

Free Support Forum - aspose.com

Issue with latest version of aspose pdf jar while writing text with textFragment in table


We have used old version of Aspose pdf(10.2.0) jar to implement html to pdf conversion and write text to pdf file.

Now we tried to use the latest(10.8.0) jar file of the same package as we moved our implementation to next level environment, and observed that there is an issue that when we write the text to the existing pdf file, text is truncated.

Please find the attached files for reference.
aspose.pdf.10.2.0.PNG – text displayed properly, as highlighted.
aspose.pdf.10.8.0.PNG – text is truncated, with the 10.8.0 version of the aspose jar file.

also attached the pdf files generated.

below is the code snippet used to generate/write text to pdf. Note that I have used the same code

snippet to write text to pdf file.
Table table1 = new Table();
//table1.setColumnWidths(“2”.equals(secVal)? “100” : “85”);//required to set the alignment of the lable
//table1.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, Color.getBlue()));
//table1.setLeft(“2”.equals(secVal) ? 438 : 440);
Row row1 = table1.getRows().add();
Cell cell1 = row1.getCells().add();
TextFragment name1 = new TextFragment(securityClass);
if (!“1”.equals(secVal)) {
name1.getTextState().setForegroundColor(Color.fromArgb(172, 19, 19));
TextFragment text = new TextFragment("");
cell1.getParagraphs().add(text); //leave one paragraph space

Please let me know if more details required.

Thanks in advance.

Hi Hana,

Thanks for your inquriy. We have tested the scenario with 10.2.0 and 11.0.0 and noticed the regression issue of text truncation, so logged a ticket PDFNEWJAVA-35353 for further investigation and rectification.

We are sorry for the inconvenience caused.

Best Regards,

Thank You!

Please let us know once you resolve the issue, we can plan to upgrade to latest version of Aspose, on our side.


Hi Hana,

Thanks for your feedback. Sure we will notify you in the forum thread as soon as the issue is resolved and you will also get an automated email notification at your associated email id.

Best Regards,

Hi Hana,

Our product team has completed the initial investigation and noticed that the issue is causing due to margins and now they will plan its fix. We will keep you updated about the issue resolution progress.

However, currently you can use any one of following solutions for a workaround till complete fix:

  • To reduce the right margins value before the document save. Default value in 90, you can reduce it.
  • To move the table 10 points left.
    table1.setLeft(430);//instead 440

Best Regards,

Thank you for the update.

We would like to know that issue resolved, otherwise we need to update our implementation logic where it will impact our production environment.

Hi Hana,

Thanks for your feedback. Sure, we will notify you as soon as we resolve the issue.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWJAVA-35353) have been fixed in Aspose.Pdf for Java 11.2.0.

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