# How to save document with password This article explains how to save document with password protection. [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class supports saving signed document with password protection. This ability is supported over [Password](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/saveoptions/password) property of [SaveOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/saveoptions) class that should be passed to [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method. Here are the steps to protect signed document with password with [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net): * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path or stream as a constructor parameter. * Instantiate required signature options. * Instantiate the [SaveOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/saveoptions) object and specify [Password](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/saveoptions/password) property with required password string. * Call [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass signatureoptions and [SaveOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/saveoptions) object to it. Following example demonstrates how to save signed document with password. ```csharp using (Signature signature = new Signature("sample.pdf")) { // create QRCode option with predefined QRCode text QrCodeSignOptions signOptions = new QrCodeSignOptions("JohnSmith") { // setup QRCode encoding type EncodeType = QrCodeTypes.QR, // set signature position Left = 100, Top = 100 }; SaveOptions saveOptions = new SaveOptions() { Password = "1234567890", UseOriginalPassword = 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: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**.