All Tools›Add Watermark to PDF
PDF Tools

Add Watermark to PDF

pdf-watermark

Use Add Watermark to PDF through the Zavilo SDK. Check input limits, parameters, output and supported modes below.

H · HeadlessI · InteractiveE · Embedded
Tool IDpdf-watermark
Version1
ExecutionCLIENT
WorkloadSTANDARD
ModesHeadless, Interactive, Embedded

Quick actions

Input files 1Output files 1

Input

Accepted input contract for this Tool.

Kindfile
File count1 – 1
Accepted MIME typesapplication/pdf

Parameters

Pass these values through request.options.

Parameter Type Required Default Allowed / Range Description
type enum Optional text text | image Text or image watermark. Image mode requires input.data.watermarkFile as a PNG/JPG File.
text string Optional CONFIDENTIAL — Watermark text for text mode.
color string Optional #64748b — Text watermark color as #RRGGBB.
opacity number Optional 28 5 – 100 Watermark opacity percentage.
size number Optional 42 10 – 80 Watermark width as a percentage of page width.
rotation number Optional -35 -90 – 90 Watermark rotation in degrees.
position enum Optional center top-left | top-center | top-right | middle-left | center | middle-right | bottom-left | bottom-center | bottom-right | custom Preset position or custom. Custom uses boxX, boxY and boxWidth.
pages enum Optional all all | selected Apply to all pages or only pageRange.
pageRange string Optional 1 — Selected pages, for example 1,3,5-8.
boxX number Optional 0.29 0 – 1 Custom box left coordinate from 0 to 1.
boxY number Optional 0.43 0 – 1 Custom box top coordinate from 0 to 1.
boxWidth number Optional 0.42 0.08 – 0.9 Custom box width from 0 to 1.

Output

Result contract returned after successful processing.

Typefiles
File count1 – 1
MIME typesapplication/pdf
MetadatapageCount, appliedPages, inputBytes, outputBytes, outputCount
ZIP archiveNo

Basic usage

Choose a supported integration mode and copy the generated starter code.

Headless

const result = await client.run("pdf-watermark", {
  file,
  options: { type: "text", text: "CONFIDENTIAL", color: "#64748b", opacity: 28 }
});
console.log(result.files, result.data, result.metadata);

Interactive

await client.open({
  tool: "pdf-watermark",
  input: { file },
  options: { type: "text", text: "CONFIDENTIAL", color: "#64748b", opacity: 28 },
  onComplete(result) { console.log(result.files, result.data, result.metadata); }
});

Embedded

await client.mount({ tool: "pdf-watermark", target: "#zavilo-tool", mode: "embedded" });
This page is generated from the SDK Tool Definition used by the runtime.