すべての Tool›Add Watermark to PDF
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
Tool IDpdf-watermark
バージョン1
実行方式CLIENT
対応モードHeadless, Interactive, Embedded

クイック操作

入力ファイル 1出力ファイル 1

入力

この Tool が受け付ける入力形式とファイル数です。

入力種類file
ファイル数1 – 1
対応 MIMEapplication/pdf

パラメータ

これらの値は request.options で渡します。

パラメータ 型 必須 既定値 許可値 / 範囲 説明
type enum 任意 text text | image Text or image watermark. Image mode requires input.data.watermarkFile as a PNG/JPG File.
text string 任意 CONFIDENTIAL — Watermark text for text mode.
color string 任意 #64748b — Text watermark color as #RRGGBB.
opacity number 任意 28 5 – 100 Watermark opacity percentage.
size number 任意 42 10 – 80 Watermark width as a percentage of page width.
rotation number 任意 -35 -90 – 90 Watermark rotation in degrees.
position enum 任意 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 任意 all all | selected Apply to all pages or only pageRange.
pageRange string 任意 1 — Selected pages, for example 1,3,5-8.
boxX number 任意 0.29 0 – 1 Custom box left coordinate from 0 to 1.
boxY number 任意 0.43 0 – 1 Custom box top coordinate from 0 to 1.
boxWidth number 任意 0.42 0.08 – 0.9 Custom box width from 0 to 1.

出力

処理完了後に返される結果形式です。

型files
ファイル数1 – 1
出力 MIMEapplication/pdf
MetadatapageCount, appliedPages, inputBytes, outputBytes, outputCount
ZIP アーカイブ非対応

基本例

対応する統合モードを確認し、生成された開始コードをコピーできます。

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.