PoDoFo  0.9.4
Public Member Functions | List of all members
PoDoFo::PdfPainterMM Class Reference

#include <PdfPainterMM.h>

Inheritance diagram for PoDoFo::PdfPainterMM:
PoDoFo::PdfPainter

Public Member Functions

 PdfPainterMM ()
 
void SetStrokeWidthMM (long lWidth)
 
void DrawLineMM (long lStartX, long lStartY, long lEndX, long lEndY)
 
void RectangleMM (long lX, long lY, long lWidth, long lHeight)
 
void EllipseMM (long lX, long lY, long lWidth, long lHeight)
 
void DrawTextMM (long lX, long lY, const PdfString &sText)
 
void DrawTextMM (long lX, long lY, const PdfString &sText, long lLen)
 
void DrawImageMM (long lX, long lY, PdfImage *pObject, double dScaleX=1.0, double dScaleY=1.0)
 
void DrawXObjectMM (long lX, long lY, PdfXObject *pObject, double dScaleX=1.0, double dScaleY=1.0)
 
void LineToMM (long lX, long lY)
 
void MoveToMM (long lX, long lY)
 
- Public Member Functions inherited from PoDoFo::PdfPainter
 PdfPainter ()
 
void SetPage (PdfCanvas *pPage)
 
PdfCanvasGetPage () const
 
PdfStreamGetCanvas () const
 
void FinishPage ()
 
void SetStrokingGray (double g)
 
void SetGray (double g)
 
void SetStrokingColor (double r, double g, double b)
 
void SetColor (double r, double g, double b)
 
void SetStrokingColorCMYK (double c, double m, double y, double k)
 
void SetColorCMYK (double c, double m, double y, double k)
 
void SetStrokingShadingPattern (const PdfShadingPattern &rPattern)
 
void SetShadingPattern (const PdfShadingPattern &rPattern)
 
void SetStrokingTilingPattern (const PdfTilingPattern &rPattern)
 
void SetStrokingTilingPattern (const std::string &rPatternName)
 
void SetTilingPattern (const PdfTilingPattern &rPattern)
 
void SetTilingPattern (const std::string &rPatternName)
 
void SetStrokingColor (const PdfColor &rColor)
 
void SetColor (const PdfColor &rColor)
 
void SetStrokeWidth (double dWidth)
 
void SetStrokeStyle (EPdfStrokeStyle eStyle, const char *pszCustom=NULL, bool inverted=false, double scale=1.0, bool subtractJoinCap=false)
 
void SetLineCapStyle (EPdfLineCapStyle eCapStyle)
 
void SetLineJoinStyle (EPdfLineJoinStyle eJoinStyle)
 
void SetFont (PdfFont *pFont)
 
void SetTextRenderingMode (EPdfTextRenderingMode mode)
 
EPdfTextRenderingMode GetTextRenderingMode (void) const
 
PdfFontGetFont () const
 
void SetClipRect (double dX, double dY, double dWidth, double dHeight)
 
void SetClipRect (const PdfRect &rRect)
 
void SetMiterLimit (double value)
 
void DrawLine (double dStartX, double dStartY, double dEndX, double dEndY)
 
void Rectangle (double dX, double dY, double dWidth, double dHeight, double dRoundX=0.0, double dRoundY=0.0)
 
void Rectangle (const PdfRect &rRect, double dRoundX=0.0, double dRoundY=0.0)
 
void Ellipse (double dX, double dY, double dWidth, double dHeight)
 
void Circle (double dX, double dY, double dRadius)
 
void DrawText (double dX, double dY, const PdfString &sText)
 
void DrawText (double dX, double dY, const PdfString &sText, long lLen)
 
void DrawMultiLineText (double dX, double dY, double dWidth, double dHeight, const PdfString &rsText, EPdfAlignment eAlignment=ePdfAlignment_Left, EPdfVerticalAlignment eVertical=ePdfVerticalAlignment_Top, bool bClip=true)
 
void DrawMultiLineText (const PdfRect &rRect, const PdfString &rsText, EPdfAlignment eAlignment=ePdfAlignment_Left, EPdfVerticalAlignment eVertical=ePdfVerticalAlignment_Top, bool bClip=true)
 
std::vector< PdfStringGetMultiLineTextAsLines (double dWidth, const PdfString &rsText)
 
void DrawTextAligned (double dX, double dY, double dWidth, const PdfString &rsText, EPdfAlignment eAlignment)
 
void BeginText (double dX, double dY)
 
void AddText (const PdfString &sText)
 
void AddText (const PdfString &sText, pdf_long lStringLen)
 
void MoveTextPos (double dX, double dY)
 
void EndText ()
 
void DrawGlyph (PdfMemDocument *pDocument, double dX, double dY, const char *pszGlyphname)
 
void DrawImage (double dX, double dY, PdfImage *pObject, double dScaleX=1.0, double dScaleY=1.0)
 
void DrawXObject (double dX, double dY, PdfXObject *pObject, double dScaleX=1.0, double dScaleY=1.0)
 
void ClosePath ()
 
void LineTo (double dX, double dY)
 
void MoveTo (double dX, double dY)
 
void CubicBezierTo (double dX1, double dY1, double dX2, double dY2, double dX3, double dY3)
 
void HorizontalLineTo (double dX)
 
void VerticalLineTo (double dY)
 
void SmoothCurveTo (double dX2, double dY2, double dX3, double dY3)
 
void QuadCurveTo (double dX1, double dY1, double dX3, double dY3)
 
void SmoothQuadCurveTo (double dX3, double dY3)
 
