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

Free Support Forum - aspose.com

Date Field in header changes format when convert into pdf

Hi,
I have a word document which has a date field in header in Dutch language like 28 oktober 2021. When convert to pdf using following code, the language changes to English again like 28 October 2021

Aspose.Words version is 21.10.0.0

Code is below.
using (FileStream CompressedFileStream = new FileStream(tempfile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
{
Document.Save(CompressedFileStream,Aspose.Words.SaveFormat.Pdf);
CompressedFileStream.Seek(0, System.IO.SeekOrigin.Begin);
OutputFileBytes = new byte[CompressedFileStream.Length];
CompressedFileStream.Read(OutputFileBytes, 0, (int)CompressedFileStream.Length);
}

The document is attached here.
Voortijdige beëindigingsbrief X Ordernummer 01 test.docx (116.0 KB)

@Wahaj_KhanWahaj_Khan

Please use FieldOptions.FieldUpdateCultureSource property as shown below to get the desired output.

Document doc = new Document(MyDir + @"Voortijdige beëindigingsbrief X Ordernummer 01 test.docx");
doc.FieldOptions.FieldUpdateCultureSource = FieldUpdateCultureSource.FieldCode;
doc.Save(MyDir + "21.10.pdf");

@tahir.manzoor
Thanks for prompt reply. Your solution worked perfectly fine.

I have another issue with same document when converted to pdf there is an issue on footer content like image below.
image.png (4.7 KB)

Can you please suggest any solution or if you have reported issue like this than give me reference.

Thanks

@Wahaj_Khan

We have tested the scenario and managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-22910. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks @tahir.manzoor much appreciated.