PDF/A Document with invalid Sign Fields because of "Update after sign" that did not happen

Hello,
after merging already converted PDF 1/A files into a single one and after adding SignatureFields, Adobe marks the signature fields as INVALID with the message:

document was updated after signing or has been damaged.

I tried converting it again to PDF 1/A after the merge but the result does not change.

We are currently using

  • Aspose Version: Aspose PDF 24.8
  • Java Version: eclipse-temurin:17.0.13_11-jdk-alpine

The current code merge the files like this

String outputFilePath = directory + File.separator + outputFinalFileName;
File mergedFile = new File(outputFilePath);

Document pdfFinalDocument = new Document();
OutputStream outputStream = new FileOutputStream(mergedFile);

for (File file : fileList) {
    try (Document tempDoc = new Document(file.getAbsolutePath())) {
        pdfFinalDocument.getPages().add(tempDoc.getPages());
    }
}

pdfFinalDocument.save(outputStream);
outputStream.flush();
pdfFinalDocument.close();
outputStream.close();

@mlorenzoni

Any change to a signed document will revoke the signatures as per PDF specifications. You can remove the signature first and after merging the file, add signatures again. Please let us know if you still face any issues. Also, please try to use 24.10 version of the API.

Hello,
the SignatureFields were already added to the file after the merge.
I tried to update the aspose version to 24.10 but the result is the same and the problem remains.

Before merging the PDFs with Aspose, we used to do that with iText version 2.17 (which is full of vulnerabilities and is not mantained anymore). With the use of this library there were no issues with the merged PDF and the Signature Fields using the same process:

  1. Generate various pdf files and convert them to PDF 1/A
  2. Merge the files
  3. Add the signature fields

We even tried to convert the file again in PDF 1/A after adding the signature fields but the problem is still present

@mlorenzoni

Can you please share the sample files for our reference so that we can test the scenario in our environment and address it accordingly.

Hello,
sorry for the delay.
Attached to this message there is a sample PDF File with an INVALID Sign Field

Invalid_Signed_Document.pdf (125,4 KB)

@mlorenzoni

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): PDFJAVA-44516

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.