Add content to a PDF session
add_pdf_contentAppend text or insert a new page into an active PDF creation session, enabling incremental page building before the final save.
Instructions
Append text or a new page to an open create_pdf session (step 2 of 3).
Mutates the in-memory session; nothing is written to disk until save_pdf. Returns JSON {status, session_id, page_count} on success, or {error, code} if the session is missing/inactive or required text fields are absent. Coordinates use PDF points with the origin at the bottom-left of the page.
Call repeatedly to build up pages, then call save_pdf. This only works on a session from create_pdf — to add notes/highlights to an existing PDF file use annotate_pdf instead.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"content_type": "<content_type>"
},
"name": "add_pdf_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Horizontal position in PDF points from the left edge. Required when content_type='text'. | |
| y | No | Vertical position in PDF points from the bottom edge (origin is bottom-left). Required when content_type='text'. | |
| font | No | Font name (e.g. 'Helvetica', 'Courier', 'Times-Roman'). Defaults to Helvetica when omitted. | |
| content | No | Text to draw. Required when content_type='text'. | |
| font_size | No | Font size in points for text content. | |
| session_id | Yes | Session id returned by create_pdf. Must be active. | |
| content_type | Yes | 'text' draws a text string at (x, y) on the current page; 'new_page' appends a blank page and makes it current. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |