![]() ![]() PdfSign(doc, PdfPageCount, signatureMaker, cert, signName, x, y, width, height)ĭoc.SaveToFile("././output/new_result_.pdf") 'Define the width of signature and height of signature, define the coordinate of signatureĭim signName As String = PdfPageCount.ToString If you need it, you can contact our sales team( Select all Sub Main()ĭoc.LoadFromFile("././data/testttt.pdf")ĭim cert As X509Certificate2 = New X509Certificate2("././data/gary.pfx", "e-iceblue")ĭim signatureMaker As PdfOrdinarySignatureMaker = New PdfOrdinarySignatureMaker(doc, cert) ![]() ![]() Meanwhile, we are willing to provide a temporary license (one month free) to help you remove the warning message. Please kindly notice that the Free Spire.Pdf currently don’t support adding multiple digital signature to pdf file, however, our latest commercial version of Spire.PDF support this function, you can download the latest version ( Spire.Pdf 9.2.2) and using the following code to test. Signature.DocumentPermissions = .ForbidChanges Or .AllowFormFill 'Set the document permission to forbid changes but allow form fill Signature.SignDetailsFont = New (New Font("Arial Unicode MS", 7.0F, FontStyle.Regular)) Signature.SignImageSource = .FromFile(SignatureImagePath) 'Set the signature image source "D:\PDFWithDigitalSign2_0\check-mark-2.png" Signature.LocationInfo = LocationInfoValue Signature.LocationInfoLabel = LocationInfoLabel Signature.ContactInfoLabel = ContactInfoLabel Signature.GraphicsMode = .SignImageAndSignDetail 'Set the graphics mode to ImageAndSignDetail 'Load the certificate and Create a PdfSignature object and specify its position and sizeĭim cert As = New (PfxFilePath, PswdForPfxFile)ĭim signature As = New (doc, doc.Pages(PdfPageCount), cert, NameValue)ĭim rectangleF As RectangleF = New RectangleF(22, 40, 160, 44) 'Create a PdfDocument object and 'Load a sample PDF fileĭim doc As = New ()ĭim PdfPageCount As Int16 = Some parameter will get replace by original passed values in this pdf, only the first signature gets a valid signature, and the remaining all others get invalid. I have added a digital signature on each page of the pdf but when I open the pdf file it gives me an error like the attached screenshot.Īlso, I have tried multiple ways but still, I am getting an error as "Signature Invalid, document altered". I have to add same digital signature on multiple pages of the pdf file. I am using the freeSpire.pdf library version (7.8.9). SignatureMaker.MakeSignature("signName_" (i 1), pageBase, 100, 600, 120, 70, appearance) PdfSignatureAppearance appearance = new PdfSignatureAppearance(signatureMaker.Signature) Īppearance.ContactInfoLabel = "ContactInfo:" įor (int i = 0 i < i ) Signature.Reason="protect document data" PdfSignature signature = signatureMaker.Signature PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(document, x509) PdfDocument document = new PdfDocument() ĭocument.LoadFromFile("MutiplePages.pdf") X509Certificate2 x509 = new X509Certificate2("gary.pfx", "e-iceblue") Signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill Signature.Reason = "protect document data " Signature.LocationInfoLabel = "Location:" Signature.ContactInfoLabel = "ContactInfo:" Signature.Bounds = new RectangleF(new PointF(100, 600), new SizeF(120, 70)) signature = new (doc, doc.Pages, digi, "signName_" (i 1)) PdfCertificate digi = new PdfCertificate("gary.pfx", "e-iceblue") įor (int i = 0 i < i ) Our Spire.PDF provides two ways to sign PDF documents. We have sent you a temporary licence for Spire.PDF Pro Edition. Thanks for your interests in our Spire product. ![]()
0 Comments
Leave a Reply. |