- pdfInfo :: MonadIO m => FilePath -> m (Either PDFInfoError PDFInfo)
- data PDFInfo = PDFInfo {
- pdfInfoTitle :: Maybe String
- pdfInfoSubject :: Maybe String
- pdfInfoAuthor :: Maybe String
- pdfInfoCreator :: Maybe String
- pdfInfoProducer :: Maybe String
- pdfInfoCreationDate :: Maybe UTCTime
- pdfInfoModDate :: Maybe UTCTime
- pdfInfoTagged :: Maybe Bool
- pdfInfoPages :: Maybe Integer
- pdfInfoEncrypted :: Maybe Bool
- pdfInfoPageSize :: Maybe PDFSize
- pdfInfoFileSize :: Maybe Integer
- pdfInfoOptimized :: Maybe Bool
- pdfInfoPDFVersion :: Maybe Double
- data PDFSize = PDFSize {}
- data PDFInfoError
- data ParsePDFInfo a
- runParse :: ParsePDFInfo a -> Either PDFInfoError a
- parse :: String -> Either PDFInfoError PDFInfo
- parseSize :: String -> ParsePDFInfo PDFSize
- parseDate :: String -> ParsePDFInfo UTCTime
- readRight :: (MonadError PDFInfoError m, Read a) => String -> m a
Reading PDF info
pdfInfo :: MonadIO m => FilePath -> m (Either PDFInfoError PDFInfo)Source
Run pdfinfo on the given file. Handles IO exceptions to do with running the process.
A type representing the output from the pdfinfo command.
PDFInfo | |
|
Size of the PDF in pts.
data PDFInfoError Source
Possible things that can go wrong while reading the info.
ParseError String | Couldn't parse a property value. |
ProcessError IOException | Error to do with the pdfinfo process. |
NoMessage | No message given. |
SomeError String | Some nonspecific error. |
Internals
data ParsePDFInfo a Source
runParse :: ParsePDFInfo a -> Either PDFInfoError aSource
parseSize :: String -> ParsePDFInfo PDFSizeSource
Parse a page size. This is loosely defined.
parseDate :: String -> ParsePDFInfo UTCTimeSource
Parse a date according to pdfinfo's format.
readRight :: (MonadError PDFInfoError m, Read a) => String -> m aSource
Read a value, maybe, allow misc trailing data.