pdf-toolbox-document-0.0.4.0: A collection of tools for processing PDF files.

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.Document.Pdf

Description

Basic implementation of pdf monad

Synopsis

Documentation

type Pdf m = PdfE (Pdf' m) Source

Convenient type alias

data Pdf' m a Source

Basic implementation of pdf monad

Instances

MonadTrans Pdf' 
Monad m => Monad (Pdf' m) 
Functor m => Functor (Pdf' m) 
(Monad m, Functor m) => Applicative (Pdf' m) 
MonadIO m => MonadIO (Pdf' m) 
MonadIO m => MonadPdf (Pdf' m) 

runPdf :: MonadIO m => RIS -> [StreamFilter] -> Pdf m a -> m (Either PdfError a) Source

Execute PDF action with RIS

runPdfWithHandle :: MonadIO m => Handle -> [StreamFilter] -> Pdf m a -> m (Either PdfError a) Source

Execute PDF action with Handle

document :: MonadIO m => Pdf m Document Source

Get PDF document

flushObjectCache :: Monad m => Pdf m () Source

Remove all objects from cache

withoutObjectCache :: Monad m => Pdf m () -> Pdf m () Source

Perform action without adding objects to cache. Note: the existent cache is not flushed, and is used within the action

knownFilters :: [StreamFilter]

All stream filters implemented by the toolbox

Right now it contains only FlateDecode filter

isEncrypted :: MonadIO m => Pdf m Bool Source

Whether the PDF document it encrypted

setUserPassword :: MonadIO m => ByteString -> Pdf m Bool Source

Set the password to be user for decryption

Returns False when the password is wrong

defaultUserPassword :: ByteString Source

The default user password

decrypt :: MonadIO m => Ref -> Object a -> Pdf m (Object a) Source

Decrypt PDF object using user password is set

class Monad m => MonadIO m where

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIO :: IO a -> m a

Lift a computation from the IO monad.

Instances

MonadIO IO 
MonadIO (Generator r) 
MonadIO (Consumer c) 
MonadIO m => MonadIO (Pdf' m) 
MonadIO m => MonadIO (RandT g m) 
MonadIO m => MonadIO (EitherT e m) 
MonadIO m => MonadIO (StateT s m) 
(Error e, MonadIO m) => MonadIO (ErrorT e m)