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

Free Support Forum - aspose.com

Test not visible in PDF after adding textFragments

Hi,

I am trying to add text fragment in an existing pdf, when I add the english text it appears fine, but when i try to add arabic content its not visible to the user, I observed that when select and copy + pase the content in a note pad, i can see the content which i have written in to the pdf.

can you please let me know what could be the issue.

Please find the attached screenshots for the more details.

Thanks,
Shivaji

Hi Shivaji,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for Java 10.8.0 in Eclipse Juno project running over Windows 7 (x64) and have observed that an OutOfMemory exception is being generated when trying to create a PDF document using following code snippet (based on code snippet which you have shared earlier). For the sake of correction, I have logged this problem as PDFNEWJAVA-35295 in our issue tracking system. Can you please share which version of API you are using and some details regarding your working environment. We are sorry for your inconvenience.

[Java]

com.aspose.pdf.Document pdfDocument = new
com.aspose.pdf.Document(“c:/pdftest/document_sign5.pdf”);<o:p></o:p>

Page page = pdfDocument.getPages().get_Item(pdfDocument.getPages().size());

Table table = new Table();

float topMargin = (float)page.getPageInfo().getHeight() - 100;//-this should be same as bottom margin set

//float leftMargin = (float)page.getPageInfo().getWidth() - 70;

table.setTop(topMargin);//680

table.setLeft(72);//70

table.setColumnWidths(String.valueOf(220));//this will display no of char per line

page.getParagraphs().add(table);

//table.setBorder(new BorderInfo(com.aspose.pdf.BorderSide.All, Color.getBlack()));

com.aspose.pdf.Row r1 = table.getRows().add();

Cell cell = r1.getCells().add();

com.aspose.pdf.Image image = new com.aspose.pdf.Image();

//image.setImageStream(new ByteArrayInputStream(signInfo.getUserSignatureByte()));

// image.setFile("c:/pdftest/test.jpg");

image.setFixHeight(60);

image.setFixWidth(80);

Table tab2 = new Table();

//table.setColumnWidths("220 30 220");

//(emptyspace signimage(80) emptyspace)

tab2.setColumnWidths("70 80 70"); //this total should match to the column width mentioned in prev method -80 for sign image to fit

//tab2.setDefaultCellBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All));

cell.getParagraphs().add(tab2);

com.aspose.pdf.Row r2 = tab2.getRows().add();

Cell c1 = r2.getCells().add();

Cell c2 = r2.getCells().add();

c2.setAlignment(HorizontalAlignment.Center);//center

// c2.getParagraphs().add(image);

Cell c3 = r2.getCells().add();

com.aspose.pdf.Row r3 = tab2.getRows().add();

Cell c4 = r3.getCells().add();

c4.setAlignment(HorizontalAlignment.Center);

c4.setColSpan(3);

String prefix = "الموضوع";//isArabic ? signInfo.getPrefixAr() : signInfo.getPrefixEn();

String visibleName ="الموضوع";//isArabic ? signInfo.getUserNameAr() : signInfo.getUserNameEn();

TextFragment name =

new TextFragment((prefix == null || "".equals(prefix)) ?

visibleName : prefix + " " + visibleName);

TextFragment designation =new TextFragment("الموضوع");

TextFragment entity =new TextFragment("الموضوع");

name.getTextState().setForegroundColor(com.aspose.pdf.Color.getBlack());

// if (isArabic) {

name.getTextState().setFont(com.aspose.pdf.FontRepository.findFont("Simplified Arabic"));

// designation.getTextState().setFont(com.aspose.pdf.FontRepository.findFont("Simplified Arabic"));

// entity.getTextState().setFont(com.aspose.pdf.FontRepository.findFont("Simplified Arabic"));

// }

TextFragment spaceFrag = new TextFragment("");

spaceFrag.getTextState().setFontSize(4);

c4.getParagraphs().add(spaceFrag);

c4.getParagraphs().add(name);

