The following code snippet shows how to annotate document from FTP:
// This example demonstrates loading document from FTP.
StringfilePath="sample.pdf";Stringserver="localhost";// Create an instance of Annotator class and create connection and return stream with document
Annotatorannotator=newAnnotator(getFileFromFtp(server,filePath));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();}}//...
privatestaticInputStreamgetFileFromFtp(Stringserver,StringfilePath)throwsIOException{FTPClientclient=newFTPClient();client.connect(server);InputStreaminputStream=client.retrieveFileStream(filePath);client.disconnect();returninputStream;}
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.