Load password-protected documents

GroupDocs.Annotation allows to annotate documents that are protected with a password.

The following are the steps to process password-protected documents.

  • Instantiate Annotator object with document path or stream and LoadOptions object that specifies source document password;

The following code sample shows how to work with password-protected documents.

using (Annotator annotator = new Annotator("input.pdf", new LoadOptions() { Password = "1234" }))
{
 	AreaAnnotation area = new AreaAnnotation()
    {
       	Box = new Rectangle(100, 100, 100, 100),
       	BackgroundColor = 65535,
    };
    annotator.Add(area);
    annotator.Save("result.pdf");
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple but powerful free Apps. You are welcome to annotate your PDF, DOC or DOCX, XLS or XLSX, PPT or PPTX, PNG and other documents with free to use online GroupDocs Annotation App.