
How to Sign PDFs in the Browser Without Uploading Anything
Most free PDF signing tools have the same problem: they upload your document to a third-party server, process it there, and hand it back. For a random form that's fine. For a client contract or an NDA, it's not. Here's how we built an eSign tool where the PDF never leaves the browser — and what we learned doing it. The Core Idea The entire signing flow runs client-side using pdf-lib : User opens a PDF → read as ArrayBuffer in the browser User draws a signature on a <canvas> element Signature canvas is exported as a PNG data URL pdf-lib embeds the PNG onto the correct page at the correct coordinates Output PDF is downloaded via URL.createObjectURL — no server involved const { PDFDocument , degrees } = await import ( ' pdf-lib ' ); const srcDoc = await PDFDocument . load ( rawPdfBytes ); const outDoc = await PDFDocument . create (); // Copy pages preserving rotation const copied = await outDoc . copyPages ( srcDoc , pageIndices ); copied . forEach ( page => outDoc . addPage ( page )); //
Continue reading on Dev.to Webdev
Opens in a new tab
