A lawyer friend messaged me at 11 PM last week. He'd sent a 47-page contract to a client. Client signed it, sent it back. Everything looked good until my friend noticed page 12 had a typo in the payment terms — the kind of typo that, if a court ever looked at it, could mean the client owed nothing.
"Do I have to make him resign the whole thing? It took us three weeks to get this signed."
Technically no. You just replace page 12 of the signed PDF. The signatures on the other pages stay intact. Five seconds of pdf-lib code.
This post is the technical writeup. By the end you'll have working browser-side JavaScript that replaces any single page in a PDF with a page from another PDF, no server roundtrip, no system dependencies, no Ghostscript install. Plus the gotchas that aren't obvious until you ship and someone reports a bug.
If you just want the no-code version: we built a free tool for it — upload original, pick page, upload replacement, download. Otherwise, keep reading.








