Annotate PDF (markup / drawing)
annotate_pdfAppend markup and drawing annotations to an existing PDF. Supports text notes, highlights, underlines, shapes, lines, and free text without modifying original content.
Instructions
Add markup / drawing annotations (ISO 32000-1 §12.5) to an existing PDF via pdfnative v1.5's annotation writer. Non-destructive incremental update: original content is preserved byte-for-byte and each annotation is appended to the target page's /Annots. Types: text (sticky note), highlight | underline | strikeout | squiggly (text-markup), square | circle (shapes), line, freetext. Each annotation needs a 0-based page and a rect [x1,y1,x2,y2]; line also needs start/end. Optional per-annotation: contents, color, opacity, title, plus type-specific fields (open/icon, quadPoints, interiorColor/borderWidth, fontSize). Encrypted sources are rejected (ENCRYPTED_SOURCE). NOTE: annotations are visual overlays — they do NOT remove or redact the underlying content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pdfBase64 | Yes | Base64-encoded source PDF to annotate. | |
| outputMode | No | base64 | |
| outputPath | No | ||
| annotations | Yes | Markup / drawing annotations to add. Each is attached to a 0-based page index. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| sizeBytes | Yes |