HPDF-0.3: PDF API for HaskellContentsIndex
Graphics.PDF
Portabilityportable
Stabilityexperimental
Maintainermisc@NOSPAMalpheccar.org
Contents
HPDF
The PDF type
PDF Operator used to build a PDF document (in addition to the Monoid ones)
PDF Transformations
PDF Text
PDF Shapes
PDF Colors
PDF Shadings
PDF Font
PDF File
Example
Description
PDF API for Haskell
Synopsis
data PDF
withContext :: PDF -> PdfCmd
(<>) :: PdfCmd -> PDF -> PDF
emptyPdf :: Float -> Float -> PDF
type PdfCmd = (Cmd, [CreatedObject])
module Graphics.PDF.Geometry
module Graphics.PDF.Text
module Graphics.PDF.Shape
module Graphics.PDF.Color
module Graphics.PDF.Shading
module Graphics.PDF.Font
module Graphics.PDF.File
HPDF
The PDF type
data PDF
PDF data with its state, xobject and font dictionary
show/hide Instances
PDF Operator used to build a PDF document (in addition to the Monoid ones)
withContext :: PDF -> PdfCmd
Create a new PDF graphic where the graphic context is saved/restored and thus isolated from additional modifications that could be applied to this PDF document
(<>) :: PdfCmd -> PDF -> PDF
Combine two PDF actions
emptyPdf :: Float -> Float -> PDF
Create a new empty document of given width and height
type PdfCmd = (Cmd, [CreatedObject])
Type returned by a PDF command creator
PDF Transformations
module Graphics.PDF.Geometry
PDF Text
module Graphics.PDF.Text
PDF Shapes
module Graphics.PDF.Shape
PDF Colors
module Graphics.PDF.Color
PDF Shadings
module Graphics.PDF.Shading
PDF Font
module Graphics.PDF.Font
PDF File
module Graphics.PDF.File
Example
 test :: IO ()
 test = let document = rgbSpace <>
                       chooseFont Helvetica 70 <> 
                       applyMatrix (translate 50 0) <>
                       applyMatrix (rotate (Degree 45)) <>
                       clipText 0 0 "HPDF" <> 
                       applyMatrix (rotate (Degree (-45))) <>
                       applyMatrix (translate (-50) 0) <>
                       fillColor (Rgb 0 0 1) <>
                       fillRectangle 0 0 100 100 <>
                       fillColor (Rgb 1 0 0) <>
                       setAlpha 0.4 <>
                       fillRectangle 50 50 100 100 <>
                       resetAlpha <>
                       fillColor (Rgb 0 1 0) <>
                       fillRectangle 80 80 100 100 <>
                       emptyPdf 180 180
        in
        writePdf "test.pdf" document 
Produced by Haddock version 0.8