Safe Haskell | None |
---|
- pdfInfo :: MonadIO m => FilePath -> m (Either PDFInfoError PDFInfo)
- data PDFInfo = PDFInfo {
- pdfInfoTitle :: !(Maybe Text)
- pdfInfoSubject :: !(Maybe Text)
- pdfInfoAuthor :: !(Maybe Text)
- pdfInfoCreator :: !(Maybe Text)
- pdfInfoProducer :: !(Maybe Text)
- 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
- = ParseError !String
- | ProcessFailure !Text
- | ProcessError !IOException
- | NoMessage
- | SomeError String
- data ParsePDFInfo a
- runParse :: ParsePDFInfo a -> Either PDFInfoError a
- parse :: Text -> Either PDFInfoError PDFInfo
- parseSize :: Text -> ParsePDFInfo PDFSize
- parseDate :: Text -> ParsePDFInfo UTCTime
- readRight :: (MonadError PDFInfoError m, Read a) => Text -> 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. |
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 Source
runParse :: ParsePDFInfo a -> Either PDFInfoError aSource
parseSize :: Text -> ParsePDFInfo PDFSizeSource
Parse a page size. This is loosely defined.
parseDate :: Text -> ParsePDFInfo UTCTimeSource
Parse a date according to pdfinfo's format.
readRight :: (MonadError PDFInfoError m, Read a) => Text -> m aSource
Read a value, maybe, allow misc trailing data.