Convert HTML or Markdown (MD) to PDF easily using an API
994
Easily convert HTML or Markdown (MD) to PDF using an API
Download and installā Docker
šš» Start in developer mode:
pnpm dev
šš» Use with docker:
docker run --restart unless-stopped -dp 9000:3000 --name container-name blakegt/html-md-to-pdf-api:latest
Method POST /
Header Content-Type: text/plain
| Parameter | Type | Description | Example Values |
|---|---|---|---|
size | string | Defines the paper size for the output PDF. Available options include letter, legal, tabloid, a0, a1, a2, a3, a4, a5, a6. For more see https://pptr.dev/api/puppeteer.lowercasepaperformatā | a4, letter |
margin | number | Specifies the margin size (in millimeters) for the PDF document. | 10, 15, 20 |
output | string | Determines the format of the output. Can be either pdf (for file download) or base64 (for base64-encoded string). | pdf, base64 |
filename | string | The desired name for the output file (only applicable if output=pdf). | document.pdf |
download | number | Indicates whether the PDF should be downloaded automatically (1) or just generated (0). | 1, 0 |
curl --location 'http://localhost:3000?size=letter&margin=5&output=pdf&filename=document.pdf&download=0' \
--header 'Content-Type: text/plain' \
--data '<h1>Hello, World!</h1><p>This is an example HTML content for PDf conversion</p>'
Content type
Image
Digest
sha256:2a37f4351ā¦
Size
743.9 MB
Last updated
over 1 year ago
docker pull blakegt/html-md-to-pdf-api