# markdown2pdf: Markdown to PDF

> markdown2pdf (Markdown to PDF) is a 1001fx API function in the group Files & PDF: POST https://api.1001fx.com/files/markdown2pdf, 5 credits per call. It works as a ready-made module in Make or as a plain HTTP call.

Turns Markdown (headings, lists, tables, code, images) into a styled PDF. Extra CSS, paper format, orientation and margins can be set.

- Group: Files & PDF
- Endpoint: `POST https://api.1001fx.com/files/markdown2pdf`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 5 credits per call
- Ready-made in: Make
- Docs: https://1001fx.com/functions/markdown2pdf

## Parameters

- `markdown` (string, required) – Markdown: Markdown text (GitHub flavored: tables, lists, code).
- `css` (string, optional) – CSS: Optional extra CSS, e.g. body{font-size:12pt}.
- `format` (enum, optional, one of `A3`, `A4`, `A5`, `Letter`, `Legal`, `Tabloid`, default `A4`) – Paper format: Default A4.
- `landscape` (boolean, optional, default `false`) – Landscape
- `margin` (string, optional, default `1cm`) – Margin: CSS length for all sides, e.g. 1cm (default), 10mm, 0.
- `printBackground` (boolean, optional, default `true`) – Print backgrounds: Background colors and images (default true).

## Example: Markdown to PDF

```bash
curl -X POST 'https://api.1001fx.com/files/markdown2pdf' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"markdown":"# Meeting notes\n\n- Budget approved\n- Launch on **15 November**\n\n| Task | Owner |\n|---|---|\n| Slides | Anna |"}'
```