void ArcTo (double dX, double dY, double dRadiusX, double dRadiusY, double dRotation, bool bLarge, bool bSweep)
 
void Close ()
 
void Stroke ()
 
void Fill (bool useEvenOddRule=false)
 
void FillAndStroke (bool useEvenOddRule=false)
 
void Clip (bool useEvenOddRule=false)
 
void EndPath (void)
 
void Save ()
 
void Restore ()
 
void SetTransformationMatrix (double a, double b, double c, double d, double e, double f)
 
void SetExtGState (PdfExtGState *inGState)
 
void SetRenderingIntent (char *intent)
 
void SetTabWidth (unsigned short nTabWidth)
 
unsigned short GetTabWidth () const
 
void SetPrecision (unsigned short inPrec)
 
unsigned short GetPrecision () const
 
std::ostringstream & GetCurrentPath (void)
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfPainter
void ConvertRectToBezier (double dX, double dY, double dWidth, double dHeight, double pdPointX[], double pdPointY[])
 
virtual void AddToPageResources (const PdfName &rIdentifier, const PdfReference &rRef, const PdfName &rName)
 
void SetCurrentStrokingColor ()
 
PdfString ExpandTabs (const PdfString &rsString, pdf_long lLen) const
 
- Protected Attributes inherited from PoDoFo::PdfPainter
PdfStreamm_pCanvas
 
PdfCanvasm_pPage
 
PdfFontm_pFont
 
unsigned short m_nTabWidth
 
PdfColor m_curColor
 
bool m_isTextOpen
 
std::ostringstream m_oss
 
std::ostringstream m_curPath
 

Detailed Description

This class provides an easy to use painter object which allows you to draw on a PDF page object.

During all drawing operations, you are still able to access the stream of the object you are drawing on directly.

This painter takes all coordinates in 1/1000th mm instead of PDF units.

Developer note: we use ownership rather than inheritance here, so as to use the same methods names a PdfPainter AND avoid compiler confusion on picking the right one.

See also
PdfPainter

Constructor & Destructor Documentation

PoDoFo::PdfPainterMM::PdfPainterMM ( )
inline

Create a new PdfPainterMM object.

Member Function Documentation

void PoDoFo::PdfPainterMM::DrawImageMM ( long  lX,
long  lY,
PdfImage pObject,
double  dScaleX = 1.0,
double  dScaleY = 1.0 
)
inline

Draw an image on the current page.

Parameters
lXthe x coordinate (bottom left position of the image)
lYthe y coordinate (bottom position of the image)
pObjectan PdfXObject
dScaleXoption scaling factor in x direction
dScaleYoption scaling factor in y direction
void PoDoFo::PdfPainterMM::DrawLineMM ( long  lStartX,
long  lStartY,
long  lEndX,
long  lEndY 
)
inline

Draw a line with the current color and line settings.

Parameters
lStartXx coordinate of the starting point
lStartYy coordinate of the starting point
lEndXx coordinate of the ending point
lEndYy coordinate of the ending point
void PoDoFo::PdfPainterMM::DrawTextMM ( long  lX,
long  lY,
const PdfString sText 
)
inline

Draw a text string on a page using a given font object. You have to call SetFont before calling this function.

Parameters
lXthe x coordinate
lYthe y coordinate
sTextthe text string which should be printed
See also
PdfPainter::SetFont()
void PoDoFo::PdfPainterMM::DrawTextMM ( long  lX,
long  lY,
const PdfString sText,
long  lLen 
)
inline

Draw a text string on a page using a given font object. You have to call SetFont before calling this function.

Parameters
lXthe x coordinate
lYthe y coordinate
sTextthe text string which should be printed (is not allowed to be NULL!)
lLendraw only lLen characters of pszText
See also
PdfPainter::SetFont()
void PoDoFo::PdfPainterMM::DrawXObjectMM ( long  lX,
long  lY,
PdfXObject pObject,
double  dScaleX = 1.0,
double  dScaleY = 1.0 
)
inline

Draw an XObject on the current page.

Parameters
lXthe x coordinate (bottom left position of the XObject)
lYthe y coordinate (bottom position of the XObject)
pObjectan PdfXObject
dScaleXoption scaling factor in x direction
dScaleYoption scaling factor in y direction
void PoDoFo::PdfPainterMM::EllipseMM ( long  lX,
long  lY,
long  lWidth,
long  lHeight 
)
inline

Add an ellipse into the current path

Parameters
lXx coordinate of the ellipse (left coordinate)
lYy coordinate of the ellipse (top coordinate)
lWidthwidth of the ellipse
lHeightabsolute height of the ellipse
void PoDoFo::PdfPainterMM::LineToMM ( long  lX,
long  lY 
)
inline

Append a line segment to the current path. Matches the PDF 'l' operator. This function is useful to construct an own path for drawing or clipping.

Parameters
lXx position
lYy position
void PoDoFo::PdfPainterMM::MoveToMM ( long  lX,
long  lY 
)
inline

Begin a new path. Matches the PDF 'm' operator. This function is useful to construct an own path for drawing or clipping.

Parameters
lXx position
lYy position
void PoDoFo::PdfPainterMM::RectangleMM ( long  lX,
long  lY,
long  lWidth,
long  lHeight 
)
inline

Add a rectangle into the current path

Parameters
lXx coordinate of the rectangle
lYy coordinate of the rectangle
lWidthwidth of the rectangle
lHeightabsolute height of the rectangle
void PoDoFo::PdfPainterMM::SetStrokeWidthMM ( long  lWidth)
inline

Set the line width for all stroking operations.

Parameters
lWidthin 1/1000th mm