aspose-pdf / Aspose.PDF-for-.NET-Old

This repository is no more maintained and all latest code samples are maintained here:
https://github.com/aspose-pdf/Aspose.PDF-for-.NET
MIT License
81 stars 54 forks source link

add Multiple Signatures on a Single PDF #16

Closed bluetianx closed 6 years ago

bluetianx commented 6 years ago

I want to add multiple signatures on a single Pdf. My code as follows `System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 100, 100);

        PKCS1 signature = new PKCS1(@"eamsT.sinopec.com.pfx", "20180201");
        PdfFileSignature pdfSign = new PdfFileSignature(new Document(@"input.pdf"));
        pdfSign.SignatureAppearance = "test.png";
        pdfSign.Sign(1, "Signature Reason", "Contact", "Location", true, rect, signature);
        pdfSign.Save(@"output.pdf");
        pdfSign.Close();
        rect = new System.Drawing.Rectangle(260, 260, 100, 100);

        PKCS1 signature2 = new PKCS1(@"eamsT.sinopec.com.pfx", "20180201");
        pdfSign = new PdfFileSignature(new Document(@"output.pdf"));
        pdfSign.SignatureAppearance = "test.png";
        pdfSign.Sign(1, " Reason2", "Contact", "Location", true, rect, signature2);
        pdfSign.Save(@"output.pdf");
        pdfSign.Close();`

There is a problem that my reader (Adobe Acrobat Reader DC)tells me that Signature verification statusThe signature is invalid.The document has been altered or corrupted since the signature was applied.

farhan-raza commented 6 years ago

@bluetianx , Would you please share all the resources including source and generated PDF file, PFX file and a screenshot displaying the problem in Adobe Acrobat DC. So that we may try to reproduce and investigate your scenario exactly, to help you out. Before sharing request data via Google Drive, Dropbox etc, please ensure using Aspose.PDF for .NET 18.8 in your environment.

PS: I work with Aspose as Developer Evangelist.

bluetianx commented 6 years ago

sorroy, i cannot user Google Drive,I upload resouces in my github github, You can run method TestMethod1() of UnitTestConsole project,then you can the output pdf file in AsposePDFTest\TechLab\UnitTestConsole\bin\Debug\netcoreapp2.0.

bluetianx commented 6 years ago

The version of acrobat that I use is 18.011.20058.33888

farhan-raza commented 6 years ago

@bluetianx , Thank you for sharing requested resources. We have logged a ticket with ID PDFNET-45257 in our issue management system for further investigation and resolution. We will update you as soon as some significant updates will be available.

We are sorry for the inconvenience.

bluetianx commented 6 years ago

Alright 。thanks