pdf-toolbox-document-0.0.7.1: 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) #

Convenient type alias

data Pdf' m a #

Basic implementation of pdf monad

Instances

MonadTrans Pdf' # 

Methods

lift :: Monad m => m a -> Pdf' m a #

Monad m => Monad (Pdf' m) # 

Methods

(>>=) :: Pdf' m a -> (a -> Pdf' m b) -> Pdf' m b #

(>>) :: Pdf' m a -> Pdf' m b -> Pdf' m b #

return :: a -> Pdf' m a #

fail :: String -> Pdf' m a #

Functor m => Functor (Pdf' m) # 

Methods

fmap :: (a -> b) -> Pdf' m a -> Pdf' m b #

(<$) :: a -> Pdf' m b -> Pdf' m a #

Monad m => Applicative (Pdf' m) # 

Methods

pure :: a -> Pdf' m a #

(<*>) :: Pdf' m (a -> b) -> Pdf' m a -> Pdf' m b #

(*>) :: Pdf' m a -> Pdf' m b -> Pdf' m b #

(<*) :: Pdf' m a -> Pdf' m b -> Pdf' m a #

MonadIO m => MonadIO (Pdf' m) # 

Methods

liftIO :: IO a -> Pdf' m a #

MonadIO m => MonadPdf (Pdf' m) # 

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

Execute PDF action with RIS

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

Execute PDF action with Handle

document :: MonadIO m => Pdf m Document #

Get PDF document

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

Remove all objects from cache

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

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 #

Whether the PDF document it encrypted

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

Set the password to be user for decryption

Returns False when the password is wrong

defaultUserPassword :: ByteString #

The default user password

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

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:

Minimal complete definition

liftIO

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances

MonadIO IO 

Methods

liftIO :: IO a -> IO a #

MonadIO m => MonadIO (MaybeT m) 

Methods

liftIO :: IO a -> MaybeT m a #

MonadIO (Generator r) 

Methods

liftIO :: IO a -> Generator r a #

MonadIO (Consumer c) 

Methods

liftIO :: IO a -> Consumer c a #

MonadIO m => MonadIO (ListT m) 

Methods

liftIO :: IO a -> ListT m a #

MonadIO m => MonadIO (Pdf' m) # 

Methods

liftIO :: IO a -> Pdf' m a #

MonadIO m => MonadIO (ExceptT e m) 

Methods

liftIO :: IO a -> ExceptT e m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

MonadIO m => MonadIO (IdentityT * m) 

Methods

liftIO :: IO a -> IdentityT * m a #

MonadIO m => MonadIO (ReaderT * r m) 

Methods

liftIO :: IO a -> ReaderT * r m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #