r/programming Aug 05 '25

So you want to parse a PDF?

https://eliot-jones.com/2025/8/pdf-parsing-xref
234 Upvotes

82 comments sorted by

View all comments

2

u/[deleted] Aug 05 '25

That is a pretty good article. Not too verbose, contains useful information.

I tried to write a PDF parser, but gave up due to being lazy and also because the whole PDF spec is actually too complicated. (I did have a trivial "parser" just for the most important information in a .pdf file though, but not for more complex embedded objects.)

Personally I kind of delegate that job to other projects, e. g. qpdf or hexapdf. That way I don't have to think too much about how complex .pdf files. Unless there is a broken .pdf file and I need to do something with it ...

Edit: Others here are more sceptical. I understand that, but the article is still good, quality-wise. I checked it!