Here's a neat hack I made recently to do basic PDF editing directly in a browser—without having to upload anything to a server.<p>I was initially looking for a way to do simple PDF modification (extracting pages, merging, and adding page numbers). There are some good server-side tools for this (QPDF, PDFTk, PDFBox, iText, Hummus), but for better speed and privacy I really wanted a 100% client-side solution.<p>There are a few good JavaScript PDF libraries for reading and displaying PDFs (pdf.js) and creating PDFs from scratch (jsPDF, PDFKit), but I couldn't find any for editing existing PDFs. So, I did what any self-respecting hacker would do, and rolled my own. :-)<p>Actually, I found out that Mozilla's pdf.js solved half the problem, as it does an excellent job disassembling PDF files. So all I had to do was figure out a way to put them back together again.<p>The result is PDF Assembler, now available on GitHub and NPM. I also put together a demonstration site (<a href="https://www.pdfcircus.com" rel="nofollow">https://www.pdfcircus.com</a>) which shows some examples of what it can do. I know PDF Assembler still needs some tweaking, but I think the basic idea is sound, and so far I've been pretty happy with how it works.<p>Please take a look and let me know what you think.<p>Thanks!<p>PDF Assembler Links:<p>Demonstration Site - <a href="https://www.pdfcircus.com" rel="nofollow">https://www.pdfcircus.com</a><p>GitHub - <a href="https://github.com/DevelopingMagic/pdfassembler" rel="nofollow">https://github.com/DevelopingMagic/pdfassembler</a><p>NPM - <a href="https://www.npmjs.com/package/pdfassembler" rel="nofollow">https://www.npmjs.com/package/pdfassembler</a>
Awesome! I will totally use this. Love that I don't need to upload them to some unknown server. Although macOS preview lets you merge PDFs by dragging and dropping, but not more complex editing.
> <i>There are some good server-side tools for this (QPDF, PDFTk, PDFBox, iText, Hummus)</i><p>Fake news! QPDF[0] can work offline on local PC - just download AppImage and execute it on your Linux desktop!<p>> <i>but for better speed and privacy I really wanted a 100% client-side solution.</i><p>Think, you mean "offline solution", because "client-side solution" is always mean that is part of some "online service".<p>[0] <a href="https://github.com/qpdf/qpdf/releases" rel="nofollow">https://github.com/qpdf/qpdf/releases</a>