Add arrow annotation

On this page

Arrow annotation draws an arrow on the document page and annotate it as shown in the picture below. 

You can set the following properties of the ArrowAnnotation class:

  • Box defines annotation position at document page
  • Opacity allows you to set the annotation opacity
  • PenColor defines the arrow color
  • PenStyle defines annotation line style (solid, dash, dot etc.)
  • PenWidth defines the arrow line width in pixels

To add an arrow annotation to document, follow these steps:  

  1. Instantiate the Annotator class. Specify the input document path or stream.
  2. Instantiate the ArrowAnnotation class. Set the appropriate properties (position, page number, etc).
  3. Call the Add method. Specify the ArrowAnnotation class.
  4. Call the Save method. Specify the output document path or stream.

The following code snippet shows how to add ArrowAnnotation to the document:

using (Annotator annotator = new Annotator("input.pdf"))
{
	ArrowAnnotation arrow = new ArrowAnnotation
    {
        Box = new Rectangle(100, 100, 100, 100),
        CreatedOn = DateTime.Now,
        Message = "This is arrow annotation",
        Opacity = 0.7,
        PageNumber = 0,
        PenColor = 65535,
        PenStyle = PenStyle.Dot,
        PenWidth = 3,
        Replies = new List<Reply>
        {
        	new Reply
            {
            	Comment = "First comment",
                RepliedOn = DateTime.Now
            },
            new Reply
            {
             	Comment = "Second comment",
                RepliedOn = DateTime.Now
            }
        }
    };
    annotator.Add(arrow);
    annotator.Save("result.pdf");
}

On this page