Created
October 14, 2019 13:20
-
-
Save GroupDocsGists/cd9d29b6c868026d35c24c9336a3a695 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
// Creating annotation list | |
List<AnnotationInfo> annotations = new List<AnnotationInfo>() | |
{ | |
new AnnotationInfo() | |
{ | |
PageNumber = 0, | |
Box = new Rectangle(100, 100, 100, 100), | |
Type = Domain.AnnotationType.Area, | |
Text = "area" | |
}, | |
new AnnotationInfo() | |
{ | |
PageNumber = 0, | |
Box = new Rectangle(200, 200, 80, 80), | |
Type = Domain.AnnotationType.Ellipse, | |
Text = "ellipse" | |
} | |
}; | |
// Create annotation config | |
AnnotationConfig config = new AnnotationConfig(); | |
// Set storage path | |
config.StoragePath = "storage"; | |
// Create annotation handler | |
AnnotationImageHandler annotator = new AnnotationImageHandler(config); | |
// Create input file | |
using (FileStream fs = new FileStream("input.pdf", FileMode.Open)) | |
{ | |
// Export annotations and save result | |
Stream result = annotator.ExportAnnotationsToDocument(fs, annotations); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment