usmanazizgroupdocs
3/15/2016 - 5:42 PM

AddTextStrikeOutAnnotation.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 strikeout annotation
    Dim strikeoutAnnotation As New AnnotationInfo() With { _
          .Box = New Rectangle(CSng(101.76), CSng(688.73), CSng(321.85), 27), _
          .PageNumber = 1, _
          .SvgPath = "[{""x"":101.76,""y"":400.05},{""x"":255.9,""y"":400.05},{""x"":101.76,""y"":378.42},{""x"":255.91,""y"":378.42},{""x"":101.76,""y"":374.13},{""x"":423.61,""y"":374.13},{""x"":101.76,""y"":352.5},{""x"":423.61,""y"":352.5}]", _
          .Type = AnnotationType.TextStrikeout, _
          .CreatorName = "Anonym A." _
    }
    ' Add annotation to list
    annotations.Add(strikeoutAnnotation)
    ' Export annotation and save output file
    CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf)
Catch exp As Exception
    Console.WriteLine(exp.Message)
End Try