To load a password protected file, follow these steps:
Instantiate the LoadOptions class. Specify the source document password as a parameter.
Instantiate the Annotator class. Specify the document path or stream and the the LoadOptions object.
The following code snippet shows how to load a password protected file:
// This example demonstrates annotating documents that are protected with a password.
// Create an instance of LoadOptions class and set password
LoadOptionsloadOptions=newLoadOptions();loadOptions.setPassword("1234");// Create an instance of Annotator class
Annotatorannotator=newAnnotator("inputPath",loadOptions);try{// Create an instance of AreaAnnotation class and set options
AreaAnnotationarea=newAreaAnnotation();area.setBox(newRectangle(100,100,100,100));area.setBackgroundColor(65535);// Add annotation and save to file
annotator.add(area);annotator.save("outputPath");}finally{if(annotator!=null){annotator.dispose();}}
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.