Skip to main content
Ask your model for Markdown, then 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 on every device.

Turn an LLM’s answer into a styled PDF

  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 the Markdown with format: "pdf" and the style, then download the PDF.
You should see Inter 2, and summary.pdf on disk. style_applied holds the style the file ended up with, so you can check each value.

Your Markdown or a prompt

Use your Markdown when your model already wrote the text. Use prompt when Doconda should write it, or read your files in sources first. Sending both is rejected with 422 input_invalid.

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: font, font_size, colors, align, margins_cm, orientation, page_numbers and more.
  • status: ready, or failed with error.code. A failed document isn’t charged.
Behavior to be aware of:
  • Before delivery the agent checks the rendered pages and fixes what it finds (tables that overflow, numbering gaps).
  • Fonts: any Google Fonts family, plus Calibri, Cambria, Arial, Times New Roman and Courier New. A font that isn’t available is replaced by the closest one.
  • The links in outputs expire after 5 minutes; documents.outputs(id) gives you new ones.

FAQ

No. You describe the look in a sentence, and the layout fits the kind of document: a contract gets numbered clauses, a letter no page numbers.
Yes. Upload them with files.upload (PNG, JPEG, GIF or WebP, up to 10), pass their IDs in sources and place them in the Markdown with ![Caption](img:1).
Yes, with quality: "fast" (€0.05 from Markdown): about a minute instead of a few minutes. See quality levels.
For everything you can ask for in style, see Style.