Herramientas 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 · Interactive
Acciones rápidas
Archivos de entrada 1Archivos de salida 1
Entrada
Formatos de entrada y número de archivos admitidos por esta Tool.
| Tipo de entrada | file |
|---|---|
| N.º de archivos | 1 – 1 |
| MIME admitidos | application/pdf |
Parámetros
Pasa estos valores mediante request.options.
| Parámetro | Tipo | Obligatorio | Predeterminado | Valores / Rango | Descripción |
|---|---|---|---|---|---|
type |
enum | Opcional | text |
text | image | Text or image watermark. Image mode requires input.data.watermarkFile as a PNG/JPG File. |
text |
string | Opcional | CONFIDENTIAL |
— | Watermark text for text mode. |
color |
string | Opcional | #64748b |
— | Text watermark color as #RRGGBB. |
opacity |
number | Opcional | 28 |
5 – 100 | Watermark opacity percentage. |
size |
number | Opcional | 42 |
10 – 80 | Watermark width as a percentage of page width. |
rotation |
number | Opcional | -35 |
-90 – 90 | Watermark rotation in degrees. |
position |
enum | Opcional | 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 | Opcional | all |
all | selected | Apply to all pages or only pageRange. |
pageRange |
string | Opcional | 1 |
— | Selected pages, for example 1,3,5-8. |
boxX |
number | Opcional | 0.29 |
0 – 1 | Custom box left coordinate from 0 to 1. |
boxY |
number | Opcional | 0.43 |
0 – 1 | Custom box top coordinate from 0 to 1. |
boxWidth |
number | Opcional | 0.42 |
0.08 – 0.9 | Custom box width from 0 to 1. |
Salida
Formato del resultado devuelto al completar el procesamiento.
| Tipo | files |
|---|---|
| N.º de archivos | 1 – 1 |
| MIME de salida | application/pdf |
| Metadata | pageCount, appliedPages, inputBytes, outputBytes, outputCount |
| Archivo ZIP | No compatible |
Uso básico
Elige un modo compatible y copia el código inicial generado.
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.