Add Annotation
add_annotationAdd sticky notes, highlights, or rectangles to any PDF page, with coordinates in PDF space. Preserve existing digital signatures using incremental updates when annotating signed documents.
Instructions
Add one annotation to a page: sticky note (text), highlight, or rectangle (square). Coordinates are in PDF space (origin bottom-left, pt). For signed PDFs, preserveSignatures: true appends an incremental update without invalidating existing signatures (in tagged documents the enclosure in an Annot structure element rides the same update, preserving PDF/UA conformance).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Alt text for assistive technology. In tagged PDFs the annotation is enclosed in an Annot structure element (PDF/UA 7.18.1-1) and this becomes that element's /Alt. Ignored in untagged documents. | |
| icon | No | Icon for text notes. Default Note. | |
| open | No | Whether the text note starts open. Default false. | |
| page | Yes | Target page (1-based). | |
| rect | Yes | Annotation rectangle in PDF space (origin bottom-left, pt). Must satisfy x1<x2 and y1<y2. | |
| type | Yes | text = sticky note icon / highlight = highlight / square = rectangle. | |
| color | No | #rrggbb. Defaults per type (text=#ffd400 / highlight=#ffff00 / square=#ff0000). | |
| author | No | Author name. | |
| contents | No | Annotation body text (CJK fine). | |
| inputPath | Yes | Absolute path of the target PDF. | |
| outputPath | No | Destination file path (absolute). When omitted, a base64 string is returned instead. | |
| returnBase64 | No | When true, include a base64 string in the result in addition to saving. | |
| interiorColor | No | Fill colour for square (#rrggbb). | |
| preserveSignatures | No | Add the annotation to a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. In tagged PDFs the enclosure in an Annot structure element rides the same update, preserving PDF/UA conformance. Under a certification signature (DocMDP), allowed only at P=3. | |
| allowBreakingSignatures | No | When the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid. |