usmanazizgroupdocs
3/15/2016 - 5:41 PM

AddTextRedactionAnnotation.vb

' For complete examples and data files, please go to https://github.com/groupdocsannotation/GroupDocs_Annotation_NET
Try
    ' Get input file stream
    Dim inputFile As Stream = New FileStream(CommonUtilities.MapSourceFilePath(filePath), FileMode.Open, FileAccess.ReadWrite)

    ' Initialize list of AnnotationInfo
    Dim annotations As New List(Of AnnotationInfo)()

    ' Text redaction annotation
    Dim textRedactionAnnotation As New AnnotationInfo() With { _
          .Box = New Rectangle(CSng(448.56), CSng(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(textRedactionAnnotation)
    ' Export annotation and save output file
    CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf)
Catch exp As Exception
    Console.WriteLine(exp.Message)
End Try