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

Hi,

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(“85”);
//table1.setColumnWidths(“2”.equals(secVal)? “100” : “85”);//required to set the alignment of the lable
table1.setHorizontalAlignment(HorizontalAlignment.Center);
//table1.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, Color.getBlue()));
//table1.setLeft(“2”.equals(secVal) ? 438 : 440);
table1.setLeft(440);
//table1.setTop(150);
Row row1 = table1.getRows().add();
page.getParagraphs().add(table1);
Cell cell1 = row1.getCells().add();
TextFragment name1 = new TextFragment(securityClass);
name1.getTextState().setFontSize(14);
name1.setHorizontalAlignment(HorizontalAlignment.Center);
if (!“1”.equals(secVal)) {
name1.getTextState().setForegroundColor(Color.fromArgb(172, 19, 19));
}
TextFragment text = new TextFragment("");
text.getTextState().setFontSize(4);
cell1.getParagraphs().add(text); //leave one paragraph space
cell1.getParagraphs().add(name1);

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.

Thanks,

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.
    doc.getPages().get_Item(1).getPageInfo().getMargin().setRight(80);
  • 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.