pdf_annotate
Add watermarks, stamps, highlights, underlines, headers, footers, and page numbers to PDFs. Search text to mark occurrences or annotate specific pages for review.
Instructions
Add annotations and markup to PDFs.
Watermark, stamp, highlight, underline, header/footer, and page numbers.
Return Format
A dict with keys:
success: bool - whether the operation succeeded
message: str - human-readable summary
operation-specific keys:
watermark/stamp/header_footer/page_numbers: {path}
highlight: {path, occurrences}
underline: {path, occurrences} On failure: {success: False, error, error_type}.
Examples
await pdf_annotate(operation="watermark", path="report.pdf", text="CONFIDENTIAL", opacity=0.3) {"success": true, "path": ".../report_watermark_....pdf", "message": "Added watermark to report.pdf, saved to report_watermark_....pdf."}
await pdf_annotate(operation="highlight", path="report.pdf", search_text="revenue") {"success": true, "path": ".../report_highlight_....pdf", "occurrences": 3, "message": "Highlighted 3 occurrences of 'revenue' in report.pdf."}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X position for stamp annotation. Default 50. | |
| y | No | Y position for stamp annotation. Default 50. | |
| page | No | Target page number (1-indexed). Applies to all pages if omitted. | |
| path | Yes | Path to the PDF file. | |
| text | No | Text content for watermark, stamp, header, or footer. | |
| color | No | Highlight color as hex. Default #FFFF00. | #FFFF00 |
| start | No | Starting page number. Default 1. | |
| footer | No | Footer text. | |
| header | No | Header text. | |
| opacity | No | Opacity for watermark. Default 0.3. | |
| position | No | Watermark position: center, top_left, top_right, bottom_left, bottom_right, tile. | center |
| font_size | No | Font size for header/footer/page numbers. Default 10. | |
| operation | Yes | ||
| image_path | No | Path to image file for image watermark. | |
| output_path | No | Output path. Auto-generated if omitted. | |
| search_text | No | Text to search for highlighting or underlining. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Human-readable summary | |
| success | No | Whether the operation succeeded |