Add Image Stamp to PDF
Edit → Add Image Stamp to PDF
The Add Image Stamp to PDF API places an image (e.g. logo or watermark) on your PDF. You send the PDF (docContent, docName), the image (imageFile Base64, imageName), alignX and alignY, optional pages, size (mm or px), margins, opacity, isBackground, and showOnlyInPrint. The API returns the PDF with the image stamp applied. Use the tester below to try it; more details are in the sections that follow.
Try the Add Image Stamp to PDF API
Endpoint: POST /api/v2/ImageStamp · Required: api-key, docContent, docName, imageFile, imageName, alignX, alignY
Use the form below to send your API key, PDF (Base64), stamp image (Base64), and position. The response is the PDF with the image stamp. No code required—fill the fields and click Send request.
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Add Image Stamp to PDF?
This endpoint places an image (logo, watermark, or stamp) on specified pages of a PDF. You choose position via alignX (Left, Center, Right) and alignY (Top, Middle, Bottom), optional size (height/width in mm or px), margins, opacity (0–100), and whether the stamp is in the background or visible only when printing.
Key features
- Position and size – alignX/alignY; optional heightInMM/widthInMM or heightInPx/widthInPx; margins in mm or px.
- Opacity – 0 = invisible, 100 = fully opaque (e.g. 50 for a light watermark).
- Background/foreground – isBackground places the stamp behind or in front of content.
- Print-only – showOnlyInPrint shows the stamp only when printing.
- Page targeting – pages: empty for all, or e.g.
1,1,3,5,2-5.
Use for branding, copyright watermarks, or “DRAFT”/“CONFIDENTIAL” stamps. For text-only watermarks use Add Text Stamp to PDF; for signing use Sign PDF.
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docName | string | Yes | Output PDF file name (e.g. output.pdf). |
| imageFile | base64 | Yes | Image file content (Base64). |
| imageName | string | Yes | Image file name with extension (e.g. stamp.png). |
| alignX, alignY | string | Yes | Left/Center/Right; Top/Middle/Bottom. |
| pages | string | No | Empty for all, or e.g. 1, 1,3,5, 2-5. |
| heightInMM, widthInMM | string | No | Size in mm (10–200). |
| heightInPx, widthInPx | string | No | Size in pixels (20–600). |
| marginXInMM, marginYInMM, marginXInPx, marginYInPx | string | No | Margins in mm or px. |
| opacity | integer | No | 0–100. |
| isBackground | boolean | No | Place stamp in background. |
| showOnlyInPrint | boolean | No | Show only when printing. |
| async | boolean | No | Enable asynchronous processing. |
When to use Add Image Stamp to PDF
- Branding – Add logo or company stamp to every page or selected pages.
- Copyright and watermarks – Place a semi-transparent image to discourage copying.
- Status stamps – Add “DRAFT”, “APPROVED”, or “CONFIDENTIAL” as an image.
- Certification – Stamp a seal or badge on certified documents.
For request/response schemas and code samples, see Image Stamp in the PDF4me API docs.
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF document in Base64 format or a public URL to a PDF file
- An image file for the stamp (PNG, JPG, etc.)
Response Format
The API returns a PDF document with the image stamp applied to the specified pages.