Documents

Convert Markdown to a styled PDF

Converts Markdown straight to a PDF (Markdown to HTML, then the same headless-browser rendering as /pdf), with a clean default typography built in.

Costs 1 credit per call.

post/markdown-to-pdf

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/markdown-to-pdf
  • Auth: API key in header x-api-key

Request body

markdownstring required

The Markdown text to turn into a PDF (CommonMark plus GitHub-style tables and strikethrough), up to 2 MB.

format'A4' | 'A3' | 'A5' | 'Letter' | 'Legal' | 'Tabloid'

Paper size: "A4" (default), "A3", "A5", "Letter", "Legal" or "Tabloid".

landscapeboolean

true = landscape page, false (default) = portrait.

print_backgroundboolean

true (default) = print background colors and images, including the grey shading behind code; false = leave them out.

scalenumber

Content scale factor (0.1-2). Default 1; use a value below 1 to fit more on each page.

margininteger

Millimeters, same on all 4 sides.

output'json' | 'pdf' | 'url'

How to return the PDF: "json" (base64 in the JSON response), "pdf" (the PDF itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, pdf when the Markdown was sent as raw text.

Response

Result.

successboolean
pdfstring byte
mime_typestring

Changes

No recorded changes to this operation across all 1 revision of this API.