Comparison
WeasyPrint alternative for dynamic HTML to PDF
WeasyPrint is a well respected Python library for turning HTML and CSS into PDFs. It shines for static, print oriented documents like invoices and reports. It does not run JavaScript, however, and its CSS support is partial. PDFPipe is a hosted alternative that renders pages in a real browser, so anything dynamic just works, with no install and no system dependencies.
What WeasyPrint does well
WeasyPrint is open source, free, and produces clean, accessible PDFs. Its rendering engine is purpose built for paged media, so it handles features like running headers, footers, page counters, and CSS @page rules with care. If your documents are server generated HTML with hand written CSS, WeasyPrint is an excellent and inexpensive choice.
Where it falls short
The key limitation is that WeasyPrint has no JavaScript engine. Charts drawn with Chart.js or D3, content hydrated by React or Vue, web fonts loaded at runtime, and layouts that depend on Flexbox or Grid edge cases can all render differently than they do in a browser. You also have to install WeasyPrint and its native libraries (Pango, Cairo, and GDK PixBuf) on every machine and in every container, which adds friction to deployment.
WeasyPrint vs PDFPipe
| Capability | WeasyPrint | PDFPipe |
|---|---|---|
| JavaScript execution | No | Yes (full browser engine) |
| CSS support | Partial, print focused | Full browser CSS |
| Install and system deps | Pip plus native libs | None (hosted API) |
| Hosting | Self hosted | Managed |
| Cost | Free, open source | Usage based pricing |
| Best for | Static print documents | Dynamic, JS driven pages |
How to choose
If your HTML is fully rendered on the server and you are comfortable managing the native dependencies, WeasyPrint is a solid, cost free pick. Reach for PDFPipe when you need JavaScript to run before capture, when you want pixel accurate browser rendering, or when you simply do not want to install and patch a rendering stack across your environments.
Calling PDFPipe
Send a POST request to /v1/pdf with your HTML and options. The response is raw application/pdf bytes that you can stream or write to disk. Here is the same flow you would replace WeasyPrint with, in Python.
import requests
resp = requests.post(
"https://api.pdfpipe.xyz/v1/pdf",
headers={"Authorization": "Bearer pp_live_your_key"},
json={
"html": "<h1>Hello from PDFPipe</h1>",
"options": {"format": "A4"},
},
)
resp.raise_for_status()
with open("out.pdf", "wb") as f:
f.write(resp.content)The body shape is identical from any language. Here is the same request with curl.
curl -X POST https://api.pdfpipe.xyz/v1/pdf \
-H "Authorization: Bearer pp_live_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello from PDFPipe</h1>","options":{"format":"A4"}}' \
-o out.pdfBecause PDFPipe drives a real browser, your charts, web fonts, and client rendered components appear in the PDF exactly as they do on screen, with no extra build step.
Paste your own HTML into the live playground to see browser accurate output instantly, then read the docs for the full options reference.
See pricing →