Merging PDF files sounds like a trivial Sunday afternoon project. Grab file A, grab file B, glue them together, download. How hard could it be? If you've ever inspected what popular libraries actually do—or worse, tried to write a parser yourself—you know that PDF is not a stream of formatted text. It’s a 30-year-old PostScript-derived, semi-random-access object graph masquerading as a document format. Let's walk through what actually happens when you merge two PDF files, why naive approac...