Concatenate - invalid signatures

Hi.

I got a problem.
We are using aspose to merge multiple pdf files, after that I do classic post processing on it via aspose pdf to add metadata, convert it to pdf_A_3U, save it and send to diff part of system where they sign it, but signed pdf I get back from them has invalid signature.

When we tried debug it and find source of our problem, we pin point it to pdf Concatenate, because when we send just solo pdf without Concatenate, it get signed without problem and we have green, but when all 4 are Concatenate we get invalid sign.

We tried even merging just 2 of them via demo here on aspose.com for it and still invalid sign.
1.PDF (132.5 KB)

2.PDF (135.2 KB)

3.PDF (64.0 KB)

4.PDF (109.2 KB)

These 4 pdf files are what we tried to merge just to test and debug what is going on and I have no idea what to do.

I forgot to add that I am using 24.11.0 Aspose PDF Drawing on .net 8 c# project in linux docker.
result329.pdf (489.5 KB)

this is merged pdf that if I send to sign, I get back invalid signature.

@viridye

  • Can you please share the sample code you are using to merge the document?
  • Can you please confirm if signing process is also using Aspose.PDF? If yes, please share the code snippet as well
  • If possible, please also share a PDF with valid signatures that you have been able to achieve without doing merge process

It turns out they are not using aspose to do final sign, but something they are calling blackbox, no idea what is that.

For code I tried everything.

this is last one I tried with because I am at stage where I am trying even stupid things that I could try because I run out of normal ones already
public static void SestavitPDF(List outputFiles, string outputFile)
{
PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.CopyLogicalStructure = true;
pdfEditor.CopyOutlines = true;
pdfEditor.KeepActions = true;
pdfEditor.KeepFieldsUnique = false;
pdfEditor.MergeDuplicateLayers = true;
pdfEditor.MergeDuplicateOutlines = true;
pdfEditor.RemoveSignatures = true;
pdfEditor.PreserveUserRights = false;

try
{
    pdfEditor.Concatenate(outputFiles.ToArray(), outputFile);
}
finally
{
    pdfEditor = null; // Zrušte referenci na editor
    //GC.Collect(); // Spusťte GC pro diagnostiku
}

}

but we tried even basic and failed too
public static void SestavitPDF(List outputFiles, string outputFile)
{
PdfFileEditor pdfEditor = new PdfFileEditor();
try
{
pdfEditor.Concatenate(outputFiles.ToArray(), outputFile);
}
finally
{
pdfEditor = null; // Zrušte referenci na editor
//GC.Collect(); // Spusťte GC pro diagnostiku
}
}

this is one of parts we tried to sign and it was fine
k5b54lfi.lvx.PDF (154.8 KB)

result332 is from 24.12.0
result332.pdf (521.1 KB)

result329 1 is 24.11.0
result329 1.pdf (521.1 KB)

same setting, all have invalid signitarues

I even tried to downgrade aspose pdf to 23.2.0 and same problem. Tried even merging 1 solo pdf and got same result, invalid signatures.
concatenate_24_12_0.pdf (127.4 KB)

concatenate_23_2_0.pdf (127.6 KB)

orig.PDF (123.6 KB)

very interesting thing is that when we tried today invalid signed pdf put into DSS Demonstration WebApp
it said signs are valid, this is co confusing.

@viridye

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

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.

we asked about this problem on adobe community and answer.

This is whole reason why Aspose pdf merging is producing invalid pdf files.

@viridye

Thanks for sharing this information. We will surely take this into our account and investigate from this perspective. We will let you know as soon as we make some progress in this regard. Please be patient and spare us some time.

We are sorry for the inconvenience.

Looking on what adobe wrote there, they said it was fixed in version 17.6, but that was
PDFNET-41272 PDF/A-1 conversion creates invalid XRef table Bug
this is when we are merging pdf files.

@viridye

That can be a document specific issue. All the details related to your scenario have been already logged in the ticket and we will surely investigate in details. Once the issue is analyzed and resolved, we will inform you. Please spare us some time.

Was suprised to see in release notes of version 25.1.0
PDFNET-54956 PDF Signature always returning as invalid Bug
but that was diff bug. We tested that and still problem.

@viridye

As shared earlier, that is a document specific issue which is resolved for that specific document. Please note that PDF documents are complex and every document has its own different and complex structures. Therefore, we will investigate with your documents and resolve the issue accordingly.