PDF Watermark API - ApyHub - ApyHub

Apply Watermark on PDF API

ApyHub
ApyHub
verified icon
100 atoms

About

The PDF Watermark API lets you add watermarks to your existing PDF files using text or PNG images. You can adjust the watermark’s size and opacity for full control, and with support for over 50 languages, it enables developers and businesses to create professional, localized watermarks quickly and easily.
This API is ideal for developers building document management systems, content protection workflows, or corporate branding tools. By automating watermarking, it helps secure documents, maintain consistent branding, and reduce manual errors when handling large numbers of PDFs.
Try the PDF Watermark API in the API playground to streamline your workflow, enhance document security, and apply customized watermarks directly through a simple API call.
Supported Languages: Esperanto, English, Russian, Mandarin, Spanish, Portuguese, Italian, Bengali, French, German, Ukrainian, Georgian, Arabic, Hindi, Japanese, Hebrew, Yiddish, Polish, Javanese, Korean, Bokmal, Danish, Swedish, Finnish, Turkish, Dutch, Hungarian, Czech, Greek, Bulgarian, Belarusian, Marathi, Kannada, Romanian, Slovene, Croatian, Serbian, Macedonian, Lithuanian, Latvian, Estonian, Tamil, Vietnamese, Urdu, Thai, Gujarati, Uzbek, Punjabi, Azerbaijani, Indonesian, Telugu, Malayalam, Hausa, Oriya, Burmese, Bhojpuri, Maithili, Oromo, Kurdish, Malagasy, Saraiki, Nepali, Sinhalese, Khmer, Turkmen, Somali, Akan, Zulu, Haitian Creole, Africaans
Select API Endpoints
Input
Output

API Playground

API Documentation

input file: output file
POST
https://api.apyhub.com/stamp/pdf/watermark/file

Request example

1
curl --location --request POST 'https://api.apyhub.com/stamp/pdf/watermark/file?output=test-sample' \
2
--header 'apy-token: {{token}}' \
3
--form 'file= @"sample.pdf"'
4
--form 'watermark_text= "ApyHub"'
Method: POST
Content Type: multipart/form-data
Query Parameter(s)
AttributeTypeMandatoryDescription
outputStringNoThe name of the output file, defaults to test-sample.pdf.
Request Body
AttributeTypeMandatoryDescription
fileFileYesProvide the source pdf file.
watermark_textStringYes (if watermark_image not given)Input text which you want to add as watermark. If watermark_text and watermark_image both are given then watermark_text will be applied.
watermark_opacityFloatNoProvide the level of transperancy you want to keep from 0 to 0.5, defaults to 0.3.
watermark_font_sizeNumberNoProvide the font size of watermark text, defaults to 32, minimum watermark_font_size which user can provide is 8.
watermark_angleNumberNoProvide the degree at which you want to set watermark text, defaults to 0.
watermark_imageFileYes (if watermark_text not given)Provide the png image file which you want to add as watermark. If watermark_text and watermark_image both are given then watermark_text will be applied.
watermark_image_sizeFloatNoProvide size of the image watermark you want to set from 0.1 to 1, defaults to 0.3.
Sample Response
A successful request returns the pdf file in the output parameter specified. If the request fails, the response contains an error code and a message to help determine what went wrong.

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
400Invalid input - the pdf file is corrupt or the supported inputs are not provided.
401Required authentication information is either missing or not valid for the resource.
500If any unexpected error occurs while processing the request.

Authentication

All API requests to ApyHub services need to be authenticated. Currently we support tokens or basic authentication mechanisms. You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".
Points to note:
  • Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
  • Use the apy-token as the header parameter to pass the token.
  • Use the Authorization header to send the basic authentication credentials.

Error codes

1
{
2
"error": {
3
"code": 105,
4
"message": "Invalid URL"
5
}
6
}
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.
Table of contents
AboutAPI PlaygroundAPI DocumentationAuthenticationError codesRelated Utility APIsRelated Articles