#include <PdfPainter.h>
Inheritance diagram for PoDoFo::PdfPainter:
Public Member Functions | |
PdfPainter () | |
void | SetPage (PdfCanvas *pPage) |
const PdfCanvas * | GetPage () 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 | SetStrokingColor (const PdfColor &rColor) |
void | SetColor (const PdfColor &rColor) |
void | SetStrokeWidth (double dWidth) |
void | SetStrokeStyle (EPdfStrokeStyle eStyle, const char *pszCustom=NULL) |
void | SetLineCapStyle (EPdfLineCapStyle eCapStyle) |
void | SetLineJoinStyle (EPdfLineJoinStyle eJoinStyle) |
void | SetFont (PdfFont *pFont) |
PdfFont * | GetFont () const |
void | SetClipRect (double dX, double dY, double dWidth, double dHeight) |
void | SetClipRect (const PdfRect &rRect) |
void | DrawLine (double dStartX, double dStartY, double dEndX, double dEndY) |
void | DrawRect (double dX, double dY, double dWidth, double dHeight, double dRoundX=0.0, double dRoundY=0.0) |
void | DrawRect (const PdfRect &rRect, double dRoundX=0.0, double dRoundY=0.0) |
void | FillRect (double dX, double dY, double dWidth, double dHeight, double dRoundX=0.0, double dRoundY=0.0) |
void | FillRect (const PdfRect &rRect, double dRoundX=0.0, double dRoundY=0.0) |
void | DrawEllipse (double dX, double dY, double dWidth, double dHeight) |
void | FillEllipse (double dX, double dY, double dWidth, double dHeight) |
void | DrawCircle (double dX, double dY, double dRadius) |
void | FillCircle (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) |
void | DrawMultiLineText (const PdfRect &rRect, const PdfString &rsText, EPdfAlignment eAlignment=ePdfAlignment_Left, EPdfVerticalAlignment eVertical=ePdfVerticalAlignment_Top) |
std::vector< TLineElement > | GetMultiLineTextAsLines (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 | HorizonalLineTo (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 () |
void | Clip (bool useEvenOddRule=false) |
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 |
Protected Member Functions | |
void | SetCurrentStrokingColor () |
PdfString | ExpandTabs (const PdfString &rsString, pdf_long lLen) const |
Protected Attributes | |
PdfStream * | m_pCanvas |
PdfCanvas * | m_pPage |
PdfFont * | m_pFont |
unsigned short | m_nTabWidth |
PdfColor | m_curColor |
bool | m_isTextOpen |
std::ostringstream | m_oss |
During all drawing operations, you are still able to access the stream of the object you are drawing on directly.
All functions that take coordinates expect these to be in PDF User Units. Keep in mind that PDF has its coordinate system origin at the bottom left corner.
|
Create a new PdfPainter object. |
|
Draw a string on a page. You have to call BeginText before the first call of this function and EndText after the last call. If you want more simpler text output and do not need the advanced text position features of MoveTextPos use DrawText which is easier.
|
|
Draw a string on a page. You have to call BeginText before the first call of this function and EndText after the last call. If you want more simpler text output and do not need the advanced text position features of MoveTextPos use DrawText which is easier.
|
|
Append a Arc to the current path Matches the SVG 'A' operator.
|
|
Begin drawing multiple text strings on a page using a given font object. You have to call SetFont before calling this function. If you want more simpler text output and do not need the advanced text position features of MoveTextPos use DrawText which is easier.
|
|
Clip the current path. Matches the PDF 'W' operator. This function is useful to construct an own path for drawing or clipping.
|
|
Close the current path. Matches the PDF 'h' operator. |
|
Closes the current path by drawing a line from the current point to the starting point of the path. Matches the PDF 'h' operator. This function is useful to construct an own path for drawing or clipping. |
|
Append a cubic bezier curve to the current path Matches the PDF 'c' operator.
|
|
Draw a circle with the current stroking settings
|
|
Draw an ellipse with the current stroking settings
|
|
Draw a single glyph on a page using a given font object.
|
|
Draw an image on the current page.
|
|
Draw a line with the current color and line settings.
|
|
Draw multiline text into a rectangle doing automatic wordwrapping. The current font is used and SetFont has to be called at least once before using this function
|
|
Draw multiline text into a rectangle doing automatic wordwrapping. The current font is used and SetFont has to be called at least once before using this function
|
|
Draw a rectangle with the current stroking settings
|
|
Draw a rectangle with the current stroking settings
|
|
Draw a single-line text string on a page using a given font object. You have to call SetFont before calling this function.
|
|
Draw a single-line text string on a page using a given font object. You have to call SetFont before calling this function.
|
|
Draw a single line of text horizontally aligned.
|
|
Draw an XObject on the current page. For PdfImage use DrawImage.
|
|
End drawing multiple text strings on a page If you want more simpler text output and do not need the advanced text position features of MoveTextPos use DrawText which is easier.
|
|
Expand all tab characters in a string using spaces.
|
|
Fill the current path. Matches the PDF 'f' operator. This function is useful to construct an own path for drawing or clipping. |
|
Fill a Circle with the current fill settings
|
|
Fill an ellipse with the current fill settings
|
|
Fill a rectangle with the current fill settings
|
|
Fill a rectangle with the current fill settings
|
|
Finish drawing onto a page. This has to be called whenever a page has been drawn complete. |
|
Get the current font:
|
|
Gets the text divided into individual lines, using the current font and clipping rectangle.
|
|
Return the current page that is that on the painter.
|
|
Get the currently set floating point precision
|
|
Get the currently set tab width
|
|
Append a horizontal line to the current path Matches the SVG 'H' operator
|
|
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.
|
|
Move position for text drawing on a page. You have to call BeginText before calling this function If you want more simpler text output and do not need the advanced text position features of MoveTextPos use DrawText which is easier.
|
|
Begin a new path. Matches the PDF 'm' operator. This function is useful to construct an own path for drawing or clipping.
|
|
Append a quadratic bezier curve to the current path Matches the SVG 'Q' operator.
|
|
Restore the current graphics settings from the graphics stack. Operator 'Q' in PDF. This call has to be balanced with a corresponding call to Save()!
|
|
Save the current graphics settings onto the graphics stack. Operator 'q' in PDF. This call has to be balanced with a corresponding call to Restore()!
|
|
Set a clipping rectangle
|
|
Set a clipping rectangle
|
|
Set the color for all following non-stroking operations.
|
|
Set the color for all following non-stroking operations in rgb colorspace. This operation used the 'rg' PDF operator. This color is also used when drawing text.
|
|
Set the color for all following non-stroking operations in cmyk colorspace. This operation used the 'k' PDF operator.
|
|
Sets the color that was last set by the user as the current stroking color. You should always enclose this function by Save() and Restore()
|
|
Sets a specific PdfExtGState as being active
|
|
Set the font for all text drawing operations
|
|
Set the color for all following non-stroking operations in grayscale colorspace. This operation used the 'g' PDF operator.
|
|
Set the line cap style for all stroking operations.
|
|
Set the line join style for all stroking operations.
|
|
Set the page on which the painter should draw. The painter will draw of course on the pages contents object. Calls FinishPage() on the last page if it was not yet called.
|
|
Set the floating point precision.
|
|
Sets a specific rendering intent
|
|
Set the shading pattern for all following non-stroking operations. This operation uses the 'scn' PDF operator.
|
|
Set the stoke style for all stroking operations.
|
|
Set the line width for all stroking operations.
|
|
Set the color for all following stroking operations.
|
|
Set the color for all following stroking operations in rgb colorspace. This operation used the 'RG' PDF operator.
|
|
Set the color for all following stroking operations in cmyk colorspace. This operation used the 'K' PDF operator.
|
|
Set the color for all following stroking operations in grayscale colorspace. This operation used the 'G' PDF operator.
|
|
Set the shading pattern for all following stroking operations. This operation uses the 'SCN' PDF operator.
|
|
Set the tab width for the DrawText operation. Every tab '\t' is replaced with nTabWidth spaces before drawing text. Default is a value of 4
|
|
Set the transformation matrix for the current coordinate system See the operator 'cm' in PDF. The six parameters are a standard 3x3 transformation matrix where the 3 left parameters are 0 0 1.
|
|
Append a smooth bezier curve to the current path Matches the SVG 'S' operator.
|
|
Append a smooth quadratic bezier curve to the current path Matches the SVG 'T' operator.
|
|
Stroke the current path. Matches the PDF 'S' operator. This function is useful to construct an own path for drawing or clipping. |
|
Append a vertical line to the current path Matches the SVG 'V' operator
|
|
Save the current color for non stroking colors |
|
Is between BT and ET |
|
Every tab '\t' is replaced with m_nTabWidth spaces before drawing text. Default is a value of 4 |
|
temporary stream buffer |
|
All drawing operations work on this stream. This object may not be NULL. If it is NULL any function accessing it should return ERROR_PDF_INVALID_HANDLE |
|
Font for all drawing operations |
|
The page object is needed so that fonts etc. can be added to the page resource dictionary as appropriate. |