Watermark PDF
POST https://api.pdfrest.com/watermarked-pdf
Apply a text or file watermark to a PDF. (A file watermark is sourced from an input PDF.)
(Horizontal and vertical offsets of the watermark are measured in PDF units. [1 inch = 72 PDF units])
Required form-data body parameters:
- One of:
file
- File to be uploaded and processedid
- Alphanumeric ID (UUID) of existing file on server to be processed
- One of:
watermark_text
- A string of text to be applied to the input document as a watermarkwatermark_file
- A PDF file to apply to the input document as a watermarkwatermark_file_id
- Resource ID of a PDF file to apply to the input document as a watermark
Optional form-data body parameters (bold = default):
output
- File name for output file (without extension)font
- Font to use for a text watermark. See our font list for a complete list of accepted fonts. Default font is Arial.text_size
- Size of text for a text watermark. Can range from 5 to 100. Default value is 72.text_color_rgb
ortext_color_cmyk
- Comma-separated values to modify the color of a text watermark.opacity
- Decimal value where 0 is fully transparent and 1 is fully opaque. Must be greater than 0 (e.g., 0.5).x
- Horizontal offset in PDF units from the center of the page. Default: 0.y
- Vertical offset in PDF units from the center of the page. Default: 0.rotation
- Rotation in degrees. Default is 0 for both text and file watermarks.watermark_file_scale
- Scale applied to resize the content of a PDF watermark file. Default scale is 0.5.
Request Body
[{"name"=>"file", "value"=>nil, "datatype"=>"null"}, {"name"=>"id", "value"=>"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "datatype"=>"string"}, {"name"=>"watermark_text", "value"=>"Hello, watermarked world!", "datatype"=>"string"}, {"name"=>"watermark_file", "value"=>nil, "datatype"=>"null"}, {"name"=>"watermark_file_id", "value"=>"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "datatype"=>"string"}, {"name"=>"output", "value"=>"pdfrest_watermarked_pdf", "datatype"=>"string"}, {"name"=>"font", "value"=>"Arial", "datatype"=>"string"}, {"name"=>"text_size", "value"=>"72", "datatype"=>"number"}, {"name"=>"text_color_rgb", "value"=>"255,0,0", "datatype"=>"string"}, {"name"=>"text_color_cmyk", "value"=>"100,0,0,0", "datatype"=>"string"}, {"name"=>"watermark_file_scale", "value"=>"0.5", "datatype"=>"string"}, {"name"=>"opacity", "value"=>"0.5", "datatype"=>"string"}, {"name"=>"x", "value"=>"0", "datatype"=>"number"}, {"name"=>"y", "value"=>"0", "datatype"=>"number"}, {"name"=>"rotation", "value"=>"0", "datatype"=>"number"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Api-Key | string |