Signature class supports saving signed document with password protection. This ability is supported over setPassword property of SaveOptions class that should be passed to sign method.
Here are the steps to protect signed document with password with GroupDocs.Signature:
Create new instance of Signature class and pass source document path or stream as a constructor parameter.
Instantiate required signature options.
Instantiate the SaveOptions object and specify setPassword property with required password string.
Call sign method of Signature class instance and pass signatureoptions and SaveOptions object to it.
Following example demonstrates how to save signed document with password.
Signaturesignature=newSignature("sample.pdf");// create QRCode option with predefined QRCode text
QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);SaveOptionssaveOptions=newSaveOptions();saveOptions.setPassword("1234567890");saveOptions.setUseOriginalPassword(false);// sign document to file
signature.sign("SignedProtected.pdf",signOptions,saveOptions);
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.