Bless the heart of whoever looked at the PDF spec and said to themselves, "Nice, I'd like to writer a parser for this."
In fairness, I didn't write the PDF rendering. That is indeed quite a tall order.
I used to use poppler and switched to mupdf (was more active at the time, poppler seems to have picked up pace since).
The core PDF feature set isn't that bad to implement.
From what I've seen, the bad / complex parts are:
- stuff they added years later, like some XML stuff (of course you had to add XML in 2000!), JavaScript in forms
- some more complex vector graphics features like masking with vectors, support for bunch of color spaces, cmyk separation
- font handling, text rendering is surprisingly complex
- rendering fast even if PDF was badly created
- PDF is easy to screw up when you create it and boy, do people screw up in every imaginable way. You can't just say "it's bad PDF" when Adobe or Chrome opens it so a lot of effort by mupdf devs is adding heuristics to show even broken PDF docs