The Watermark PDF endpoint adds a watermark to an existing PDF document. You can apply either a text watermark or an image watermark, depending on your needs.
File type: .pdf
The source PDF file to watermark. Either file or documentId must be provided.
The unique identifier of an existing uploaded document. Use this when watermarking a file that's already stored on our database.
File types: .png .jpeg .jpg
The image to be used as a watermark. Provide this field if you want an image watermark instead of text.
File types: .ttf .otf
A custom font file for text watermarks.
Use text for a text watermark and image for an image watermark.
The text you want to appear as the watermark.
Default: helvetica
The font name to use for the text watermark. Must be one of the standard PDF fonts. If the fontFile is provided, this parameter will be ignored.
Default: 30
The size of the watermark text, in points.
The color of the text watermark. Accepts a hex color (e.g., #FF0000) or an RGB value (e.g., rgb(255,0,0)).
Default: 1
Sets the transparency of the watermark, from 0 (fully transparent) to 1 (fully opaque). It applies to both text and image watermarks.
The horizontal position (in points) where the image or text watermark will be placed. If not provided a centered position will be applied.
The vertical position (in points) where the image or text watermark will be placed. If not provided, a centered position will be applied.
The width (in points) to resize the watermark image to. If not provided, the image keeps its original width.
The height (in points) to resize the watermark image to. If not provided, the image keeps its original height.
Rotates the watermark by the specified angle in degrees (0-360). Useful for diagonal watermarks.
Default: false
Returns JSON response instead of file stream.
Minimum: 60 seconds
Maximum: 86400 seconds (24 hours)
Use this to control temporary authorized access to files. After this duration, the URL automatically expires and can no longer be used to download the PDF. The value must be provided in seconds.
If you need to generate a new pre-signed URL for an existing document, use the Get Document endpoint.
Sets custom data to your document record.
1curl -X POST "https://api.pdfgate.com/watermark/pdf" \2 -H "Authorization: Bearer YOUR_API_KEY" \3 -F "file=@YOUR_FILE.pdf" \4 -F "type=text" \5 -F "text=My watermark!" \6 -F "fontColor=rgb(156, 50, 168)" \7 -F "rotate=30" \8 -F "opacity=0.2" \9 --output watermarked.pdf1File stream1{2 "id" : "6642381c5c61",3 "status" : "completed",4 "fileUrl" : "https://api.pdfgate.com/file/open/:preSignedUrlToken",5 "size" : 1620006,6 "type" : "watermarked",7 "derivedFrom" : "68f920bacfe16de217f019as",8 "createdAt" : "2024-02-13T15:56:12.607Z"9}