// 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>();
// Initialize text annotation.
AnnotationInfo textAnnotationforwords = new AnnotationInfo
{
Box = new Rectangle((float)265.44, (float)153.86, 206, 36),
PageNumber = 0,
SvgPath = "[{\"x\":265.44,\"y\":388.83},{\"x\":472.19,\"y\":388.83},{\"x\": 265.44,\"y\":349.14},{\"x\":472.19,\"y\":349.14}]",
Type = AnnotationType.Text,
CreatorName = "Anonym A."
};
// Add annotation to list
annotations.Add(textAnnotationforwords);
// Export annotation and save output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Words);