Haskell: parsing PDF

haskell, pdf

Solution

There are a few tools for PDF manipulation, though they seem to bias towards generation, rather than parsing:

- http://johnmacfarlane.net/pandoc/

Pandoc is a great cross-markup library, but doesn't support PDF parsing (it does support PDF generation from a variety of formats).

There's also:

- http://hackage.haskell.org/package/HsHaruPDF

- http://hackage.haskell.org/package/pdf2line -- tool for extracting text from pdf

- http://hackage.haskell.org/package/HPDF -- another pdf generation library

I'm not sure we have a good parsing tool yet.

Problem

What I need is to read pdf, make some transformations (generate TOC bookmarks) and write it back. I found this http://hackage.haskell.org/package/HPDF , but it only mentions generating pdf, not the parsing (although I could have missed it) Haskell is chosen purely for (self)educational purposes.

Original source