Last active
November 29, 2019 10:44
-
-
Save GroupDocsGists/5d1b0f63bcf950e2d553c50c2a853fdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-Java | |
AnnotationImageHandler annotator = new AnnotationImageHandler(Utilities.getConfiguration()); | |
annotator.getDocumentDataHandler(); | |
InputStream cleanPdf = new FileInputStream("E:\Documents\input.pdf"); | |
List<AnnotationInfo> annotations = new ArrayList<AnnotationInfo>(); | |
// Point annotation | |
AnnotationInfo pointAnnotation = new AnnotationInfo(); | |
pointAnnotation.setBox(new Rectangle(212f, 81f, 35f, 0.0f)); | |
pointAnnotation.setPageNumber(0); | |
pointAnnotation.setType(AnnotationType.Point); | |
pointAnnotation.setCreatorName("Anonym A."); | |
annotations.add(pointAnnotation); | |
// Add annotation to the document | |
InputStream result = annotator.exportAnnotationsToDocument(cleanPdf, annotations, DocumentType.Pdf); | |
// Save result stream to file. | |
OutputStream fileStream = new FileOutputStream("E:\Documents\result.pdf"); | |
IOUtils.copy(result, fileStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment