PdfArtifactWatermarkOptions

PdfArtifactWatermarkOptions class

Represents watermark adding options when adding artifact watermark to a pdf document.

public sealed class PdfArtifactWatermarkOptions : PdfWatermarkOptions

Constructors

Name Description
PdfArtifactWatermarkOptions() Initializes a new instance of the PdfArtifactWatermarkOptions class.

Properties

Name Description
PageIndex { get; set; } Gets or sets the page index to add watermark to.

Remarks

Learn more:

Examples

Add image artifact watermark to a PDF document.

PdfLoadOptions loadOptions = new PdfLoadOptions();
using (Watermarker watermarker = new Watermarker(@"D:\test.pdf", loadOptions))
{
    using (ImageWatermark watermark = new ImageWatermark(@"D:\icon.png"))
    {
        watermark.HorizontalAlignment = HorizontalAlignment.Right;
        watermark.VerticalAlignment = VerticalAlignment.Bottom;

        PdfArtifactWatermarkOptions options = new PdfArtifactWatermarkOptions();
        options.PageIndex = -1; // default - all pages

        watermarker.Add(watermark, options);
        watermarker.Save();
    }
}

See Also