Saving a PDF changes the form field barcode from a datamatrix type to 128

Dear Aspose Team

If I load and save the attached ExampleWithBarcode.pdf with Aspose.PDF the type of the barcode changes from a datamatrix to a 128 barcode. This unfortunately happens even if the content of the pdf was not changed at all. Below you find a simple Code Example in C#.

var document = new Document(“ExampleWithBarcode.pdf”);
document.Save(“OutputWith128Barcode.pdf”);

Is there any way to prevent this behaviour? Any help is appreciated a lot.

Lots of greetings,
Kristof

@KristofK

Would you kindly share the output PDF document generated on your side. Also, please share how you are checking if datamatrix is changed to 128 barcode. We will further proceed to assist you accordingly.

@asad.ali

Thanks for the quick reply. Unfortunately I realised that I minimised my minimum working example a bit too much. The type of the barcode only changes if any change is performed. E.g. if the pdf is flattened or if the value of another (non-barcode) field is changed.

Flatten the pdf

Minimum working example:

var document = new Document(“ExampleWithBarcode.pdf”);
document.Flatten();
document.Save(“Output_Flattened.pdf”);

Output: Output_Flattened.pdf (505.5 KB)

Fill out other form field

Minimum working example:

var document = new Document(“ExampleWithBarcode.pdf”);
document.Form.Fields.First(t => t.PartialName == “LOT”).Value = “NewLotValue”;
document.Save(“Output_FillOutOtherFormField.pdf”);

Output: Output_FillOutOtherFormField.pdf (505.1 KB)

The barcode visually changed if I open one of the two new pdfs with Adobe Acrobat Reader DC to a 128 barcode.

@KristofK

We were able to replicate the issue in our environment with Aspose.PDF for .NET 20.3 and logged it as PDFNET-47920 in our issue tracking system for the sake of correction. We will further look into details of it and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.