Skip to content

modern-pdf-lib


modern-pdf-lib / addWatermarkToPage

Function: addWatermarkToPage()

addWatermarkToPage(page, options, registry): void

Defined in: src/core/watermark.ts:66

Add a watermark to a single page.

The watermark is drawn using the Helvetica standard font (no embedding required). The text is rendered with the specified rotation, opacity, and colour.

Parameters

page

PdfPage

The page to watermark.

options

WatermarkOptions

Watermark options.

registry

PdfObjectRegistry

The PDF object registry (for ExtGState).

Returns

void

Released under the MIT License.