Sign and verify documents with GroupDocs.Signature
Leave feedback
On this page
GroupDocs.Signature applies electronic signatures to a document and finds them again afterwards. It supports text, image, digital certificate, barcode, QR-code, stamp, metadata and form-field signature types across PDF, Word, Excel, PowerPoint and image formats.
The three examples below cover the full lifecycle: sign, verify, search.
Sign a document with a text signature
A text signature draws text onto the page at a position you choose. Left/Top place it, Width/Height bound it.
A QR-code signature encodes arbitrary text — an approval id, a verification URL — into a scannable code placed on the page.
usingGroupDocs.Signature;usingGroupDocs.Signature.Domain;usingGroupDocs.Signature.Options;using(Signaturesignature=newSignature("contract.pdf")){QrCodeSignOptionssignOptions=newQrCodeSignOptions("Approved by John Smith"){EncodeType=QrCodeTypes.QR,Left=100,Top=100,Width=120,Height=120};signature.Sign("signature-sign-with-qr-code.pdf",signOptions);}
contract.pdf is the sample file used in this example. Click here to download it.
Searching answers “what is on this document?”. It returns every signature of the type you ask for, with its page and position.
usingSystem;usingSystem.Collections.Generic;usingGroupDocs.Signature;usingGroupDocs.Signature.Domain;usingGroupDocs.Signature.Options;// Sign first, so there is something to findusing(Signaturesignature=newSignature("contract.pdf")){QrCodeSignOptionssignOptions=newQrCodeSignOptions("Approved by John Smith"){Left=100,Top=100};signature.Sign("signature-search.pdf",signOptions);}using(Signaturesignature=newSignature("signature-search.pdf")){QrCodeSearchOptionssearchOptions=newQrCodeSearchOptions();List<QrCodeSignature>signatures=signature.Search<QrCodeSignature>(searchOptions);Console.WriteLine("Signatures found: "+signatures.Count);foreach(QrCodeSignatureqrSignatureinsignatures){Console.WriteLine("Type: "+qrSignature.EncodeType.TypeName+", text: "+qrSignature.Text+", page: "+qrSignature.PageNumber);}}
contract.pdf is the sample file used in this example. Click here to download it.
GroupDocs.Signature also applies digital certificate signatures, image and stamp signatures, metadata and form-field signatures; verifies a document against expected signature values; and updates or deletes signatures already present.