Created
August 6, 2019 19:22
-
-
Save GroupDocsGists/705c29f24cf3c7a5efffe88768bde0a0 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()); | |
InputStream inputStream = new FileInputStream("E:\sample.pdf"); | |
List<AnnotationInfo> annotations = new ArrayList<AnnotationInfo>(); | |
// Ellipse annotation | |
AnnotationInfo ellipseAnnotation = new AnnotationInfo(); | |
ellipseAnnotation.setBox(new Rectangle(430f, 272f, 66f, 51f)); | |
ellipseAnnotation.setPageNumber(0); | |
ellipseAnnotation.setType(AnnotationType.Ellipse); | |
ellipseAnnotation.setCreatorName("Anonym A."); | |
annotations.add(ellipseAnnotation); | |
// Add annotation to the document | |
InputStream result = annotator.exportAnnotationsToDocument(inputStream, annotations, DocumentType.Pdf); | |
// Save result stream to file. | |
OutputStream fileStream = new FileOutputStream("E:\annotated-ellipsed.pdf"); | |
IOUtils.copy(result, fileStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment