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

Free Support Forum - aspose.com

Not able to replace english string to arabic

Hi aspose
I am using aspose-pdf-kit-4.4.0-java to edit my pdf file. I want to replace "#-AB04JL#" string with "موهمجدا" . I can successfully replace this string with English data. But not able to replace this string with Arabic . Please help.

As its giving me an exception :
Not found appropriate font for the text[Ljava.lang.StackTraceElement;@1aaa14a

Data in My PDF is

#-AB04JL# #-AA04JL#
Some Arabic Data are: نموهمجداش
نموهمجداش

I am using code for that is

static String path = "./samples/resources/";

public static void main(String args[]) throws Exception {
try {
PdfContentEditor editor = new PdfContentEditor();
editor.bindPdf("RPT_TEST_10183.pdf");
editor.replaceText("RPT", "\u0634\u0627\u062f\u062c\u0645\u0647\u0648\u0645\u0646");
editor.save("RPT_TEST_10183_1.pdf");
} catch (java.io.IOException ioe) {
System.out.println(ioe.getMessage() + ioe.getStackTrace());
}
}

Hi Satish,


Thanks for using our products.

I have tested the scenario where I have tried reading the source input file using the code snippet which you have shared earlier but I am afraid I am getting an exception (java.io.IOException: PDF header signature error) while loading the PDF file. For the sake of correction, I have logged this problem as PDFKITJAVA-33258 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.