pdfinfo-1.5.4: Wrapper around the pdfinfo command.

Safe HaskellNone
LanguageHaskell98

Text.PDF.Info

Contents

Synopsis

Reading PDF info

pdfInfo :: MonadIO m => FilePath -> m (Either PDFInfoError PDFInfo) #

Run pdfinfo on the given file. Handles IO exceptions to do with running the process.

data PDFInfo #

A type representing the output from the pdfinfo command.

Constructors

PDFInfo 

Fields

Instances
Show PDFInfo # 
Instance details

Defined in Text.PDF.Info

data PDFSize #

Size of the PDF in pts.

Constructors

PDFSize 

Fields

Instances
Eq PDFSize # 
Instance details

Defined in Text.PDF.Info

Methods

(==) :: PDFSize -> PDFSize -> Bool #

(/=) :: PDFSize -> PDFSize -> Bool #

Show PDFSize # 
Instance details

Defined in Text.PDF.Info

data PDFEncryptionInfo #

Encryption and restricted permissions

Constructors

PDFNoEncryption

Not encrypted

PDFEncryption

Encrypted with possible permission restrictions

Fields

data PDFInfoError #

Possible things that can go wrong while reading the info.

Constructors

ParseError !String

Couldn't parse a property value.

ProcessFailure !Text

Process exited with this stderr.

ProcessError !IOException

Error to do with the pdfinfo process.

NoMessage

No message given.

SomeError String

Some nonspecific error.

Internals

data ParsePDFInfo a #

Instances
Monad ParsePDFInfo # 
Instance details

Defined in Text.PDF.Info

Functor ParsePDFInfo # 
Instance details

Defined in Text.PDF.Info

Methods

fmap :: (a -> b) -> ParsePDFInfo a -> ParsePDFInfo b #

(<$) :: a -> ParsePDFInfo b -> ParsePDFInfo a #

Applicative ParsePDFInfo # 
Instance details

Defined in Text.PDF.Info

MonadError PDFInfoError ParsePDFInfo # 
Instance details

Defined in Text.PDF.Info

parse :: Text -> Either PDFInfoError PDFInfo #

Parse PDFInfo's output.

parseSize :: Text -> ParsePDFInfo PDFSize #

Parse a page size. This is loosely defined.

parseDate :: Text -> ParsePDFInfo UTCTime #

Parse a date according to pdfinfo's format.

parseEncrypted :: Text -> ParsePDFInfo PDFEncryptionInfo #

Parse encryption information according to pdfinfo's format.

readRight :: (MonadError PDFInfoError m, Read a) => Text -> m a #

Read a value, maybe, allow misc trailing data.