Load document from FTP

Following example demonstrates how to annotate document from FTP.

import org.apache.commons.net.ftp.FTPClient;

public static void main() {
    String outputPath = "LoadDocumentFromFtp.pdf";
    String filePath = "sample.pdf";
    String server = "localhost";
	Annotator annotator = new Annotator(getFileFromFtp(server, filePath));
	AreaAnnotation area = new AreaAnnotation();
    area.setBox(new Rectangle(100, 100, 100, 100));


private static InputStream getFileFromFtp(String server, String filePath) throws IOException {
    FTPClient client = new FTPClient();
    InputStream inputStream = client.retrieveFileStream(filePath);
    return inputStream;

More resources

Advanced Usage Topics

To learn more about document annotating features, please refer to the advanced usage section.

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 Java 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.