We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Sign PDF using Aspose.PDF for .NET - No signature information found in output PDF

Hi Aspose team,

We are using v20.3 lib. I signed an encrypted PDF, but there are no any signature information in the generated PDF, and then I attempted to view the generated PDF using Adobe Acrobat Std 2017. Acrobat states “At least one signature is invalid”.
BTW, I didn’t see any exceptions occured in the code while signing, it means that signing the PDF should be successful.

I prepared the code sample, the test pdf and the certificate. Please have a look . Thanks.

@Glority_Developer

We were able to notice the issue in our environment with Aspose.PDF for .NET 20.4 and have logged it as PDFNET-48061 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi Aspose team,

How is the progress? Will this issue be fixed within 1-2 months? We are going to have the code freeze date of our product.

@Glority_Developer

We regret to inform you that earlier logged ticket is not yet resolved due to other issues in the queue which were logged prior. We will certainly let you know once we have additional updates regarding issue fix. We highly appreciate your patience and comprehension in this regard.

We apologize for your inconvenience.

@Glority_Developer

We have investigated the earlier logged ticket. For unknown reasons, Adobe considers PKCS7 signature invalid. Now we can recommend using PKCS7Detached. It works correctly with encryption.

var doc = new Document(dataDir + @"encrypt_123456.pdf", "123456");
var pkcs2 = new PKCS7Detached(dataDir + @"trent.pfx", "123456789");

var rect2 = new System.Drawing.Rectangle(0, 0, Convert.ToInt32(doc.Pages[1].PageInfo.Width), 100);
var signDoc = new Facades.PdfFileSignature(doc);
signDoc.Sign(1, "WinZip Reason", string.Empty, "WinZip Location", true, rect2, pkcs2);
signDoc.Save(dataDir + @"new_encryptedFile.pdf"); 

Please use the suggested code snippet with Aspose.PDF for .NET 21.9 and let us know in case you face any issues.