Free Support Forum - groupdocs.com

Arabic does not appear correctly

Dears ,
I’m evaluating GroupDocs.Viewer_20.1.1 version , documents have Arabic letters were converting correctly from (Word file to PDF file and Excel file to PDF file ) , but when convert from (XML file to PDF and TXT file to PDF file ) the Arabic letter will change the something unreadable . I have attached them .

Regards,
Elnour .

file.zip (1.9 KB)
file.zip (1.86 KB)

@eelnour

Can you please also share the Word file? Have a look at this . This is how the font is rendered at our end.
screenshot.PNG (45.0 KB)

Thank you for replay , please find the attached file .

Regards ,Test.pdf (466.3 KB)

Elnour.
Test.pdf (466 KB)

@eelnour

We are investigating this scenario. Your investigation ticket ID is VIEWERJAVA-2306. As there’s any update, you’ll be notified.

Noted , Thank you .

@eelnour

You’re welcome.

@eelnour

In order to resolve the issue please set charset to UTF-8 as shown in the code snippet:

LoadOptions loadOptions = new LoadOptions();
loadOptions.setCharset(Charset.forName("UTF-8"));

PdfViewOptions viewOptions = new PdfViewOptions(filePath + ".pdf");
Viewer viewer = new Viewer(filePath, loadOptions);
viewer.view(viewOptions);
viewer.close();

By default, it uses default system charset Charset.defaultCharset(). When loading TXT and XML files it makes Arabic characters to be rendered incorrectly. Please follow the above code and let us know if issue persists.