pdf-toolbox-core- A collection of tools for processing PDF files.

Safe HaskellNone



Write PDF files

It could be used to generate new PDF file or to incrementally update the existent one

To generate new file, first call writePdfHeader, then a number of writeObject and finally writeXRefTable

To incrementally update PDF file just ommit the writePdfHeader and append the result to the existent file



runPdfWriter Source


:: MonadIO m 
=> OutputStream ByteString

streams to write to

-> PdfWriter m a

action to run

-> m a 

Execute writer action

writePdfHeader :: MonadIO m => PdfWriter m () Source

Write PDF header. Used for generating new PDF files. Should be the first call. Not used fo incremental updates

writeObject :: MonadIO m => Ref -> Object ByteString -> PdfWriter m () Source

Write object

deleteObject :: MonadIO m => Ref -> Int64 -> PdfWriter m () Source

Delete object

writeXRefTable Source


:: MonadIO m 
=> Int64

size of the original PDF file. Should be 0 for new file

-> Dict


-> PdfWriter m () 

Write xref table. Should be the last call. Used for generating and incremental updates.