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");
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,
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
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
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
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.