GroupDocsGists
10/19/2017 - 11:11 AM

WatermarkOperations-AddImageWatermarkUsingStream.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using watermarkStream As Stream = File.OpenRead("D:\watermark.jpg")
    Using doc As Document = Document.Load(Utilities.MapSourceFilePath(PngFilePath))
        ' Use stream containing an image as constructor parameter
        Using watermark As New ImageWatermark(watermarkStream)
            ' Add watermark to the document
            doc.AddWatermark(watermark)

            doc.Save()
        End Using
    End Using
End Using