Free Support Forum - aspose.com

Arabic/Persian numbers are converted to "English" number when conversting .docm to PDF

Hi,

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.

Thank you,

Hi Jawad,

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.

Thanks for your response.

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:
wordDocument.Save(pdfFileName, new Aspose.Words.Saving.PdfSaveOptions
{
NumeralFormat = NumeralFormat.ArabicIndic,
BookmarksOutlineLevel = 9,
PageCount = wordDocument.PageCount,
});

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)?

Hi Jawad,


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.

We apologize for your inconvenience.

Thank you.

However, we still need a work around for the version 11.7.0.

Any thoughts?

Hi Jawad,

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:

Document doc = new Document(MyDir + "ArabNumberReport.docm");

PdfSaveOptions option = new PdfSaveOptions();

option.NumeralFormat = NumeralFormat.ArabicIndic;

option.BookmarksOutlineLevel = 9;

option.PageIndex = 0;

option.PageCount = 1;

doc.Save(MyDir + "AsposeOut.pdf", option);


Thanks,

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.

Regards,

Hi Jawad,


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.

We appreciate your patience.

The issues you have found earlier (filed as WORDSNET-7182) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.