Skip to content
getnextpdf.com

Why we build on Cloudflare

The nextpdf/cloudflare package lets NextPDF render PDFs at the edge, archive generated files to R2, and gate API requests before they reach a worker. The other pages in this section cover exactly how. This one is different: it is the short, honest reason we were excited to build it at all — and a thank-you.

We will just say it plainly: the NextPDF team loves building on Cloudflare. It is a platform we reach for happily, and its genuinely generous free tier is a large part of why. That generosity is not incidental to us — it is what lets a small team put more back into the open-source community than we otherwise could: more of the engine kept open, more time spent on the parts everyone benefits from, and fewer decisions driven by the cost of infrastructure rather than the good of the project. When a platform lowers the floor like that, the work above it gets to be more ambitious.

This is the part we are genuinely excited to share, because we think it opens doors. With NextPDF on Cloudflare, your PHP application holds the HTML and a Cloudflare Worker holds the headless browser: the bridge sends the markup out and gets rendered PDF bytes back, so no headless Chromium has to run inside your PHP process at all. From there you can archive the generated files to R2 and hand back signed URLs, and gate incoming API requests at the package level before they ever reach your worker.

It is a small package doing a focused job well, and we built it carefully. But the reason we could not wait to put it in your hands is not the code — it is the question behind it: when a PDF engine this capable meets a platform this capable, what deeper, wider, more interesting things do people build? We do not think we have imagined all of them. That is rather the point. Start at the overview or the quickstart and see where it takes you.

Sending HTML out of your process to be rendered elsewhere is a trust boundary, and we treated it like one. The bridge validates where a request is allowed to go before it sends anything, in the spirit of the OWASP guidance on server-side request forgery, and its transport can pin the exact public key it expects to see (RFC 7469). The details — URL validation, size limits, pinning, and R2 controls — live in Cloudflare security and operations.

Plainly, then: thank you. A generous free tier and a dependable platform made it easier for us to keep NextPDF open, and easier for the developers reading this to try something ambitious without the bill deciding it first.

This documentation site is itself served on Cloudflare — so if you are reading it now, you are seeing that in practice.


Cloudflare, and related product names such as Cloudflare Workers and R2, are trademarks of Cloudflare, Inc., used here only to describe how NextPDF interoperates with the platform. NextPDF is an independent project with no corporate affiliation to Cloudflare, Inc., and is not endorsed or sponsored by Cloudflare.