Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active December 4, 2021 15:39
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/0d25b0bfdc7cfaaa084bbaab8509adf9 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/0d25b0bfdc7cfaaa084bbaab8509adf9 to your computer and use it in GitHub Desktop.
Add Wavy Underline to Text in Word, PDF, PPT and other Documents using C#
/*
* Add wavy underline (Squiggly Annotation) to text in PDF file using C#
*/
using (Annotator annotator = new Annotator("path/document.pdf"))
{
SquigglyAnnotation squiggly = new SquigglyAnnotation
{
FontColor = 0xFF0000,
Opacity = 0.5,
PageNumber = 0,
Points = new List<Point>
{
new Point(20, 100),
new Point(150, 100),
new Point(20, 130),
new Point(150, 130)
}
};
annotator.Add(squiggly);
annotator.Save("path/squiggly-document.pdf");
}
/*
* Add wavy underline (Squiggly Annotation) to text in DOC, DOCX files using C#
*/
using (Annotator annotator = new Annotator("path/document.docx"))
{
SquigglyAnnotation squiggly = new SquigglyAnnotation
{
BackgroundColor = 0xFFF000,
FontColor = 0xFF0000,
Message = "This is Squiggly Annotation",
CreatedOn = DateTime.Now,
Opacity = 0.5,
PageNumber = 0,
Points = new List<Point>
{
new Point(20, 170),
new Point(290, 170),
new Point(20, 200),
new Point(290, 200)
}
};
annotator.Add(squiggly);
annotator.Save("path/squiggly-document.docx");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment