Skip to main content
create_pdf_document Create a NEW PDF document in a HERO project — a real, paginated PDF file that opens in HERO’s PDF viewer and downloads as .pdf. Two modes (exactly one): - markdown — render content you compose. Accepts the same HERO extended markdown as write_document_markdown (headings, @clause numbering, lists, tables, blockquotes, bold/italic, links, signature lines). A PDF is static: write the FINAL text with real values — no {{placeholder:…}} atoms or [BRACKETS]. Gather the facts first from the project (list_project_documents, read_document_text, get_table_data / lookup_table_cells). - sourceDocumentId — render an existing HERO document (or convert a Word document) as it currently stands; clause numbering, tables and placeholder values are filled in from the project. Use this for ‘export / save / turn X into a PDF’. Defaults to the source document’s project and folder. Put the PDF where it belongs: the project (and folder via parentId) the user named or the conversation is about; ask if it is ambiguous. Only use this when the user wants a PDF — for normal drafting create native HERO documents (create_document + write_document_markdown). To bring in an EXISTING file, use import_file. Each call makes a new PDF: to redo one you made earlier in this conversation (longer, corrected), pass it as replaces.

Parameters

string
Document name in HERO and the PDF’s title metadata. Not drawn on the page — put a heading in the markdown for that. Defaults to the first heading, or the source document’s name.
string
Full PDF content as HERO extended markdown. Mutually exclusive with sourceDocumentId.
string
Existing HERO editor or Word document to render as a PDF. Mutually exclusive with markdown.
string, enum: 'letter' | 'a4'
Paper size. Default ‘letter’; use ‘a4’ outside the US/Canada or when the user asks.
string, enum: 'sans' | 'serif'
Typeface. Default ‘sans’; ‘serif’ suits formal legal documents.
string
Project to create the PDF in.
string
Folder (or document) to file it under. Omit for the project root.
string
documentId of a PDF you created earlier in this conversation that this one supersedes. The new PDF takes its place, and the old one goes to the trash (undo brings it back).