pdf-toolbox-document-0.1.2: A collection of tools for processing PDF files.
Safe HaskellNone
LanguageHaskell2010

Pdf.Document.Pdf

Synopsis

Documentation

data Pdf Source #

withPdfFile :: FilePath -> (Pdf -> IO a) -> IO a Source #

fromFile :: File -> IO Pdf Source #

Make Pdf with interface to pdf file

fromHandle :: Handle -> IO Pdf Source #

Make Pdf with seekable handle

fromBytes :: ByteString -> IO Pdf Source #

Make Pdf from a ByteString

document :: Pdf -> IO Document Source #

Get PDF document

lookupObject :: Pdf -> Ref -> IO Object Source #

Find object by it's reference

streamContent :: Pdf -> Ref -> Stream -> IO (InputStream ByteString) Source #

Get stream content, decoded and decrypted

Note: length of the content may differ from the raw one

rawStreamContent :: Pdf -> Ref -> Stream -> IO (InputStream ByteString) Source #

Get stream content without decoding it

isEncrypted :: Pdf -> IO Bool Source #

Whether the PDF document it encrypted

setUserPassword :: Pdf -> ByteString -> IO Bool Source #

Set the password to be user for decryption

Returns False when the password is wrong

defaultUserPassword :: ByteString #

The default user password

enableCache :: Pdf -> IO () Source #

Cache object for future lookups

disableCache :: Pdf -> IO () Source #

Don't cache object for future lookups