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

推荐订阅源

V
Visual Studio Blog
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
博客园_首页
T
Tailwind CSS Blog
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
S
SegmentFault 最新的问题
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Jina AI
Jina AI
WordPress大学
WordPress大学
U
Unit 42
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare 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
I shipped a website-to-PDF SaaS on WordPress — here's the...
PetrDev · 2026-05-05 · via DEV Community

Last month I launched Site2PDF — converts any website to PDF, PNG, JPG or ZIP. Here's the entire tech stack, because the choices might be useful if you're building something similar.

What it does

Paste a URL → get a PDF of the whole page (or the whole site). Free plan gives 5 archives/month, all formats, cookie banner removal. Paid starts at $9/mo for 15 archives and 200 pages per site.

The stack

Frontend: a custom WordPress theme. Yes, WordPress. Hear me out.

  • Native user accounts, sessions, roles
  • Native admin panel for analytics and user management
  • Customizer for site branding
  • Gutenberg-free, just PHP templates + SCSS + vanilla JS

Rendering: Node.js + Puppeteer running on the same VPS, called from PHP via proc_open. A bash-like pattern:

$command = sprintf(
    '%s %s %s %s --options-file %s',
    escapeshellarg($node_path),
    escapeshellarg($script),
    escapeshellarg($url),
    escapeshellarg($output),
    escapeshellarg($options_json)
);
exec($command . ' 2>&1', $output, $code);

Enter fullscreen mode Exit fullscreen mode

PHP passes options (cookie hide, selectors to expand, etc.) as a temp JSON file the Node script reads.

PDF assembly: pdf-lib for multi-page PDFs (each page becomes its own PDF page). DOMPDF for single-page fallback.

Image processing: sharp for PNG→JPG conversion. archiver for ZIP.

Billing: Paddle Billing (started with Stripe, had to migrate — Stripe doesn't support my country). Paddle handles tax, EU VAT, Canadian GST etc. — a huge win for a solo founder.

Auth: Google OAuth 2.0 without any plugin. A REST API endpoint redirects to Google, callback sets a one-time login token, cookie is set on the next regular page load. Why? Because iOS Safari blocks cookies set during REST API redirects (ITP).

Infra: Contabo VPS ($5/mo). Nginx, PHP-FPM, MariaDB. Chrome installed as google-chrome-stable, Puppeteer launches it with executablePath override.

Why WordPress (not Next.js or Rails)

The honest answer: I've shipped WP for 10 years. Familiar tools win. The theme is under 4000 lines of PHP, ~2000 lines of SCSS. I didn't need a full framework for ~5 pages and a wizard UI.

WordPress also gives me:

  • Zero-effort admin for users, plans, payment history
  • Free page hierarchy (/pdf-tools/full-page-screenshot/)
  • Built-in Yoast SEO and Site Icon features

The hot take: WordPress is a perfectly fine backend for a simple SaaS if you disable the bloat and write real code. Most of the "WordPress is slow" complaints come from bloated themes and 40 plugins.

Things that bit me

  1. Puppeteer fullPage + fixed headers — writeup in my other post
  2. Cookie banners blocking the screenshot — had to intercept requests to policy.cookiereports.com before page load
  3. iOS Safari OAuth — first attempt set the auth cookie inside the callback redirect. Safari's ITP killed it. Had to use one-time tokens + set cookie on a regular page navigation.
  4. iCloud Private Relay breaking CSRF state — used IP hash as the state key, which broke when Apple rotates IPs between redirects. Switched to state-as-key.
  5. Paddle sandbox vs production — separate accounts, separate keys, separate price IDs. Wrote a helper that picks the right IDs based on WEBTOOLS_PADDLE_ENV constant.

The architecture in one diagram

Browser (vanilla JS)
  → AJAX → PHP (screenshot-tools.php)
          → proc_open → Node worker (Puppeteer)
          → writes PNG to /uploads/screenshot-temp/
          → PHP assembles PDF/ZIP if needed
          → returns base64 or job ID
  ← polls status / downloads blob

Enter fullscreen mode Exit fullscreen mode

Full-site mode uses a different flow (background worker + status polling). Single-page mode is one synchronous AJAX call.

What's next

  • Real API (the pricing page still says "API — Soon")
  • Subscription cancel button in-app (currently "email us")
  • Blog with the 2-3 dev.to posts ported over for SEO

Try it

site2pdf.online. Free plan doesn't need signup. If you try it and something breaks, the Contact form works.

Happy to answer any questions about the stack in the comments.