GroupDocsGists
10/24/2017 - 5:13 PM

AddTextRedactionAnnotationforwords.cs

// 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>();

// Text redaction annotation
AnnotationInfo textRedactionAnnotationforwords = new AnnotationInfo
{
    Box = new Rectangle((float)448.56, (float)212.4, 210, 27),
    PageNumber = 0,
    SvgPath = "[{\"x\":448.56,\"y\":326.5},{\"x\":658.7,\"y\":326.5},{\"x\":448.56,\"y\":302.43},{\"x\":658.7,\"y\":302.43}]",
    Type = AnnotationType.TextRedaction,
    CreatorName = "Anonym A."
};
// Add annotation to list
annotations.Add(textRedactionAnnotationforwords);

// Export annotation and save output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Words);