HPDF-1.7: Generation of PDF documents
Copyright(c) 2006-2016 alpheccar.org
LicenseBSD-style
Maintainermisc@NOSPAMalpheccar.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.PDF

Description

Generation of PDF documents A PDF library with support for several pages, page transitions, outlines, annotations, compression, colors, shapes, patterns, jpegs, fonts, typesetting ... Have a look at the Graphics.PDF.Documentation module to see how to use it. Or, download the package and look at the test.hs file in the Test folder. That file is giving an example of each feature.

Synopsis

HPDF

PDF Monad

data PDF a Source #

The PDF Monad

Instances

Instances details
PDFGlobals PDF Source # 
Instance details

Defined in Graphics.PDF.Draw

Applicative PDF Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

pure :: a -> PDF a #

(<*>) :: PDF (a -> b) -> PDF a -> PDF b #

liftA2 :: (a -> b -> c) -> PDF a -> PDF b -> PDF c #

(*>) :: PDF a -> PDF b -> PDF b #

(<*) :: PDF a -> PDF b -> PDF a #

Functor PDF Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

fmap :: (a -> b) -> PDF a -> PDF b #

(<$) :: a -> PDF b -> PDF a #

Monad PDF Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

(>>=) :: PDF a -> (a -> PDF b) -> PDF b #

(>>) :: PDF a -> PDF b -> PDF b #

return :: a -> PDF a #

runPdf Source #

Arguments

:: String

Name of the PDF document

-> PDFDocumentInfo 
-> PDFRect

Default size for a page

-> PDF a

PDF action

-> IO () 

Generates a PDF document

pdfByteString Source #

Arguments

:: PDFDocumentInfo 
-> PDFRect

Default size for a page

-> PDF a

PDF action

-> ByteString 

Generate a lazy bytestring for the PDF

PDF Common Types

data PDFRect Source #

A PDF rectangle

Constructors

PDFRect !Double !Double !Double !Double 

type PDFFloat = Double Source #

A real number in a PDF document

data PDFString Source #

A PDFString containing a strict bytestring (serialied as UTF16BE)

data PDFPage Source #

A PDF Page object

Instances

Instances details
Show PDFPage Source # 
Instance details

Defined in Graphics.PDF.Draw

data Pages Source #

List of all pages

Document management

data Draw a Source #

The drawing monad

Instances

Instances details
PDFGlobals Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

Applicative Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

pure :: a -> Draw a #

(<*>) :: Draw (a -> b) -> Draw a -> Draw b #

liftA2 :: (a -> b -> c) -> Draw a -> Draw b -> Draw c #

(*>) :: Draw a -> Draw b -> Draw b #

(<*) :: Draw a -> Draw b -> Draw a #

Functor Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

fmap :: (a -> b) -> Draw a -> Draw b #

(<$) :: a -> Draw b -> Draw a #

Monad Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

(>>=) :: Draw a -> (a -> Draw b) -> Draw b #

(>>) :: Draw a -> Draw b -> Draw b #

return :: a -> Draw a #

MonadWriter Builder Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

writer :: (a, Builder) -> Draw a #

tell :: Builder -> Draw () #

listen :: Draw a -> Draw (a, Builder) #

pass :: Draw (a, Builder -> Builder) -> Draw a #

data PDFXForm Source #

Instances

Instances details
PDFXObject PDFXForm Source # 
Instance details

Defined in Graphics.PDF.Draw

data PDFTransition Source #

A PDF Transition

Instances

Instances details
Eq PDFTransition Source # 
Instance details

Defined in Graphics.PDF.Draw

data PDFTransDirection Source #

Direction of a transition

Constructors

Inward 
Outward 

data PDFTransDimension Source #

Dimension of a transition

Constructors

Horizontal 
Vertical 

data PDFTransDirection2 Source #

Direction of a transition

Constructors

LeftToRight 
BottomToTop

Wipe only

RightToLeft

Wipe only

TopToBottom 
TopLeftToBottomRight

Glitter only

Instances

Instances details
Eq PDFTransDirection2 Source # 
Instance details

Defined in Graphics.PDF.Draw

data PDFViewerPreferences Source #

Viewer preferences

Constructors

PDFViewerPreferences 

Fields

class PDFXObject a where Source #

A PDF Xobject which can be drawn

Minimal complete definition

Nothing

class PDFGlobals m where Source #

Instances

Instances details
PDFGlobals Draw Source # 
Instance details

Defined in Graphics.PDF.Draw

PDFGlobals PDF Source # 
Instance details

Defined in Graphics.PDF.Draw

addPage Source #

Arguments

:: Maybe PDFRect

Page size or default document's one

-> PDF (PDFReference PDFPage)

Reference to the new page

Add a new page to a PDF document

addPageWithTransition Source #

Arguments

:: Maybe PDFRect

Page size or default document's one

-> Maybe PDFFloat

Optional duration

-> Maybe PDFTransition

Optional transition

-> PDF (PDFReference PDFPage)

Reference to the new page

drawWithPage Source #

Arguments

:: PDFReference PDFPage

Page

-> Draw a

Drawing commands

-> PDF a 

