How I Built an In-Browser, Zero-Upload PDF Merger & Converter Using WebAssembly and Canvas
说明与用途
使用 WebAssembly 和 pdf‑lib 构建的客户端 PDF 合并工具,完全不需要上传文件。
问题
Online PDF utilities force users to upload sensitive documents to remote servers, imposing file size limits, subscription fees, and privacy risks.
结果
The implementation allows users to merge PDFs entirely in the browser, avoiding uploads and associated costs while preserving privacy.
工作流
- 1. User selects PDF files in the browser
- 2. Files are read as ArrayBuffers
- 3. pdf‑lib loads each PDF into memory
- 4. Pages are copied and appended to a new PDFDocument
- 5. The merged PDF is saved to a Blob and a download URL is generated
- 6. User downloads the merged PDF locally
证据
Whenever you search for a simple utility like "Merge PDF" or "Convert WebP to PNG", you are usually greeted by the same frustrating experience: 1. A 15MB file upload limit behind an aggressive paywall. 2. A subscription pop‑up asking for $12/month. 3. Your sensitive personal documents (tax returns, signed contracts, medical records) getting uploaded to an untrusted remote server.
There is zero technical justification for uploading a document to a cloud server just to merge two pages or change an image format.
We can load the document structure directly into browser memory using pdf‑lib:
- 记录日期: 2026-10-07T23:40:55.580Z