Cloudflare · Integration
Cloudflare integration
At a glance
Section titled “At a glance”Use nextpdf/cloudflare to render Portable Document Format (PDF) files at the edge, store generated PDFs in R2, or validate application programming interface (API) requests at the package level before they reach a worker endpoint.
Section map
Section titled “Section map”| Page | Use it for |
|---|---|
| Overview | Package boundaries and supported workflows. |
| Install | Composer installation and Cloudflare prerequisites. |
| Quickstart | Your first edge-rendered PDF workflow. |
| Configuration | Worker, API protection, and R2 configuration keys. |
| API | Renderer, payload, response parser, API protection, R2 archive, and pinned transport APIs. |
| Developer guide | Edge lifecycle, request boundaries, local fallback, and extension points. |
| Production usage | Deployment and operations patterns. |
| Security and operations | Worker Uniform Resource Locator (URL) validation, size limits, pins, and R2 controls. |
| Troubleshooting | Common edge rendering and archive failures. |
Primary APIs
Section titled “Primary APIs”| Symbol | Role |
|---|---|
NextPDF\Cloudflare\CloudflareHtmlRenderer | Sends Hypertext Markup Language (HTML) rendering requests to a Cloudflare worker. |
NextPDF\Cloudflare\CloudflareRendererConfig | Immutable worker renderer configuration object. |
NextPDF\Cloudflare\ApiProtection | Request-size, client, and API-key gate. |
NextPDF\Cloudflare\R2ArchiveManager | Uploads generated PDF bytes and creates signed URLs. |
NextPDF\Cloudflare\Transport\PinnedCurlTransport | PHP Standard Recommendation (PSR)-18 transport with public-key pinning support. |