A web service for converting markdown to PDF
For quick experimentation, you can use the web version hosted on Fly.io. Just paste your markdown and download the converted PDF.
Availability of the service is not guaranteed, see Fly.io status when it is down. If you need guaranteed availability, deploy it yourself.
You can convert markdown by sending a POST
request to https://md-to-pdf.fly.dev
.
curl --data-urlencode 'markdown=# Heading 1' --output md-to-pdf.pdf https://md-to-pdf.fly.dev
Parameter | Required | Description |
---|---|---|
markdown |
Required | The markdown content to convert |
css |
Optional | CSS styles to apply |
engine |
Optional | The PDF conversion engine, can be weasyprint , wkhtmltopdf or pdflatex , defaults to weasyprint |
Send data from files like this:
curl --data-urlencode "markdown=$(cat example.md)"
A prebuilt container image is available at Docker Hub. The container starts up the web service and listens for HTTP on port 8000.
You can run it yourself like this:
docker run --publish=8000:8000 spawnia/md-to-pdf
You may configure the webserver through Rocket environment variables. For example, you could allow larger payloads by increasing the limit for form data:
ROCKET_LIMITS={form="1MiB"}