Generate PDF
generate_pdfRender one free branded PDF draft in a brand kit and save it to the user's files: any document the user describes, from an invoice or a statement to a one-pager, a proposal, a memo, a case study, an agenda or a report. Drafts are limited to 20 per day. Templates: 'invoice' takes items of description, quantity, unit_price, up to 30 plus props invoice_number, issued_on, due_on, bill_to, currency, tax_rate, notes; 'statement' takes items of description, date, amount, up to 30 plus props account, account_of, period_start, period_end, currency, opening_balance, notes; 'report' takes markdown or blocks plus props subtitle, author, dated; 'letter' takes markdown or blocks plus props recipient, dated, signoff; 'proposal' takes markdown or blocks plus props client, valid_until, prepared_by. A document template renders whatever markdown you give it, so an unfamiliar ask (a press release, a checklist, a brief) is still a report, letter or proposal with the right headings. Line item fields are all strings, and every date is YYYY-MM-DD. Write a document as markdown (headings, lists, tables) or as blocks, never both, and its first heading becomes the title unless you pass a title. Leave brand_kit_id out to use the space's default brand. Returns the artifact id and how many pages it came to. The draft carries a YouSpot watermark until the user unlocks the clean PDF for 1 credit from the card; you cannot unlock it. Do not call this again to retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page size; left out it follows the brand kit. | |
| items | No | Line items, in the fields the template names. | |
| props | No | Text fields for the template, all strings. | |
| title | No | The document title. Optional. | |
| blocks | No | The document body as blocks. | |
| markdown | No | The document body as markdown. | |
| footer_text | No | The footer line. Empty string for no footer; left out it is the brand name. | |
| template_id | Yes | ||
| brand_kit_id | No | A brand_kit_id from list_brand_kits. | |
| page_numbers | No | ||
| saved_template_id | No | A saved_template_id from list_templates; its inputs seed the ones you pass. |