Rust markdown to pdf converter
439
A REST API service that converts Markdown text to PDF documents.
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install wkhtmltopdf (required for PDF generation):
brew install wkhtmltopdf
sudo apt-get install wkhtmltopdf
cargo run
http://0.0.0.0:8080docker compose up --build
http://localhost:8080All endpoints support CORS and allow:
Endpoint: GET /health
Response:
{
"status": "healthy",
"version": "1.0.0"
}
The health check verifies that the service and its dependencies (wkhtmltopdf) are working properly. Possible status responses:
200 OK with "healthy" status if everything is working503 Service Unavailable with "unhealthy" status if wkhtmltopdf is not availableEndpoint: POST /convert
Request Body:
{
"markdown": "# Your Markdown Text\n\nThis is a paragraph."
}
Response:
Example using curl:
# Basic usage - saves output as document.pdf
curl -X POST http://localhost:8080/convert \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is a test."}' \
--output document.pdf
# Convert README.md to PDF
curl -X POST http://localhost:8080/convert \
-H "Content-Type: application/json" \
-d "{\"markdown\": $(cat README.md | jq -Rs .)}" \
--output readme.pdf
The API will return:
200 OK with the PDF data on success500 Internal Server Error if PDF generation failsMIT
2025
Content type
Image
Digest
sha256:f2b5ee771…
Size
150.1 MB
Last updated
over 1 year ago
docker pull arkaydeus/rust-md-to-pdf