Sign inSign up

spawnia/md-to-pdf

By spawnia

•Updated about 1 month ago

A web service for converting markdown to PDF

Image
Web servers
2

10K+

spawnia/md-to-pdf repository overview

⁠md-to-pdf

A web service for converting markdown to PDF

⁠Web UI

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⁠.

⁠API

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
ParameterRequiredDescription
markdownRequiredThe markdown content to convert
cssOptionalCSS styles to apply
engineOptionalThe 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)" 

⁠Deploy

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"}

⁠Built with

Tag summary

Content type

Image

Digest

sha256:2f6146f94…

Size

256.7 MB

Last updated

3 months ago

docker pull spawnia/md-to-pdf