HPDF-0.3: Graphics/PDF/Shape.hs
-- | Functions used to add shapes to a PDF documents
module Graphics.PDF.Shape
(-- * Shapes
-- ** Drawing operators
line, rectangle, fillRectangle
-- ** Path operators
,startPathAt,closePath,addLineToPath,addRectangleToPath,strokePath,fillPath, fillAndStrokePath, clipPath
-- ** Shape settings
, lineWidth, dashPattern
)
where
import Graphics.PDF.LowLevel
-- | Add a line to a PDF document
line :: Float -> Float -> Float -> Float -> PdfCmd
line xa ya xb yb = (PdfL xa ya xb yb,[])
-- | Change the line width used in a PDF document
lineWidth :: Float -> PdfCmd
lineWidth w = (PdfW w,[])
-- | Add a rectangle to the PDF
rectangle :: Float -> Float -> Float -> Float -> PdfCmd
rectangle xa ya width height = (PdfRect xa ya width height,[])
-- | Add a filled a rectangle to the PDF
fillRectangle :: Float -> Float -> Float -> Float -> PdfCmd
fillRectangle xa ya width height = (PdfFillRect xa ya width height,[])
-- | Set the dash array and phase
dashPattern :: [Float] -> Float -> PdfCmd
dashPattern a phase = (PdfDash a phase,[])
-- | Start a new path
startPathAt :: Float -> Float -> PdfCmd
startPathAt xa ya = (PdfStartPath xa ya,[])
-- | Close path
closePath :: PdfCmd
closePath = (PdfClosePath,[])
-- | Add a line to the current path
addLineToPath :: Float -> Float -> PdfCmd
addLineToPath xa ya = (PdfAddLineToPath xa ya,[])
-- | Add a rectangle to the PDF
addRectangleToPath :: Float -> Float -> Float -> Float -> PdfCmd
addRectangleToPath xa ya width height = (PdfAddRectangleToPath xa ya width height,[])
-- | Stroke path
strokePath :: PdfCmd
strokePath = (PdfStroke,[])
-- | Fill path
fillPath :: PdfCmd
fillPath = (PdfFill,[])
-- | Fill and stroke path
fillAndStrokePath :: PdfCmd
fillAndStrokePath = (PdfFillAndStroke,[])
-- | Clip path
clipPath :: PdfCmd
clipPath = (PdfClip,[])