Watermark PDF API

Add text or image watermarks to PDFs programmatically.

check-mark-icnNo credit card required

Watermark PDF API Overview

Our Watermark PDF API allows you to apply text or image watermarks to existing PDF documents as part of an automated document workflow. It is designed for use cases where PDFs need to be clearly labeled, branded, or protected before being shared, reviewed, or distributed.

Watermarks can be used to indicate document status (such as Draft or Preview), discourage unauthorized sharing, or apply consistent branding across generated documents. The API works on server-side PDFs and integrates easily into existing systems without requiring custom PDF manipulation logic.

This endpoint can be used as a standalone operation or combined with other PDFGate endpoints. A common workflow includes generating a PDF from HTML, applying a watermark for review purposes, and later producing a final, unwatermarked or secured version for distribution.

The Watermark PDF API is suitable for SaaS platforms, internal business tools, and document automation systems that need reliable, repeatable watermarking without manual intervention.

Quick Start


Get started quickly with a single API call. This endpoint fits easily into your existing workflows and works with any language that can make HTTP requests, including Node.js, Python, PHP, and more. Use the examples to get started in just a few steps.

CURL
NODE.JS
PYTHON
GO
PHP
JAVA
C#
RUBY
copy-integration-source-code-icon
curl -X POST "https://api.pdfgate.com/watermark/pdf" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@YOUR_FILE.pdf" \ -F "type=text" \ -F 'text=My watermark!' \ -F 'fontColor=rgb(156, 50, 168)' \ -F "rotate=30" \ -F "opacity=0.2" \ --output watermarked.pdf

API Parameters

File

The PDF file you want to apply the watermark to. You must provide either this or documentId.

Document Id

The ID of a PDF that already exists in your PDFGate account. Use this instead of uploading a file again.

Watermark

The image file used as a watermark (.png, .jpeg, .jpg). Required if you are adding an image watermark.

Font File

A custom font file (.ttf or .otf) to use for text watermarks.

Type

Defines the watermark type. Use text for text watermarks or image for image watermarks.

Text

The text that will appear as the watermark. Required when type is set to text.

Font

The font name for the text watermark. Ignored if a custom fontFile is provided.

Font Size

Font size for the text watermark, in points.

Font Color

Color of the text watermark. Can be a hex value (for example #000000) or an RGB value.

Opacity

Controls how transparent the watermark is. Values range from 0 (invisible) to 1 (fully visible).

X Position

Horizontal position of the watermark in points. If not set, the watermark will be centered.

Y Position

Vertical position of the watermark in points. If not set, the watermark will be centered.

Image Width

Width to resize the watermark image to, in points. If omitted, the original width is used.

Image Height

Height to resize the watermark image to, in points. If omitted, the original height is used.

Rotate

Rotation angle for the watermark in degrees (0–360). Useful for diagonal watermarks.

Json Response

If it is set to true, the API will return a JSON response instead of the PDF file.

Pre Signed Url Expires In

Expiration time (in seconds) for the generated temporary download URL.

Metadata

Custom metadata you want to attach to the document.