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 · Interactive
Schnellzugriff
Eingabedateien 1Ausgabedateien 1
Eingabe
Zulässige Eingabeformate und Dateianzahl für dieses Tool.
| Eingabetyp | file |
|---|---|
| Dateianzahl | 1 – 1 |
| Zulässige MIME-Typen | application/pdf |
Parameter
Diese Werte über request.options übergeben.
| Parameter | Typ | Erforderlich | Standard | Zulässig / Bereich | Beschreibung |
|---|---|---|---|---|---|
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. |
Ausgabe
Nach erfolgreicher Verarbeitung zurückgegebenes Ergebnisformat.
| Typ | files |
|---|---|
| Dateianzahl | 1 – 1 |
| Ausgabe-MIME | application/pdf |
| Metadata | pageCount, appliedPages, inputBytes, outputBytes, outputCount |
| ZIP-Archiv | Nicht unterstützt |
Grundlegende Verwendung
Unterstützten Integrationsmodus wählen und den erzeugten Starter-Code kopieren.
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.