Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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
You can’t perform that action at this time.