How to render Arabic text in the pdf files

The pdf file containing Arabic or similar languages which are read/written from right to left are not rendering properly.

@Rahul_Disprz

Would you please share a little bit more details about the issue that you are facing? Please share some sample source and output files along with the code snippet that you are using. We will test the scenario in our environment and address it accordingly.

Sure @asad.ali . Attaching a sample file here.
اَلسَّلَامعَلَيْكُمْوَرَحْمَةِاَللَّهِوَبَرَكَ.docx (9.8 KB)

@Rahul_Disprz

It is a word document. Are you generating PDF from it? Can you please share which code snippet are you using?

Hi @asad.ali no we are rendering pdf file only. Attaching a sample here
sample_arabic.docx.pdf (17.3 KB)

Also here is a code snippet -
image (5).png (13.1 KB)

@Rahul_Disprz

Attached is the output image file that we received in our environment using below code snippet and the latest version of the API:

Document pdfDocument = new Document(dataDir + "sample_arabic.docx.pdf");
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
    using (FileStream imageStream = new FileStream($"{dataDir}image{pageCount}_out.jpg", FileMode.Create))
    {
        Resolution resolution = new Resolution(300);

        JpegDevice jpegDevice = new JpegDevice(resolution, 100);

        jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);

        imageStream.Close();
    }
}

image1_out.jpg (47.4 KB)

Can you please make sure that all the fonts that can render non-English characters are present in your system?