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.
Please find the attached screenshots for the more details, also added code snippet and pdf document which i used to update the text.
I observed this is happening with latest version of aspose pdf jar 10.8.0, when i tested with old version of aspose(10.2.0) it was fine.
can you please let me know what could be the issue.
Thanks in advance,
Hi Hana,
Hi Hana,
com.aspose.pdf.Document pdfDocument = new
com.aspose.pdf.Document();<o:p></o:p>
Page page = pdfDocument.getPages().add();
Table table = new Table();
float topMargin = (float)page.getPageInfo().getHeight() - 20;//-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();
com.aspose.pdf.Cell cell = r1.getCells().add();
com.aspose.pdf.Image image = new com.aspose.pdf.Image();
image.setFile("c:/pdftest/aspose-Pdf-for-net_100.png");
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 ="مدير ادارة الموارد البشرية";
String visibleName ="مدير ادارة الموارد البشرية";
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());
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,
Thank you for looking in to the issue reported.
Please find the pdf file which we use to add text in it.
Thanks in advance!
Hi Hana,
as PDFNEWJAVA-35364 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time. We are sorry
for this inconvenience.
Thank you for the update!
Please let me know if further details required on this and update us once the issue is resolved.
Thanks,
Hi Hana,
The issues you have found earlier (filed as PDFNEWJAVA-35364) have been fixed in Aspose.Pdf for Java 11.3.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.