pdf_open
Open a PDF into a server-side editing session and return a doc_id, form-field inventory, or text layout so later edits can be planned; optionally render pages as PNGs.
Instructions
Open a PDF into a server-side editing session and return everything needed to plan edits: a doc_id handle, the fillable form-field inventory (name, type, current value, page, rect), and - for flat PDFs without form fields - the existing text layout with coordinates for anchoring text overlays. The PDF bytes stay server-side; every later pdf_* call takes the doc_id. Optionally pass render_pages (1-based page numbers) to also get PNG renders of pages for visual inspection. Coordinates are PDF user space: origin at the page's bottom-left corner, in points (1/72 inch).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| user_id | No | ||
| render_pages | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Session handle for all subsequent pdf_* calls | |
| fields | No | ||
| status | Yes | ||
| filename | Yes | ||
| warnings | No | Non-fatal caveats about this document (existing digital signatures, XFA forms). Relay these to the user before planning edits. | |
| page_count | Yes | ||
| page_sizes | No | ||
| page_images | No | ||
| text_layout | No | Existing text lines with coordinates (flat PDFs only), for anchoring add_text overlays | |
| has_acroform | Yes | True if the PDF has fillable form fields (use set_field); false means a flat PDF (use add_text overlays anchored on text_layout) | |
| existing_signatures | No | Signature fields that already hold a digital signature. Editing such a document cryptographically invalidates them - pdf_edit requires acknowledge_signature_invalidation=true, and the user must be told before proceeding. | |
| text_layout_truncated | No | True if text_layout was cut at pdf_forms.text_layout_max_lines |