pdf-toolbox-core-0.1.1: A collection of tools for processing PDF files.
Safe HaskellNone
LanguageHaskell2010

Pdf.Core.File

Description

Pdf file as a set of objects

Synopsis

Documentation

data File Source #

Pdf file is a collection of Objects

withPdfFile :: FilePath -> (File -> IO a) -> IO a Source #

Open Pdf file

You may want to check encryptionStatus and setUserPassword if file is encrypted.

fromHandle :: [StreamFilter] -> Handle -> IO File Source #

Create file from a binary handle.

You may use knownFilters as the first argument.

fromBytes :: [StreamFilter] -> ByteString -> IO File Source #

Create file from a ByteString.

You may use knownFilters as the first argument.

fromBuffer :: [StreamFilter] -> Buffer -> IO File Source #

Create file from a buffer.

You may use knownFilters as the first argument.

lastTrailer :: File -> IO Dict Source #

The last trailer is an entry point to PDF file. All other objects usually are referensed from it, directly or indirectly.

findObject :: File -> Ref -> IO Object Source #

Get an object with the specified ref.

streamContent :: File -> Ref -> Stream -> IO (InputStream ByteString) Source #

Get content of the stream

It's decrypted and decoded using registered StreamFilters if necessary.

rawStreamContent :: File -> Ref -> Stream -> IO (InputStream ByteString) Source #

Get content of the stream

Content would be decrypted if necessary.

encryptionStatus :: File -> IO EncryptionStatus Source #

Get encryption status.

If it's Encrypted, you may want to setUserPassword to decrypt it.

setUserPassword :: File -> ByteString -> IO Bool Source #

Set user password to decrypt PDF file.

Use empty bytestring to set the default password. Returns True on success. See also setDecryptor.

setDecryptor :: File -> Decryptor -> IO () Source #

Decrypt file using the specified decryptor.

Use it if setUserPassword doesn't work for you.

data NotFound Source #

Constructors

NotFound String 

Instances

Instances details
Show NotFound Source # 
Instance details

Defined in Pdf.Core.File

Exception NotFound Source # 
Instance details

Defined in Pdf.Core.File