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
- Ask your model to answer in Markdown (headings with
#, lists, tables). - Store your API key in
DOCONDA_API_KEYand install the SDK:pip install docondaornpm install @doconda/sdk. - Send the Markdown with
format: "pdf"and the style, then download the PDF.
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; withdocxyou also get the editable Word file. style_applied:font,font_size,colors,align,margins_cm,orientation,page_numbersand more.status:ready, orfailedwitherror.code. A failed document isn’t charged.
- 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
outputsexpire after 5 minutes;documents.outputs(id)gives you new ones.
FAQ
Do I have to maintain templates or print CSS?
Do I have to maintain templates or print CSS?
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.
Can I add images?
Can I add images?
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 .Can I get the PDF faster?
Can I get the PDF faster?
Yes, with
quality: "fast" (€0.05 from Markdown): about a minute instead of a few minutes. See
quality levels.style, see Style.