PDF Flatten does not print correctly with GhostScript

I have merged data into a PDF with form fields. This works well. I then flatten the document using document.flatten (I have also tried optimise, optimiseResources, flatten annotations, flatten fields.

When I print the flattened (through Aspose) document via Adobe Reader, it says Flattening document and then prints correctly.
When I print the document via GhostScript to the same printer, it misses out any fields that do not have values in them.

My work around at the moment is to save the document in XPS format. I then run ghost script XPS convert to convert to PDF and print - this works correctly.

Thanks
Baz Templer

@jtempler

Could you please share sample source file along with the output files generated with both Adobe Reader and GhostScript. We will further investigate the issue and share our feedback with you. Also, please share the sample code snippet as well that you are using to fill the form fields.

Hi Asad,

I have attached the source PDF – SourceEditableAdobePDF.pdf.

I have attached the flattened output from my code – Flattened.pdf.

I have attached a screen shot of what happens when printing from Adobe Acrobat.

I have attached the script that I use to Ghostprint the file to a printer. (gs1.cmd)

I have attached a photo of what comes out of the printer (pdf.jpg).

You will need to install Ghostscript, and then the code snippet is simply a called in a console .NET 5 app.

The code creates a flattened pdf with values merged. I then use Ghost print to print the flattened pdf.

My workaround at the moment is to save the document as an XPS – then convert from the XPS to PDF using Ghost script XPS. The PDF produced from this prints correctly. But the process is slower and includes an extra step to save to XPS which I’d rather avoid.

Regards

John Templer

AsposeSupport.zip (3.9 MB)

@jtempler

We have logged an investigation ticket as PDFNET-49660 in our issue tracking system. We will further look into details of this case and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.