// For complete examples and data files, please go to https://github.com/groupdocsannotation/GroupDocs_Annotation_NET
// Get input file stream
Stream inputFile = new FileStream(CommonUtilities.MapSourceFilePath(filePath), FileMode.Open, FileAccess.ReadWrite);
// Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new List<AnnotationInfo>();
// Underline annotation
AnnotationInfo underlineAnnotationforwords = new AnnotationInfo
{
Box = new Rectangle((float)248.57, (float)1135.78, (float)222.67, 27),
PageNumber = 1,
SvgPath = "[{\"x\":248.57,\"y\":503.507},{\"x\":471,\"y\":503.507},{\"x\":248.57,\"y\":468.9},{\"x\":471,\"y\":468.9}]",
Type = AnnotationType.TextUnderline,
CreatorName = "Anonym A."
};
// Add annotation to list
annotations.Add(underlineAnnotationforwords);
// Export annotation and save output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Words);