GroupDocs.Signature allows signing a document with several signatures simultaneously and even apply signatures of different types to the same document.
Doing this is as simple as:
Create a new instance ofΒ the SignatureΒ class and pass the source document path or stream as a constructor parameter.
Instantiate all required sign optionsΒ objects depending on signature type:
FillΒ the collection withΒ sign options from the previous step.
CallΒ the SignΒ method ofΒ the SignatureΒ class instance and pass the collection of sign optionsΒ to it.
This code snippet below demonstrates how to eSign a PDF document with multiple signatures at the same time.
using(Signaturesignature=newSignature("sample.pdf")){// define several signature options of different types and settingsTextSignOptionstextOptions=newTextSignOptions("This is test message"){VerticalAlignment=VerticalAlignment.Top,HorizontalAlignment=HorizontalAlignment.Left};BarcodeSignOptionsbarcodeOptions=newBarcodeSignOptions("123456"){EncodeType=BarcodeTypes.Code128,Left=100,Top=100};QrCodeSignOptionsqrcodeOptions=newQrCodeSignOptions("JohnSmith"){EncodeType=QrCodeTypes.QR,Left=100,Top=200};DigitalSignOptionsdigitalOptions=newDigitalSignOptions("certificate.pfx"){ImageFilePath=Constants.ImageHandwrite,VerticalAlignment=VerticalAlignment.Center,HorizontalAlignment=HorizontalAlignment.Center,Password="1234567890"};// define list of signature optionsList<SignOptions>listOptions=newList<SignOptions>();listOptions.Add(textOptions);listOptions.Add(barcodeOptions);listOptions.Add(qrcodeOptions);listOptions.Add(digitalOptions);// sign document to filesignature.Sign("signed.pdf",listOptions);}
Advanced Usage Topics
To learn more about document eSign features, please refer to theΒ advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourΒ GitHub examples: