Back to KB
Difficulty
Intermediate
Read Time
4 min

A few months ago I got tired of paying $29/month to a PDF SaaS for the ~3,000 invoices my side proje

By Codcompass TeamΒ·Β·4 min read

HTML2DocHub: Pay-Per-Page PDF Generation Architecture & SDKs

Current Situation Analysis

Traditional PDF generation SaaS platforms rely on rigid tiered subscriptions that misalign with variable workload patterns. At ~$29/month for ~3,000 rendered invoices, the effective cost per document balloons to roughly 10Γ— the actual compute/render expense. This pricing model forces teams to either overpay during low-usage periods or hit hard caps during traffic spikes, with no linear scaling path.

Failure modes compound when rendering jobs are embedded in at-least-once queue systems (Celery, BullMQ, Sidekiq). Without idempotency guarantees, network retries or worker restarts trigger duplicate renders, resulting in double-billing. Additionally, legacy rendering engines (wkhtmltopdf, WeasyPrint) lack native support for modern CSS specifications (flexbox gaps, CSS grid, custom properties, web fonts, dark mode), forcing developers to maintain fragile workarounds or accept broken layouts. Finally, monolithic SDK distributions often bundle Chromium binaries or require 200MB+ Lambda layers, inflating deployment size, cold start times, and maintenance overhead across ARM/x86 architectures.

WOW Moment: Key Findings

ApproachCost per 10k PagesModern CSS/Layout SupportDeployment Footprint
Tiered SaaS Subscription~$29.00 (fixed)High (proprietary engine)N/A (managed)
Legacy CLI (wkhtmltopdf/WeasyPrint)~$0.00 (self-hosted)Low (~40-60% CSS3 compliance)~150-250 MB (binary + deps)
HTML2DocHub (Pay-per-page + Playwright)~$10.00 ($0.001/page)High (~98% CSS3/HTML5 compliance)~14.8 KB (pure HTTPS wrapper)

Key Findings:

  • Sweet Spot: Pay-per-page bil

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back