Add text, images, a signature or a barcode/QR code to a PDF
pdf_editStamp text, images, or barcodes at exact positions on selected pages of an existing PDF, using point coordinates to annotate or brand documents without altering the source.
Instructions
Stamp text and images (logos, signature images, photos) onto specific pages of an existing PDF at exact positions. Coordinates are PDF points measured from the bottom-left corner of the page as the viewer sees it (1 inch = 72 pt; US Letter is 612 x 792), so stamps land upright on any page size or rotation. Text uses standard fonts (WinAnsi characters only: CJK and emoji fail with unsupported_characters) and can wrap to max_width. Images are PNG or JPEG, up to 2 MB each and 10 distinct images per call (the PDF and all images together must stay under 4.5 MB), given as a local path, an https:// URL or a data:image/png;base64,... URI. Barcodes (QR, Data Matrix, PDF417, Aztec, Code 128, Code 39, EAN-13/8, UPC-A, ITF-14, Interleaved 2 of 5, GS1-128) are generated from a value and drawn as vector paths, so they scan at any print size (up to 25 per call). Use pdf_fill for fillable form fields and pdf_watermark for a diagonal stamp on every page. Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pdf_path": "<pdf_path>",
"items": "<items>"
},
"name": "pdf_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Stamps to draw, in order (later items draw on top). | |
| password | No | Password to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it). | |
| pdf_path | Yes | PDF source: a path to a .pdf file inside the allowed directories (PDFOPS_ROOT, default the working directory), an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist. | |
| output_path | No | Path of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | Size of the produced PDF in bytes | |
| output_path | No | Absolute path written, when output_path was supplied | |
| resource_uri | No | pdfops:// uri of the inline application/pdf resource, when output_path was omitted |