Markdown to PDF
Converts Markdown to a PDF on the server. The Markdown to PDF page on the site still runs in the browser.
POST /api/v1/tools/markdown-to-pdf
Cost: 5 credits per successful request, taken from your account balance and shared by every token. A failed request is not charged.
Options
| Field | Meaning |
|---|---|
markdown | Required. Markdown source. |
format | Page size. a4 or letter. Default a4. |
orientation | portrait or landscape. Default portrait. |
margin | Page margin in millimetres, from 0 to 50. Default 12. |
Example
curl -X POST https://wapgee.com/api/v1/tools/markdown-to-pdf \
-H "Authorization: Bearer wpg_your_token" \
-H "Content-Type: application/json" \
-o document.pdf \
-d '{"markdown":"# Hello\n\nThis is a PDF.","format":"a4","orientation":"portrait","margin":12}'Errors
| Status | When |
|---|---|
400 | The body is not valid JSON, or a field is missing or not an allowed value. |
413 | The document exceeds 1.5 MB or 40 pages, or the rendered PDF is too large. |
502 | PDF rendering is unavailable, or the PDF could not be rendered. |
503 | The service is busy. Retry shortly. |
504 | Rendering exceeded 20 seconds. |
429 | Insufficient credits (insufficient_credits), or the per-minute limit was exceeded (rate_limited). |