usmanazizgroupdocs
4/17/2017 - 9:50 AM

Documents-AddWatermarkToPDF.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))
    ' Add text watermark
    Dim textWatermark As New TextWatermark("This is a test watermark", New Font("Arial", 8))
    doc.Pages(0).AddWatermark(textWatermark)

    ' Add image watermark
    Using imageWatermark As New ImageWatermark("D:\protect.jpg")
        doc.Pages(1).AddWatermark(imageWatermark)
    End Using
    doc.Save()
End Using