Add squiggly annotation

On this page

Squiggly annotation marks text with a squiggly styling as shown in the picture below:

You can specify the following properties of the SquigglyAnnotation class:

  • FontColor defines the color of the annotation text
  • Opacity allows you to set the annotation opacity
  • Points defines the annotation positions as array of points
  • BackgroundColor defines the area background color
  • SquigglyColor defines the annotation line color

To add a squiggly annotation, follow these steps:

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

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

//Add squiggly annotation to the document from local disk
using (Annotator annotator = new Annotator("input.pdf"))
{
	SquigglyAnnotation squiggly = new SquigglyAnnotation
    {
    	CreatedOn = DateTime.Now,
        FontColor = 65535,
        BackgroundColor = 16761035,
        Message = "This is squiggly annotation",
        Opacity = 0.7,
        PageNumber = 0,
        SquigglyColor = 1422623, //Supported only Word and PDF
        Points = new List<Point>
        {
        	new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650)
        },
        Replies = new List<Reply>
        {
        	new Reply
            {
            	Comment = "First comment",
                RepliedOn = DateTime.Now
            },
            new Reply
            {
            	Comment = "Second comment",
                RepliedOn = DateTime.Now
            }
        }
    };
    annotator.Add(squiggly);
    annotator.Save("result.pdf");
}

On this page