GroupDocsGists
10/19/2017 - 11:29 AM

AddAreaAnnotationWithReplies.vb

' For complete examples and data files, please go to https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-.NET
' 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)()

' Area annotation with 2 replies
Dim areaAnnnotation As New AnnotationInfo() With { _
    .AnnotationPosition = New Point(852.0, 59.0), _
    .Replies = New AnnotationReplyInfo() {New AnnotationReplyInfo() With { _
        .Message = "Hello!", _
        .RepliedOn = DateTime.Now, _
        .UserName = "John" _
    }, New AnnotationReplyInfo() With { _
        .Message = "Hi!", _
        .RepliedOn = DateTime.Now, _
        .UserName = "Judy" _
    }}, _
    .BackgroundColor = 11111111, _
    .Box = New Rectangle(300.0F, 200.0F, 88.0F, 37.0F), _
    .PageNumber = 0, _
    .PenColor = 2222222, _
    .PenStyle = 1, _
    .PenWidth = 1, _
    .Type = AnnotationType.Area, _
    .CreatorName = "Anonym A." _
}
' Add annotation to list
annotations.Add(areaAnnnotation)

' Export annotation and save output file