Invalid Signature data after merging a PDF using Aspose PDF for Java

We use Aspose PDF for Java v.19.6 to merge several documents in one PDF file. Looks like the generated PDF will contain invalid signature data and is rejected by Adobe sign service due to invalid information.

I noticed this happens when one of the PDF files to be merged contains a signature. I create an example that will create a new PDF file and include the PDF that contains a signature. The generated file will contain invalid signature data.

sample.zip (89.5 KB)
adobe-signature-error.png (8.3 KB)

@tayes,

Thanks for sharing further details.

We have logged an investigation ticket as PDFJAVA-39291 in our issue tracking system. We will further look into details of it and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

@Adnan.Ahmad
Hi, Is there any news about this issue? It would be great if you can share any progress or estimation on this.

Thanks

@tayes

We regret to inform you that the earlier logged ticket is not yet resolved due to other issues in the queue logged prior to it. However, we have recorded your concerns and will surely consider them during investigation. We will inform you as soon as we have some definite update regarding ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

@tayes

We have investigated the earlier logged ticket. If the document is changed, then the signature will be damaged in any case.

The signature is on one of the pages, so it was copied too.
We recommend deleting it.
Code samples:

//Variant 1 (simpler)
Document pdf = new Document(dataDir + "pdf-with-signature.pdf");
pdf.Flatten();
Document pdfDocument = new Document();
pdfDocument.Pages.Add(pdf.Pages);
pdfDocument.Save(dataDir + "test.pdf");

//Variant 2 (safer if you do not want to remove other annotations)
Document pdf = new Document(dataDir + "pdf-with-signature.pdf");
using (var pdfFileSignature = new PdfFileSignature(pdf))
{
    foreach (var sigName in pdfFileSignature.GetSignNames())
    {
        pdfFileSignature.RemoveSignature(sigName);
    }
    Document pdfDocument = new Document();
    pdfDocument.Pages.Add(pdf.Pages);
    pdfDocument.Save(dataDir + "test.pdf");
}