Aspose PDF remove/flattens fields when saving

Hi,

I have a problem with some PDF’s where simply Opening and Saving will flatten fields when saving. A sample document can be downloaded from here: https://www.revenue.nsw.gov.au/help-centre/resources-library/forms/duty/oda076i.pdf

I have uploaded the document as well for your convenience here
oda076i.pdf (704.6 KB)

As you can see, the document has fields

image.png (10.8 KB)

If I simply load the document and Save using the following code, the fields are flattened

using (Aspose.Pdf.Document aspPdfDocument = new Aspose.Pdf.Document(FullPath))
    aspPdfDocument.Save(@"c:\Temp\5.pdf");

The saved PDF has been flattened

image.png (10.9 KB)

I have attached the result as well

5.pdf (702.0 KB)

Why is this happening?

@GaryO
The output document you attached (5.pdf) contains input fields in the places you specified. I can enter data there and Acrobat also shows its presence.
1.png (110.7 KB)

Hi Sergei,

Can you check with Acrobat Reader, I dont have access to Pro

image.png (87.1 KB)

Just for reference

image.png (87.1 KB)

@GaryO
Are you able to set values in the source document (oda076i.pdf)?

Yes see in original post. The fields are clearly marked as blue and I can edit. Just opening and saving in Aspose changes it.

image.png (10.8 KB)

This is not all PDF’s just like the one supplied (and others from the site). Other PDF’s with fields seem OK. When I open the Document in Power PDF I get this:

image.png (5.9 KB)

I expect that saving the PDF is somehow stopping the Reader from using the extended features. Can you replicate on Reader? This is very frustrating as there is not change being done on the document, just opening and saving with Aspose and Reader will no longer allow the fields to be filled

I have also noticed the original document shows this in Reader:

image.png (5.0 KB)

The saved document does not have that icon

image.png (7.9 KB)

So something is definitely breaking when saving using Aspose

I discovered that when opened in Acrobat in my environment, the input fields are not highlighted. When opening the same files (oda076i.pdf and 5.pdf) in Google Chrome, the fields are highlighted and I can enter in them for both documents.
Are you able to enter data into the fields of document 5.pdf if you open it in Google Chrome?

Hi Sergei,

I cannot just say to clients stop using the defacto Adobe Reader client developed by Adobe for the purpose of opening documents using Adobe products. The resolution must be focused for Acrobat Reader. Please check in Acrobat Reader, i have given a lot of information in these posts. The concern to be focused on is why after opening and saving the field functionality are lost.

I have added a video of the issue from my laptop (earlier screen shots were from a totally different system), first opening the original document, hovering over the fields, entering data, and opening the Document Extensions.

The second document is then opened, 5.pdf (again only thing different is that it was opened and resaved in Aspose). as you can see hovering over where the fields should be does nothing. trying to select a feild does nothing and the Document Extension tab is missing.

Please note that the video was recorded using Snipping tool and it doesn’t caputre the “blue” fields in the original document that are missing in the second. But you can see in the original the field border appears when hovering.

https://inmailx-my.sharepoint.com/:f:/g/personal/garyo_inmailx_onmicrosoft_com/EoobtVQXx_9JmaNE0joCU04BHlVBZvRL9urJrA3vJj9zUg?e=Jujf6g

If Aspose PDF cannot support these Enhanced Features, I need a way to detect this is the case and skip handling the documents as customers will not accept that the issue is not due to changes we want to make and simply opening and closing the document breaks it.

@GaryO
Thanks for providing additional information. I was not going to encourage you to work with chrome and abandon acrobat. The question about chrome was asked to clarify the situation.
In my main environment, Adobe Acrobat Pro 2023. By opening the attached 5.pdf file in it, I can edit the data of text fields. I also tried Adobe Acrobat Pro XI and field editing is also available there.
I will continue to work on this problem and perhaps I will have more questions (even if they may seem unreasonable to you).
Thanks.

@GaryO
Based on my research, I discovered the following:
The specified fields of the resulting document can be edited without problems in Adobe Acrobat Pro in different versions. There are problems with editing fields for Adobe Acrobat Reader DC 2019 and Acrobat Reader 2023.008 (the one you have). That is, for the Acrobat versions that not Pro. Moreover, when you open the resulting document (5.pdf) using Acrobat Reader 2023.008, the message you previously provided is displayed.

For a source document opened with Acrobat Reader 2023.008

At first it also threw me out of the acrobat with an error when I clicked on any of the text fields. After about 10 attempts, it started to work fine, and allows them to edit and save the document.
In a saved document, when you open it again, you can also edit and save, the fields do not disappear.

Do you have this effect?

When you open the resulting document (5.pdf) using Google Chrome, you can change the fields. If you save, then through Acrobat you can see the already changed values, but you can’t change them in Acrobat either.

I have stated everything this way, do you have any amendments or additions?

Hi Sergei, I am having no issues with the original document in Acrobat Reader, I can open it, edit it and save it no problem.

I’ve discovered that the document restrictions have changed after using Aspose. The original restrictions are

image.png (6.5 KB)

The new restrictions are

image.png (8.0 KB)

This seems to be the cause of it all. So why does opening and saving the document change the Restrictions in this case?

@GaryO
Thanks for the tip, I think it will be very helpful to the development team. This did not work for me (I tried it with versions 24.02 and 23.11), but then I asked to look the resulting document in Acrobat not Pro and in it, as you writed, editing is not available.
I will create a task for the development team regarding this issue.
Thanks.

@GaryO
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56577

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.