-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Wrapper around the pdfinfo command.
--   
--   Just a wrapper around the pdfinfo command (for collecting PDF file
--   info). See man pdfinfo.
@package pdfinfo
@version 1.5.4

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 Text) -> !(Maybe Text) -> !(Maybe Text) -> !(Maybe Text) -> !(Maybe Text) -> !(Maybe UTCTime) -> !(Maybe UTCTime) -> !(Maybe Bool) -> !(Maybe Integer) -> !(Maybe PDFEncryptionInfo) -> !(Maybe PDFSize) -> !(Maybe Integer) -> !(Maybe Bool) -> !(Maybe Double) -> PDFInfo

-- | Title
[pdfInfoTitle] :: PDFInfo -> !(Maybe Text)

-- | Subject
[pdfInfoSubject] :: PDFInfo -> !(Maybe Text)

-- | Author: E.g. Chris Done
[pdfInfoAuthor] :: PDFInfo -> !(Maybe Text)

-- | Creator: E.g. Microsoft Office Word 2007
[pdfInfoCreator] :: PDFInfo -> !(Maybe Text)

-- | Producer: E.g. Microsoft Office Word 2007
[pdfInfoProducer] :: PDFInfo -> !(Maybe Text)

-- | 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)

-- | Encryption information
[pdfInfoEncrypted] :: PDFInfo -> !(Maybe PDFEncryptionInfo)

-- | 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

-- | Encryption and restricted permissions
data PDFEncryptionInfo

-- | Not encrypted
PDFNoEncryption :: PDFEncryptionInfo

-- | Encrypted with possible permission restrictions
PDFEncryption :: !(Maybe Bool) -> !(Maybe Bool) -> !(Maybe Bool) -> !(Maybe Bool) -> !(Maybe Text) -> PDFEncryptionInfo

-- | Can the file be printed?
[pdfCanPrint] :: PDFEncryptionInfo -> !(Maybe Bool)

-- | Can the file be copied?
[pdfCanCopy] :: PDFEncryptionInfo -> !(Maybe Bool)

-- | Can the file be changed?
[pdfCanChange] :: PDFEncryptionInfo -> !(Maybe Bool)

-- | Can notes be added?
[pdfCanAddNotes] :: PDFEncryptionInfo -> !(Maybe Bool)

-- | Encryption algorithm: e.g. unknown, RC4, AES, AES-256
[pdfEncryptionAlgorithm] :: PDFEncryptionInfo -> !(Maybe Text)

-- | Possible things that can go wrong while reading the info.
data PDFInfoError

-- | Couldn't parse a property value.
ParseError :: !String -> PDFInfoError

-- | Process exited with this stderr.
ProcessFailure :: !Text -> PDFInfoError

-- | Error to do with the pdfinfo process.
ProcessError :: !IOException -> PDFInfoError

-- | No message given.
NoMessage :: PDFInfoError

-- | Some nonspecific error.
SomeError :: String -> PDFInfoError
data ParsePDFInfo a
runParse :: ParsePDFInfo a -> Either PDFInfoError a

-- | Parse PDFInfo's output.
parse :: Text -> Either PDFInfoError PDFInfo

-- | Parse a page size. This is loosely defined.
parseSize :: Text -> ParsePDFInfo PDFSize

-- | Parse a date according to pdfinfo's format.
parseDate :: Text -> ParsePDFInfo UTCTime

-- | Parse encryption information according to pdfinfo's format.
parseEncrypted :: Text -> ParsePDFInfo PDFEncryptionInfo

-- | Read a value, maybe, allow misc trailing data.
readRight :: (MonadError PDFInfoError m, Read a) => Text -> m a
instance Control.Monad.Error.Class.MonadError Text.PDF.Info.PDFInfoError Text.PDF.Info.ParsePDFInfo
instance GHC.Base.Functor Text.PDF.Info.ParsePDFInfo
instance GHC.Base.Monad Text.PDF.Info.ParsePDFInfo
instance GHC.Show.Show Text.PDF.Info.PDFInfo
instance GHC.Show.Show Text.PDF.Info.PDFEncryptionInfo
instance GHC.Classes.Eq Text.PDF.Info.PDFEncryptionInfo
instance GHC.Show.Show Text.PDF.Info.PDFSize
instance GHC.Classes.Eq Text.PDF.Info.PDFSize
instance GHC.Show.Show Text.PDF.Info.PDFInfoError
instance GHC.Base.Applicative Text.PDF.Info.ParsePDFInfo
instance Control.Monad.Trans.Error.Error Text.PDF.Info.PDFInfoError
