Problem with converting .docx with qr codes to .pdf

Hi.
I have docx file with qr code inserted via DISPLAYBARCODE word command:

{ DISPLAYBARCODE "{PAGE}" QR \q 1 } (it shows qr code with page number on every page).

In word it works perfect. I can export this file in MS Word to pdf and qr codes works as expected (a different page number in each qr code on page).

If i try to export using aspose:

Document doc = new Document(“c:\11\test_template_empty__qr.docx”);
doc.FieldOptions.BarcodeGenerator = new CustomBarcodeGenerator();
doc.UpdatePageLayout();
doc.Save(“c:\11\result.pdf”, SaveFormat.Pdf);

then all qr codes in output file contains same page number - 1. (Tested on versions 16.3, 18.0,19.4).

Method in CustomBarcodeGenerator (GetBarcodeImage) recieves same page number in parameters.BarcodeValue.

Please find the following documents attached
test_template_empty__qr.docx - document with qr codes.
test_template_empty__qr.pdf - pdf created by ms word export.
result.pdf - pdf created by aspose with wrong qr codes.
attachment.zip (66.6 KB)

@RENIT

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

We apologize for your inconvenience.

@RENIT

The issue ID for your issue is WORDSNET-18421.

In your case, we suggest you following solution. Hope this helps you.

  1. Convert the Word document to PDF using Aspose.Words.
  2. Generate the barcode image for each page using Aspose.BarCode.
  3. Insert the barcode image at your desired location of PDF using Aspose.PDF.

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