Add Image Annotation

How to add Image Annotation in C#

Image annotation feature allows to add image within document page like shown at the picture below.

There is an ability to specify the next properties for ImageAnnotation type:

  • ImagePath – defines image local or remote path.
  • Box – defines annotation position at document page using Rectangle structure; (image will be resized for your custom width and height)
  • Opacity – allows to set annotation opacity (present in all supported formats, examples of it you can see above);
  • Angle – defines annotation rotation angle.

Follow these steps to add Highlight annotation to document:

  • Instantiate Annotator object with input document path or stream;
  • Instantiate ImageAnnotation object with desired properties (position, page number, etc);
  • Call Add method and pass ImageAnnotation object;
  • Call Save method with resultant document path or stream.

The following code demonstrates how to add ImageAnnotation to the document:

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples: