Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created October 14, 2019 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/cd9d29b6c868026d35c24c9336a3a695 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/cd9d29b6c868026d35c24c9336a3a695 to your computer and use it in GitHub Desktop.
// 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