c4.getParagraphs().add(spaceFrag);

c4.getParagraphs().add(designation);

entity.getTextState().setLineSpacing(4);

c4.getParagraphs().add(entity);

//add empty line to the cell

//TextFragment emptyLine1 = new TextFragment("");

//c4.getParagraphs().add(emptyLine1);

pdfDocument.save(“c:/pdftest/ArabicTextAdded.pdf”);

Hi,

I have raised this issue for the text not displayed after adding to the existing pdf file,
Please find the attached document and the code snippet for the same.
I was using aspose.pdf-10.8.0 version of Aspose Pdf.

When I revert to old version(aspose-pdf-10.2.0) of the Aspose pdf, then it worked.

Please check and let us know which is the stable version of aspose.

Thanks,
Shivaji

Hi Shivaji,


I have again tested the scenario and still encountering OutOfMemory issue. The product team will first try resolving this issue and then we can further try replicating non-English text not rendering issue. We are really sorry for this inconvenience.

Hi,

We have purchased the license of Aspose, for our pdf conversion.

We have done some POC using the older version, and when we move to higher environment we took latest version of aspose, we faced issues mentioned in this query.

Would request you to suggest which version(stable) of the below packages we need to download.
1. aspose-barcode
2. aspose-pdf
3. aspose-words

As we have faced couple of issues, when we upgrade to latest version of aspose.
POC done on below versions.
aspose-barcode-6.8.0
aspose-pdf-10.2.0
aspose-words-15.7.0-jdk16


upgraded version on higher environment which had some issues mentioned here.
aspose-barcode-7.3.0
aspose.pdf-10.8.0
aspose-words-15.9.0-jdk16

Please confirm on these.
Note: I have raised one separate thread for the same.

Thanks,
Shivaji

Hi Shivaji,

shivaji_dole:
Hi,

I have raised this issue for the text not displayed after adding to the existing pdf file,
Please find the attached document and the code snippet for the same.
I was using aspose.pdf-10.8.0 version of Aspose Pdf.

When I revert to old version(aspose-pdf-10.2.0) of the Aspose pdf, then it worked.

Please check and let us know which is the stable version of aspose.

Thanks,
Shivaji

Thanks for your inquiry. I am afraid I am unable to find any attachment with this post. If it is different than shared in initial post of the thread then please share it again and I will appreciate if you please use some static values to replicate the issue instead your custom variables.

Furthermore, I have tested your above shared code in initial post of the thread with 10.2.0 but I am afraid its not working as well. The issue relates to your other post. I have changed topMargin to 650 in code and text is appearing as expected both in 10.2.0 and 10.9.0.

Best Regards,
Hi Shivaji,

shivaji_dole:
Hi,

We have purchased the license of Aspose, for our pdf conversion.

We have done some POC using the older version, and when we move to higher environment we took latest version of aspose, we faced issues mentioned in this query.

Would request you to suggest which version(stable) of the below packages we need to download.
1. aspose-barcode
2. aspose-pdf
3. aspose-words

As we have faced couple of issues, when we upgrade to latest version of aspose.
POC done on below versions.
aspose-barcode-6.8.0
aspose-pdf-10.2.0
aspose-words-15.7.0-jdk16


upgraded version on higher environment which had some issues mentioned here.
aspose-barcode-7.3.0
aspose.pdf-10.8.0
aspose-words-15.9.0-jdk16

Please confirm on these.
Note: I have raised one separate thread for the same.

Thanks,
Shivaji

Thanks for your inquiry. Please note we maintain a single code base of Aspose APIs, so all the fixes and new features/enhancements are implemented in latest version of API. So it is always recommend to use latest version of Aspose APIs.

Furthermore in case of some regression issue, as you stated you found the regression issue, we treat that issue with high priority and usually fix in upcoming release. However I am afraid we could not replicate the issue as regression. Please share some more details to replicate the regression issue so we will treat it accordingly.

We are sorry for the inconvenience caused.

Best Regards,

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


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