ComPDFKit Web SDK
    Preparing search index...

    Interface WatermarkOptions

    View watermark (drawn on screen only, not written to the file; use Document.addWatermark for that): diagonal along the page diagonal, header / footer at left, center and right of the top and bottom edges, custom draws itself (page coordinates); with shouldDrawOverAnnotations true it is drawn above annotations

    interface WatermarkOptions {
        custom?: (
            ctx: CanvasRenderingContext2D,
            pageNumber: number,
            pageWidth: number,
            pageHeight: number,
        ) => void;
        diagonal?: WatermarkTextStyle & { text?: string };
        footer?: WatermarkTextStyle & {
            center?: string;
            left?: string;
            right?: string;
        };
        header?: WatermarkTextStyle & {
            center?: string;
            left?: string;
            right?: string;
        };
        shouldDrawOverAnnotations?: boolean;
    }
    Index
    custom?: (
        ctx: CanvasRenderingContext2D,
        pageNumber: number,
        pageWidth: number,
        pageHeight: number,
    ) => void

    Draws a custom watermark; the context uses page coordinates.

    diagonal?: WatermarkTextStyle & { text?: string }

    Text drawn along the page diagonal, with its style.

    Type Declaration

    • Optionaltext?: string

      Text to draw.

    footer?: WatermarkTextStyle & { center?: string; left?: string; right?: string }

    Text at the left, center and right of the bottom edge, with its style.

    Type Declaration

    • Optionalcenter?: string

      Text at the center of the bottom edge.

    • Optionalleft?: string

      Text at the left of the bottom edge.

    • Optionalright?: string

      Text at the right of the bottom edge.

    header?: WatermarkTextStyle & { center?: string; left?: string; right?: string }

    Text at the left, center and right of the top edge, with its style.

    Type Declaration

    • Optionalcenter?: string

      Text at the center of the top edge.

    • Optionalleft?: string

      Text at the left of the top edge.

    • Optionalright?: string

      Text at the right of the top edge.

    shouldDrawOverAnnotations?: boolean

    Draws the watermark above annotations instead of below them.