Add Text Stamp to PDF
Edit → Add Text Stamp to PDF
The Add Text Stamp to PDF API adds a text watermark or stamp to your PDF. You send the PDF (docContent, docName), pages, text, alignX and alignY, optional margins, opacity, font (fontName, fontSize, fontColor, isBold, isItalics, underline), rotate (0, 45, 90, -45), isBackground, showOnlyInPrint, fitTextOverPage, and async. The API returns the PDF with the text stamp applied. Use the tester below to try it; more details are in the sections that follow.
Try the Add Text Stamp to PDF API
:::note Quick reference
Endpoint: POST /api/v2/Stamp · Required: api-key, docContent, docName, pages, text, alignX, alignY
:::
:::info Try it live Use the form below to send your API key, PDF (Base64), watermark text, and position. The response is the PDF with the text stamp. No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Add Text Stamp to PDF?
This endpoint adds a text watermark or stamp to specified pages of a PDF. You provide the text, position (alignX, alignY), optional margins (mm or px), opacity (0–100), font (fontName, fontSize, fontColor, isBold, isItalics, underline), rotate (0, 45, 90, -45), isBackground, showOnlyInPrint, and fitTextOverPage to stretch text across the page. The API returns the PDF with the text stamp applied.
Key features
- Text and position – text, alignX (left, center, right), alignY (top, middle, bottom), margins in mm or px.
- Styling – fontName (Arial, Times New Roman, Helvetica, Courier New), fontSize (8–72), fontColor (hex), isBold, isItalics, underline.
- Rotation – rotate: 0 (horizontal), 45 (diagonal), 90 (vertical), -45 (reverse diagonal).
- Opacity – 0 = invisible, 100 = fully opaque (e.g. 30 for a light watermark).
- Background/foreground – isBackground; showOnlyInPrint; fitTextOverPage to fit text over the entire page.
:::tip Best for Use for “CONFIDENTIAL”, “DRAFT”, or “COPY” watermarks. For image-based stamps use Add Image 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). |
| pages | string | Yes | e.g. all, 1, 1,3,5, 2-5, 1,3,7-10, 2-. |
| text | string | Yes | Text to stamp as watermark. |
| alignX, alignY | string | Yes | left/center/right; top/middle/bottom. |
| marginXInMM, marginYInMM, marginXInPx, marginYInPx | string | No | Margins in mm or px. |
| opacity | string | No | 0–100. |
| fontName | string | No | Arial, Times New Roman, Helvetica, Courier New. |
| fontSize | integer | No | 8–72. |
| fontColor | string | No | Hex (e.g. #FF0000). |
| isBold, isItalics, underline | boolean | No | Bold, italic, underline. |
| rotate | integer | No | 0, 45, 90, -45. |
| isBackground, showOnlyInPrint, transverse, fitTextOverPage | boolean | No | Background, print-only, transverse, fit over page. |
| async | boolean | No | Enable asynchronous processing. |
When to use Add Text Stamp to PDF
- Confidentiality – Add “CONFIDENTIAL” or “INTERNAL ONLY” watermarks.
- Draft and status – Add “DRAFT”, “APPROVED”, or “COPY” to indicate status.
- Copyright – Add copyright or “DO NOT COPY” text.
- Branding – Add company name or disclaimer as a semi-transparent stamp.
:::info Need the full API? For request/response schemas and code samples, see Text 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
Response Format
The API returns a PDF document with the text stamp/watermark applied to the specified pages.