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

Free Support Forum - aspose.com

Hijri Date is displayed in English Numbers

Hello,

We are evaluating the words.net product family to use it to generate Arabic reports.

I have a document created using Aspose and before saving it to PDF we are setting the NumeralFormat for the PDF save options to “NumeralFormat.ArabicIndic”.

After saving the document and generating the PDF, the numbers are correctly displayed as “Arabic Indic” numbers, while the Hijri Dates like 10/10/1438 are not displayed with the correct numbers format.

Attached is the generated PDF file ,and an image highlight the problem of the hijri dates.

Regards,
Ahmed
Hi Ahmed,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.

Hello Tahir,

Thanks again for your quick response.
Attached is a demo showing our problem in the formatting, we have one additional problem we will report here.

Formatting Problems:
1- Some numbers are not displayed in the Arabic Indie format while we already set this to the document saving options. While other numbers in the document are formatted correctly.

2- In Arabic Language the Word “Allah” is displayed like this “الله” ,when we export the document to PDF we got it without the “Shada” - The sign above the word - as highlighted in the attached screenshot.

The demo application has an input file used to create the attached screenshot with highlighted formatting errors. The solution contains the input document called “dabt.docx” after you run you will find the output file “dabt.pdf” in the bin folder of the application.

Regards,
Ahmed
Hi Ahmed,

Thanks for sharing the detail. We have tested the scenario and managed to reproduce the following issues at our side. For the sake of correction, we have logged these problems in our issue tracking system as follow:

WORDSNET-15508 : Hijri Date is displayed in English Numbers in output DOCX/PDF
WORDSNET-15509 : Arabic text is not rendered correctly in output PDF

You will be notified via this forum thread once these issues are resolved. We apologize for your inconvenience.

Dear Tahir,

Thanks for your quick reply, do you have any idea when the issue WORDSNET-15509 could be solved because it’s the most critical for us?

Regards,
Ahmed
Hi Ahmed,

Thanks for your inquiry. We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. Our developers work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, WORDSNET-15509 issue is under analysis phase. Once our product team completes the analysis of this issue, we will then be able to provide you an estimate.

Thanks for your patience and understanding.

Dear Tahir,


If you have any workaround to solve this issue we are happy to try it.

Regards,
Ahmed
Hi Ahmed,

Thanks for your inquiry. Please try following workaround. Hope this helps you.

var doc = CreateDabtDocument();

foreach (Run run in doc.GetChildNodes(NodeType.Run,true))

{

if(run.Font.LocaleIdBi != 1025)

run.Font.LocaleIdBi = 1025;

}

var pdfSaveOptions = new PdfSaveOptions();

pdfSaveOptions.NumeralFormat = NumeralFormat.ArabicIndic;

doc.UpdatePageLayout();

doc.Save(MyDir + "17.6.pdf", pdfSaveOptions);

Hello Tahir,
Sorry for my late response, we were on Vacation.

I would like to let you know that I have tried your solution and it’s not working out.

I have tried another solution, let me tell you but it’s still not solving all cases. I got the unicode value for the word “Allah” and find and replaced it in the document as the following

doc.Range.Replace(“الله”, “\uFDF2”, false,true);

and it’s working fine without any problem, What I can’t find is the unicode value for the word “لله” without “alf” in the beginning of the word, If you could help me with the correct unicode value for the word “لله” my problem will be solved.

Regards,
Ahmed

@ahmedode,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 17.6 with following code example and have not found the shared issue. Please try Aspose.Words for .NET 17.6. We have attached the output PDF with this post for your kind reference. 17.6.pdf (54.7 KB)

var doc = CreateDabtDocument();
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.NumeralFormat = NumeralFormat.ArabicIndic;

doc.Range.Replace(“الله”, “\uFDF2”, new FindReplaceOptions());
doc.UpdatePageLayout();
doc.Save(MyDir + “17.6.pdf”, pdfSaveOptions);

Best Regards,
Tahir Manzoor

Dear Tahir,
The issue still exist and am using version 17.6, kindly check the attached screenshot which illustrate the issue for you.
AsposeIssue.png (61.5 KB)

The highlighted red word is not correctly formatted, note that the word Allah “الله” is correct, but the word “لله” is not correctly formatted, the other word is another variation of the word “الله” but without the first letter from right. so the problem is that the first word is correctly formatted while the other is not.

Regards,
Ahmed

@ahmedode

Thanks for your feedback. We are sorry to know that suggested workaround is not working for all the scenarios, so please wait for the fix of logged issue (WORDSNET-15509). We will notify you as soon as we made some significant progress towards issue resolution.

Thanks for your patience and cooperation.

Best Regards,

@ahmedode,

Thanks for your patience.

If we read the text from “Text.txt”, the numbers are in English format. Could you please share expected output for number’s issue? Thanks for your cooperation.

The issues you have found earlier (filed as WORDSNET-15508) have been fixed in this Aspose.Words for .NET 18.8 update and this Aspose.Words for Java 18.8 update.

The issues you have found earlier (filed as WORDSNET-15509) have been fixed in this Aspose.Words for .NET 20.5 update and this Aspose.Words for Java 20.5 update.