Render PDF invoices from HTML without Chromium in your backend

Tired of bundling Chromium just to generate PDF invoices? SnapPDF lets you send a URL and get back a PDF instantly. No heavy dependencies. Perfect for

miércoles, 29 de julio de 2026 • 3 min read • Q2BSTUDIO Team

Convierte tu plantilla HTML en PDF con una sola API

When a development team needs to generate PDF invoices from HTML templates, the first thought is often to install Puppeteer, Playwright, or some tool that bundles a full Chromium. It’s a known solution, but it comes with a heavy backpack: container size balloons, serverless functions exceed packaging limits, and you end up managing fonts, shared libraries, and security patches. The hard part isn’t converting HTML to PDF; it’s keeping a browser inside your infrastructure.

Alternatives like wkhtmltopdf have fallen behind modern CSS standards, and cloud services that offer Chromium rendering often require complex integrations with SDKs, job queues, and polling. However, there is a lighter approach that many companies overlook: send a public URL to a dedicated endpoint that returns the PDF ready to store or send. No installation, no browser maintenance, no memory quotas exceeded.

This model fits perfectly into modern architectures where business logic is separated from heavy processing. For example, when an invoice moves to 'finalized' status, the system can generate a short-lived signed URL pointing to the HTML view already shown to the customer. That URL is sent to an external rendering service, and the resulting PDF bytes are written directly to an Amazon S3 bucket or Azure Blob Storage. The PDF becomes a cached artifact without repeating the render on every download.

For teams building custom software, this simplification means real savings in infrastructure costs and development time. At Q2BSTUDIO, we have seen how e-invoicing projects, supplier portals, and e-commerce platforms benefit from not having to manage a Chromium per instance. Moreover, by outsourcing rendering, the team can focus on business logic, integration with accounting systems, and user experience.

Security also improves with this approach. The rendering service only accepts public addresses and rejects private or local IPs, avoiding internal exposures. Short-lived signed URLs with 60-second expiration can be used, limiting the attack window. And because the PDF is generated on demand, no sensitive data is stored in the rendering engine. At Q2BSTUDIO, we integrate these practices into our cloud AWS/Azure developments, where security is a pillar alongside efficiency.

Of course, the invoice HTML must be reachable from the internet. In development, you can use a tunnel like ngrok; in production, a short-lived signed URL with a JWT token is enough. The endpoint accepts optional parameters like format (A4, Letter, Legal), landscape orientation, scale (0.1 to 2.0), and a CSS selector to wait for a specific element to appear before generating the PDF. This last option helps ensure that totals or dynamic tables have loaded.

A detail often overlooked is background color. Chromium, by default, drops background colors when printing, turning a table header with a blue background into white on white. Activating the 'background=true' parameter preserves the original CSS design. Also, check that the resulting PDF starts with '%PDF-'; if not, the HTML likely returned a login page or an error.

This approach is especially relevant when integrating with Business Intelligence or Power BI systems. Imagine a dashboard showing unpaid invoices: clicking an alert automatically generates the PDF with details and sends it by email. You don’t need a Chromium container running 24/7; just an HTTP call to an external service. At Q2BSTUDIO, we apply this architecture in projects that combine BI / Power BI with process automation, reducing latency and operational costs.

Artificial intelligence also finds its place here. AI agents can validate invoice data before PDF generation, detect anomalies, or even suggest personalized templates based on the customer. And with everything integrated in the cloud, scalability is immediate. Whether you need to generate 10 or 10,000 PDFs per hour, the rendering service scales transparently.

In summary, generating PDF invoices from HTML without installing Chromium on your server is not only possible but a smart technical decision. It reduces operational complexity, improves security, and allows teams to focus on what truly adds value. If your company is developing an invoicing system or any other solution requiring document conversion, consider this lightweight model. At Q2BSTUDIO, we offer consulting and custom software development to implement such architectures, combining cloud, cybersecurity, artificial intelligence, and automation. Technology advances, but sometimes the best solution isn’t to add more components—it’s to remove the ones you don’t need.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.