Arabic font does not appear correctly using Java

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.

Hi ,
the below code is working fine in stand alone java application , but when hosting in server loadOptions is not loading uft config , the Arabic showing wrongly

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

	       	PdfViewOptions options = new PdfViewOptions(output_path+outputFile); // pdf path 
	  	 	Viewer viewer;
			
			viewer = new Viewer(input_path,loadOptions);

	  	 	viewer.view(options);
	  	 	viewer.close();

any explications for this case .
Regards ,
Elwalied .

@eelnour

This happens for TXT file only (TXT file with Arabic font)? Can you please share your server details?

Hi ,

Yes only happens for TXT other format working fine , the server details i’m hosting servlet in webloic 12 c .

Regards ,
Elwalied .

@eelnour

We’re looking into this scenario, you’ll be notified about the outcomes.

Thank you , it’s working fine , I have separate the txt file view in one method .

Regards ,
Elwalied .

1 Like

@eelnour

Glad to know that your issue is resolved.

Dear ,

We have test the GroupDocs.Viewer-free version and it’s working fine
and show two pages as evaluation , please confirm the full version will show all documents pages . this raised by management .

Regards ,
Elwalied

1 Like

@eelnour

Yes, when you apply API license, you’ll get all document pages without evaluation mark. Even you can evaluate API using a temporary license, that you can request here.