GroupDocsGists
10/19/2017 - 11:00 AM

AddWatermarkWithPageMarginType.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As PdfDocument = Document.Load(Of PdfDocument)(Utilities.MapSourceFilePath(FilePath))
	Dim watermark = New TextWatermark("Test watermark", New Font("Arial", 42))
	watermark.HorizontalAlignment = HorizontalAlignment.Right
	watermark.VerticalAlignment = VerticalAlignment.Top
	watermark.SizingType = SizingType.ScaleToParentDimensions
	watermark.ScaleFactor = 1

	doc.PageMarginType = PdfPageMarginType.BleedBox
	watermark.ConsiderParentMargins = True
	doc.AddWatermark(watermark)
	doc.Save()
End Using