@hackage pdftotext0.0.2.0

Extracts text from PDF using poppler

  • Installation

  • Dependencies (4)

  • Dependents (0)

  • Package Flags

      xml-conduit
       (off by default)

      Parse metadata of PDF document properties using xml-conduit

pdftotext

The pdftotext package provides functions for extraction of plain text from PDF documents. It uses C++ library Poppler, which is required to be installed in the system. Output of Haskell pdftotext library is identical to output of Poppler's tool pdftotext.

Usage

import qualified Data.Text.IO as T
import Pdftotext

main :: IO ()
main = do
  Just pdf <- openFile "path/to/file.pdf"
  T.putStrLn $ pdftotext Physical pdf

Flags

xml-conduit

pdftotext can extract properties from PDF document. One of them is metadata which is in form of XML document. If xml-conduit flag is set then the metadata is parsed using xml-conduit package, otherwise provided as text.

Internals

The library uses poppler via FFI, therefore internally all functions are of type IO. However, their non-IO variants (using unsafePerformIO) should be safe to use. Module Pdftotext.Internal exposes all IO-typed functions.

Contribute

Project is hosted at https://sr.ht/~geyaeb/haskell-pdftotext/ . The homepage provides links to Mercurial repository, mailing list and ticket tracker.

Patches, suggestions, questions and general discussions can be send to the mailing list. Detailed information about sending patches by email can be found at [https://man.sr.ht/hg.sr.ht/email.md](https://man.sr.ht/hg.sr.ht/email.md).