GroupDocsGists
10/19/2017 - 11:27 AM

AddWatermarkAnnotation.vb

' For complete examples and data files, please go to https://github.com/groupdocsannotation/GroupDocs_Annotation_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)()

' Watermark annotation
Dim watermarkAnnotation As New AnnotationInfo() With { _
	Key .AnnotationPosition = New Point(100.0, 300.0), _
	Key .FieldText = "TEXT STAMP", _
	Key .FontFamily = "Microsoft Sans Serif", _
	Key .FontSize = 10, _
	Key .FontColor = 2222222, _
	Key .Box = New Rectangle(430F, 272F, 66F, 51F), _
	Key .PageNumber = 0, _
	Key .Type = AnnotationType.Watermark, _
	Key .CreatorName = "Anonym A." _
}
' Add annotation to list
annotations.Add(watermarkAnnotation)

' Export annotation and save output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf)