When I save Word docm file with PDF format, The numbers are transformed from Arabic numbers to English number. The environment is: Windows Arabic (UAE), Arabic Office and number format is set to Arabic/Persian in both Windows and Word.
So is this an Aspose.Word bug? Is there a work around?
I have attached a sample application showing the problem.
Thanks for your inquiry. In you case, please use PdfSaveOptions.NumeralFormat property. This property gets or sets NumeralFormat used for rendering of numerals. European numerals are used by default.
Document doc = new Document(MyDir + "ArabNumberReport.docm");
PdfSaveOptions option = new PdfSaveOptions();
option.NumeralFormat = NumeralFormat.ArabicIndic;
doc.Save(MyDir + "AsposeOut.pdf", option);
I have attached the output PDF file with this post. Please let us know if you have any more queries.
However the code you sent me is not working with PageCount property set. I have tried it with NumeralFormat set to ArabicIndic, EasternArabicIndic, Context and Systems and all of them result of having numbers set to “European” numbers:
If I remove PageCount = wordDocument.PageCount, NumeralFormat is working fine. Can you confirm or not it is an Aspose.Word cell?
Workaround needed for 11.7.0 :
I notice PdfSaveOptions doesn’t have NumeralFormal property in 11.7.0. As the version 11.7.0 is the official version used by us, can you provide me with a workaround to set NumeralFormat (or have the persian number)?
Thanks for sharing the details. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-7182 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.
Thank for your inquiry. Please do not use the Document.PageCount property in your code. Please use integer value (e.g 1, 2) for PdfSaveOptions.PageCount instead Document.PageCount as shown below:
However, that doesn’t answer my question. How can we make it work in Aspose.Words 11.7.0? is there a workaround?
Note: We cannot set an integer to PageCount for a the simple reason it is a variable. We need to pass the wordDocument.PageCount as it is different from a document to another.
Please accept my apologies for your inconvenience. Unfortunately, there is no workaround for this issue. The PdfSaveOptions.NumeralFormat does not work when Document.PageCount is used. We will update you via this forum thread once this issue is resolved.