Redact a PDF
redact_pdfPermanently remove text, image pixels, links, and comments from PDFs by specified regions or text matches, and verify redaction before returning the file.
Instructions
Removes what lies under rectangles of the pages, and every place where a text stands, from the file itself and not just from view: text, the pixels of images under a rectangle, and links and comments it touches. The result is read again: a text that can still be found fails the call with redaction_incomplete, which names rectangles and texts by their number, and nothing is delivered. Rectangles are points from the top-left corner of the page as a viewer shows it, 72 to an inch; get_pdf_info gives the page sizes and pdf_to_image a picture of the page. A text is found whatever its spacing, ignoring case unless match_case is true. A black box is drawn over each removed place, another colour with fill, none with fill null. Pass exactly one PDF: source, a render or library file of the workspace; path, a file on this machine; or file_base64. Starter plan and above; 0.5 units on a live key. The texts are never stored.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "redact_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | Colour of the box drawn over each removed place, #000000 when left out; null draws none | |
| path | No | Absolute path of a PDF on this machine, up to 100 MB; sent with the request and not kept | |
| text | No | Texts to remove wherever they stand, such as a name or an IBAN, found whatever their spacing | |
| source | No | A PDF of the workspace: the rnd_ id of a PDF render, or a PDF of the file library by name (such as terms.pdf) or fil_ id | |
| regions | No | The rectangles to remove, as a viewer shows the page; give regions, text or both | |
| filename | No | Name of the file behind download_url; the source's name when left out | |
| file_name | No | Name of the PDF given as file_base64 or path, e.g. contract.pdf; the results are named after it | |
| match_case | No | Find a text only in the case it is written in | |
| file_base64 | No | The PDF itself, base64 encoded, up to 20 MB; sent with the request and not kept | |
| whole_words | No | Find a text only where a word boundary stands on each side |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | rnd_ id of the render | |
| form | No | What fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran | |
| pdfa | No | The PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it | |
| error | Yes | Why a failed render failed | |
| units | Yes | Units the render counted | |
| output | No | The format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image | |
| status | Yes | ||
| einvoice | No | The e-invoice report, when the render made one | |
| template | Yes | The template and version rendered; null for html and conversions | |
| expires_at | Yes | When download_url stops working; get_render issues a fresh one | |
| page_count | Yes | ||
| environment | Yes | ||
| download_url | Yes | Signed link to the file; null until the render succeeded | |
| accessibility | No | The PDF/UA-1 verdict, when the template declares it |