惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
D
Docker
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
博客园 - 【当耐特】
N
Netflix TechBlog - Medium
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Recent Announcements
Recent Announcements
GbyAI
GbyAI
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
L
LangChain Blog
A
About on SuperTechFans
M
MIT News - Artificial intelligence
B
Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why PDF generation breaks in production (and why localhos...
Johin Johny · 2026-06-17 · via DEV Community
Cover image for Why PDF generation breaks in production (and why localhost lies)

Johin Johny

PDF generation is one of those things that works perfectly… until real users touch it.

On localhost:

npm run dev

Open Chrome → print → PDF.

Done.

Then production arrives.

A customer generates a 200-page report.

Finance exports 5,000 invoices at midnight.

A marketing team uploads a font your server has never seen.

Suddenly your "simple PDF endpoint" becomes the most fragile part of your stack.

The hidden problems nobody talks about

  1. Chromium is not a PDF library

Most HTML-to-PDF systems are secretly browser automation systems.

You are not calling:

HTML → PDF
You are calling:
HTML → Browser → Renderer → PDF
That means you inherit:

browser crashes
memory spikes
process cleanup
sandboxing problems
version updates

Your app does not need a browser.
It needs a document.

  1. Concurrency changes everything

A single PDF generation request?

Easy.

100 requests at the same time?

Now you need:

queues
workers
retries
timeouts
monitoring

The PDF code you wrote in 20 minutes becomes infrastructure you maintain forever.

  1. CSS is the real enemy

The HTML looks perfect in Chrome.
The PDF comes out broken.

Common issues:

tables split incorrectly
headers disappear
fonts fallback
images fail loading
page breaks happen randomly

Because printing is not the same as rendering a webpage.

  1. Security is overlooked

HTML rendering means executing a browser against user-controlled content.

A malicious document can try:

internal network requests
metadata endpoints
local file access

A PDF service needs isolation.

Not just a browser process.

The approach I took with PDFPipe

Instead of giving every developer another Puppeteer setup guide:

The goal is:

Your app
|
| HTML + data

PDFPipe
|

PDF

No Chromium servers.
No worker management.
No PDF infrastructure.

The same reason we use Stripe instead of running payment infrastructure ourselves.

The funny thing about PDF generation is:

Nobody notices when it works.

Everyone notices when it breaks.

That is exactly why I started building PDFPipe.

PDFPipe

Curious: what is your current PDF stack?

Puppeteer? Playwright? wkhtmltopdf? Something older?