Toutes les Tools›Add Watermark to PDF
Outils PDF

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
ID Toolpdf-watermark
Version1
ExécutionCLIENT
ModesHeadless, Interactive, Embedded

Accès rapide

Fichiers d’entrée 1Fichiers de sortie 1

Entrée

Formats d’entrée et nombre de fichiers acceptés par cette Tool.

Type d’entréefile
Nombre de fichiers1 – 1
MIME acceptésapplication/pdf

Paramètres

Transmettez ces valeurs via request.options.

Paramètre Type Obligatoire Par défaut Valeurs / Plage Description
type enum Optionnel text text | image Text or image watermark. Image mode requires input.data.watermarkFile as a PNG/JPG File.
text string Optionnel CONFIDENTIAL — Watermark text for text mode.
color string Optionnel #64748b — Text watermark color as #RRGGBB.
opacity number Optionnel 28 5 – 100 Watermark opacity percentage.
size number Optionnel 42 10 – 80 Watermark width as a percentage of page width.
rotation number Optionnel -35 -90 – 90 Watermark rotation in degrees.
position enum Optionnel 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 Optionnel all all | selected Apply to all pages or only pageRange.
pageRange string Optionnel 1 — Selected pages, for example 1,3,5-8.
boxX number Optionnel 0.29 0 – 1 Custom box left coordinate from 0 to 1.
boxY number Optionnel 0.43 0 – 1 Custom box top coordinate from 0 to 1.
boxWidth number Optionnel 0.42 0.08 – 0.9 Custom box width from 0 to 1.

Sortie

Format du résultat renvoyé après traitement.

Typefiles
Nombre de fichiers1 – 1
MIME de sortieapplication/pdf
MetadatapageCount, appliedPages, inputBytes, outputBytes, outputCount
Archive ZIPNon pris en charge

Utilisation de base

Choisissez un mode pris en charge et copiez le code de démarrage généré.

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.