PDF form in Acrobat Reader is readonly after saving with Aspose PDF

Hi there,

We’re encountering an issue with the Aspose.PDF library when handling a PDF file that contains an XFA form.

Our application follows this process:

  1. Load the original PDF file.
  2. Populate the form fields.
  3. Save the updated file as a copy to disk.

After saving the file using Aspose.PDF, the resulting PDF becomes read-only when opened in Adobe Acrobat Reader (non-Pro version). The form fields are no longer editable, and digital signatures cannot be applied. However, when opening the same saved PDF in other applications (like Chrome’s built-in viewer), the form appears to work correctly.

This is a blocker for us because we require the file to remain fully functional in Adobe Acrobat Reader, especially for form signing.

To isolate the issue, we created a minimal test application that:

  • Simply opens the original PDF.
  • Saves it to a new file without modifying anything.

Even this basic operation is enough to reproduce the problem.

AsposePDFIssue.zip (78.3 KB)

The original PDF form can be downloaded from this official Canadian government website:
LAB1070 Form – Service Canada

Please let us know if you need additional details, code samples, or the files we’re using.

Thanks,
Yoann

@Yoann_ICO

Cause

The issue you’re experiencing with the PDF form becoming read-only in Adobe Acrobat Reader after saving with Aspose.PDF is likely related to how the library handles XFA forms. When saving, certain properties or settings may not be preserved, leading to the form fields being non-editable in Acrobat Reader.

Solution

To resolve this, you can try the following steps:

  1. Ensure Compatibility: Make sure you are using the latest version of Aspose.PDF, as updates often include fixes for issues related to PDF forms.

  2. Set Form Field Properties: After populating the form fields, explicitly set the properties of the form fields to ensure they remain editable. You can do this by iterating through the fields and setting the ReadOnly property to false.

  3. Save Options: When saving the PDF, use the appropriate save options that maintain the form’s functionality. For example, ensure that you are not inadvertently flattening the form fields.

Code

Here’s a sample code snippet to illustrate how to set the form field properties:

using Aspose.Pdf;
using Aspose.Pdf.Facades;

// Load the original PDF
Document pdfDocument = new Document("original.pdf");

// Populate the form fields
foreach (Field field in pdfDocument.Form.Fields)
{
    field.Value = "Your Value"; // Set your value here
    field.ReadOnly = false; // Ensure the field is editable
}

// Save the updated PDF
pdfDocument.Save("updated.pdf");

Next Steps

  1. Test the updated code to see if the form fields remain editable in Adobe Acrobat Reader.
  2. If the issue persists, check the Aspose.PDF documentation for any specific notes on handling XFA forms.
  3. If necessary, reach out to Aspose support with your specific PDF file for further assistance.

Please implement these steps and let me know if you need any further help!

Hi there,

As mentioned, simply opening the file and saving it again is enough to reproduce the issue.
The original file is included in the ZIP archive and also available at the link provided earlier.

Thank you!

@Yoann_ICO

We are trying to download the sample PDF document from the link you shared but we could not find it. Should we save the page as PDF in Chrome? Would you please guide us as we may not be looking into right direction to obtain the sample document.

Hi @asad.ali ,

The sample PDF file is included in the project I shared. You can find it in the zip archive under the name ESDC-LAB1070.pdf.

Alternatively, you can access the PDF directly via this link:
https://catalogue.servicecanada.gc.ca/content/EForms/en/CallForm.html?Lang=en&PDF=ESDC-LAB1070.pdf

I hope this helps!

@Yoann_ICO

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-60339

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.

Hello @asad.ali ,

Is there any way to have information about ticket PDFNET-60339? Can I have an estimated time for its resolution? Is there any workaround I can do to avoid this to happen in the meantime?

I saw a similar case on your side, from last year, but I don’t know if there is any progress on it: Aspose PDF remove/flattens fields when saving

Thank you!

@Yoann_ICO

The ticket has just been logged in our issue management system and we will prioritize it on a first-come, first-served basis. The status of the ticket can be seen at the bottom of this forum thread.

We have taken your concerns into our account and will surely try to analyze if some workaround can be provided. Once we have some updates, we will inform you in this very forum thread. Please spare us some time.

Regarding your other ticket, we request you please follow up in the respective forum thread so that latest updates can be received about its resolution or ETA.

We are sorry for the inconvenience.