Draw on a given page

createPDFXForm Source #

Arguments

:: PDFFloat

Left

-> PDFFloat

Bottom

-> PDFFloat

Right

-> PDFFloat

Top

-> Draw a

Drawing commands

-> PDF (PDFReference PDFXForm) 

Create a PDF XObject

standardDocInfo :: PDFDocumentInfo Source #

No information for the document

withNewContext :: Draw a -> Draw a Source #

Draw in a new drawing context without perturbing the previous context that is restored after the draw

emptyDrawing :: Draw () Source #

An empty drawing

Drawing

Colors

Geometry

applyMatrix :: Matrix -> Draw () Source #

Apply a transformation matrix to the current coordinate frame

Text

Navigation

Annotations

Actions

Images

Patterns

Shading

Transparency

data ColorSpace a e where Source #

Constructors

GraySpace :: ColorSpace PDFFloat ExprFloat 
RGBSpace :: ColorSpace FloatRGB ExprRGB 
CMYKSpace :: ColorSpace FloatCMYK ExprCMYK 

Instances

Instances details
Eq (ColorSpace a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

(==) :: ColorSpace a e -> ColorSpace a e -> Bool #

(/=) :: ColorSpace a e -> ColorSpace a e -> Bool #

Ord (ColorSpace a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

compare :: ColorSpace a e -> ColorSpace a e -> Ordering #

(<) :: ColorSpace a e -> ColorSpace a e -> Bool #

(<=) :: ColorSpace a e -> ColorSpace a e -> Bool #

(>) :: ColorSpace a e -> ColorSpace a e -> Bool #

(>=) :: ColorSpace a e -> ColorSpace a e -> Bool #

max :: ColorSpace a e -> ColorSpace a e -> ColorSpace a e #

min :: ColorSpace a e -> ColorSpace a e -> ColorSpace a e #

calculator1 :: (ExprFloat -> e) -> Function1 Global a e Source #

calculator2 :: (ExprFloat -> ExprFloat -> e) -> Function2 Global a e Source #

data Function1 scope a e where Source #

Constructors

GlobalFunction1 :: FunctionObject (PDFFloat -> a) (ExprFloat -> e) -> Function1 Local a e 
Sampled1 :: Array Int a -> Function1 Global a e 
Interpolated1 :: PDFFloat -> a -> a -> Function1 scope a e 
Stitched1 :: Function1 Local a e -> [(PDFFloat, Function1 Local a e)] -> Function1 scope a e 
Calculator1 :: (ExprFloat -> e) -> Function1 Global a e 

Instances

Instances details
(Local ~ scope, ColorTuple a, Eq a, Result e) => Eq (Function1 scope a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

(==) :: Function1 scope a e -> Function1 scope a e -> Bool #

(/=) :: Function1 scope a e -> Function1 scope a e -> Bool #

(Local ~ scope, ColorTuple a, Ord a, Result e) => Ord (Function1 scope a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

compare :: Function1 scope a e -> Function1 scope a e -> Ordering #

(<) :: Function1 scope a e -> Function1 scope a e -> Bool #

(<=) :: Function1 scope a e -> Function1 scope a e -> Bool #

(>) :: Function1 scope a e -> Function1 scope a e -> Bool #

(>=) :: Function1 scope a e -> Function1 scope a e -> Bool #

max :: Function1 scope a e -> Function1 scope a e -> Function1 scope a e #

min :: Function1 scope a e -> Function1 scope a e -> Function1 scope a e #

data Function2 scope a e where Source #

Constructors

GlobalFunction2 :: FunctionObject (PDFFloat -> PDFFloat -> a) (ExprFloat -> ExprFloat -> e) -> Function2 Local a e 
Sampled2 :: Array (Int, Int) a -> Function2 Global a e 
Calculator2 :: (ExprFloat -> ExprFloat -> e) -> Function2 Global a e 

Instances

Instances details
(Local ~ scope, ColorTuple a, Eq a, Result e) => Eq (Function2 scope a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

(==) :: Function2 scope a e -> Function2 scope a e -> Bool #

(/=) :: Function2 scope a e -> Function2 scope a e -> Bool #

(Local ~ scope, ColorTuple a, Ord a, Result e) => Ord (Function2 scope a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Methods

compare :: Function2 scope a e -> Function2 scope a e -> Ordering #

(<) :: Function2 scope a e -> Function2 scope a e -> Bool #

(<=) :: Function2 scope a e -> Function2 scope a e -> Bool #

(>) :: Function2 scope a e -> Function2 scope a e -> Bool #

(>=) :: Function2 scope a e -> Function2 scope a e -> Bool #

max :: Function2 scope a e -> Function2 scope a e -> Function2 scope a e #

min :: Function2 scope a e -> Function2 scope a e -> Function2 scope a e #

linearStitched :: ColorTuple a => a -> [(PDFFloat, a)] -> a -> Function1 Local a e Source #

data FunctionObject a e Source #

Instances

Instances details
Eq (FunctionObject a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Ord (FunctionObject a e) Source # 
Instance details

Defined in Graphics.PDF.Draw

Fonts

Typesetting