-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Wrapper around the pdfinfo command. -- -- Just a wrapper around the pdfinfo command. See man pdfinfo. @package pdfinfo @version 0.1 module Text.PDF.Info -- | Run pdfinfo on the given file. Handles IO exceptions to do with -- running the process. pdfInfo :: MonadIO m => FilePath -> m (Either PDFInfoError PDFInfo) -- | A type representing the output from the pdfinfo command. data PDFInfo PDFInfo :: Maybe String -> Maybe String -> Maybe String -> Maybe UTCTime -> Maybe UTCTime -> Maybe Bool -> Maybe Integer -> Maybe Bool -> Maybe PDFSize -> Maybe Integer -> Maybe Bool -> Maybe Double -> PDFInfo -- | Author: E.g. Chris Done pdfInfoAuthor :: PDFInfo -> Maybe String -- | Creator: E.g. Microsoft Office Word 2007 pdfInfoCreator :: PDFInfo -> Maybe String -- | Producer: E.g. Microsoft Office Word 2007 pdfInfoProducer :: PDFInfo -> Maybe String -- | Creation Date pdfInfoCreationDate :: PDFInfo -> Maybe UTCTime -- | Modification Date pdfInfoModDate :: PDFInfo -> Maybe UTCTime -- | Tagged? pdfInfoTagged :: PDFInfo -> Maybe Bool -- | Pages: E.g. 238 pdfInfoPages :: PDFInfo -> Maybe Integer -- | Encrypted? pdfInfoEncrypted :: PDFInfo -> Maybe Bool -- | Page: E.g. 595.32 x 841.92 pts (A4) pdfInfoPageSize :: PDFInfo -> Maybe PDFSize -- | File: E.g. 4061737 bytes pdfInfoFileSize :: PDFInfo -> Maybe Integer -- | Optimized? pdfInfoOptimized :: PDFInfo -> Maybe Bool -- | PDF: E.g. 1.5 pdfInfoPDFVersion :: PDFInfo -> Maybe Double -- | Size of the PDF in pts. data PDFSize PDFSize :: Float -> Float -> PDFSize pdfSizeW :: PDFSize -> Float pdfSizeH :: PDFSize -> Float -- | Possible things that can go wrong while reading the info. data PDFInfoError -- | Couldn't parse a property value. ParseError :: String -> PDFInfoError -- | Error to do with the pdfinfo process. ProcessError :: IOException -> PDFInfoError -- | No message given. NoMessage :: PDFInfoError -- | Some nonspecific error. SomeError :: String -> PDFInfoError -- | Parse PDFInfo's output. parse :: String -> Either PDFInfoError PDFInfo -- | Parse a page size. This is loosely defined. parseSize :: String -> ParsePDFInfo PDFSize -- | Parse a date according to pdfinfo's format. parseDate :: String -> ParsePDFInfo UTCTime -- | Read a value, maybe, allow misc trailing data. readRight :: (MonadError PDFInfoError m, Read a) => String -> m a instance Monad ParsePDFInfo instance Functor ParsePDFInfo instance MonadError PDFInfoError ParsePDFInfo instance Eq PDFSize instance Show PDFSize instance Show PDFInfoError instance Show PDFInfo instance Applicative ParsePDFInfo instance Error PDFInfoError