Skip to main content
To generate a PDF with custom styles from an LLM, ask your model for its answer in Markdown and send it to Doconda with format: "pdf" and the look in style. You get a laid-out PDF (headings, tables, page numbers) with the font embedded, so it looks the same everywhere.

Steps

  1. Ask your model to answer in Markdown (headings with #, lists, tables).
  2. Store your API key in DOCONDA_API_KEY and install the SDK (pip install doconda or npm install @doconda/sdk).
  3. Send that Markdown with format: "pdf" and the style, and download the PDF.
If you’d rather have Doconda write the content, swap content for prompt (“Quarterly summary for the board, with blue headings”): the style asked for in the sentence is applied too.

What you get back

  • A PDF with the font embedded. With format: "pdf" you get only the PDF; with docx you also get the editable Word file.
  • style_applied: how the style was understood, and style_unsupported: what couldn’t be applied.
  • status: ready, ready_with_warnings, needs_review or failed (not charged).
  • A report with what’s worth checking (documents.report(id)).

Limits

  • With quality: "fast" you get the basic style: font, size, colors, alignment, margins, cover page, table of contents, header and footer.
  • The links in outputs expire after 5 minutes; documents.outputs(id) gives you new ones.
  • Fonts: any Google Fonts family plus Calibri, Cambria, Arial, Times New Roman and Courier New. A font that doesn’t exist comes back in style_unsupported.

FAQ

No. You describe the look in a sentence and the layout adapts to the kind of document (a contract, with numbered clauses; a letter, without page numbers).
Yes. Upload them with files.upload, pass them in sources and place them in the Markdown with ![Caption](img:1).
Use format: "docx": you get the Word file and its PDF.

Keep reading