Opait PDF Library
Public Member Functions | Properties | List of all members
Opait.Pdf.PdfPainter Class Reference

PdfPainter composes a PDF page content stream by printing PDF commands. More...

Inheritance diagram for Opait.Pdf.PdfPainter:

Public Member Functions

void Dispose ()
 
byte[] GetContent ()
 Gets the content of the page as a byte array. More...
 
void SetContent (byte[] content)
 Sets the content of the page from the specified byte array. More...
 
void ClearContent ()
 Clears the existing content.
 
void AppendContent (byte[] content)
 Appends the specified content to the end of current content. More...
 
void AppendContent (PdfPage page)
 Appends the content of the specified page to this page. More...
 
void SetContentStream (MemoryStream content)
 Replaces the content stream with the specified stream. More...
 
long SeekEnd ()
 Goes to the end of the content stream for appends. More...
 
void EndPath ()
 End path without filling or stroking ('n').
 
void ClosePath ()
 Close path (h).
 
void Fill ()
 Fill path (f).
 
void Stroke ()
 Stroke path (S).
 
void CloseStroke ()
 Close and stroke path (s).
 
void FillStroke ()
 Fill and stroke path (B).
 
void CloseFillStroke ()
 Close, fill, and stroke path (b).
 
void SetGray (double g)
 Set gray level for non-stroking operations (g). More...
 
void SetStrokeGray (double g)
 Set gray level for stroking operations (G). More...
 
void SetColor (double r, double g, double b)
 Set RGB color for non-stroking operations (rg). More...
 
void SetStrokeColor (double r, double g, double b)
 Set RGB color for stroking operations (RG) More...
 
void SetColor (Color c)
 Set RGB color for non-stroking operations (rg) More...
 
void SetStrokeColor (Color c)
 Set RGB color for stroking operations (RG). More...
 
void SetAlpha (double alpha)
 Set opacity value for non-stroking operations More...
 
void SetStrokeAlpha (double alpha)
 Set opacity value for stroking operations More...
 
void SetBlendMode (BlendMode blend)
 Set color blending mode. More...
 
void SetCmyk (double c, double m, double y, double k)
 Set CMYK color for non-stroking operations (rg). More...
 
void SetStrokeCmyk (double c, double m, double y, double k)
 Set CMYK color for stroking operations (RG). More...
 
void SetFillStrokeColor (Color c)
 Set RGB color for both filling and stroking operations. More...
 
void SetFillStrokeGray (double g)
 Set gray level both fill and stroke operations. More...
 
void SetFillStrokeColor (double r, double g, double b)
 Set RGB color for both fill and stroke operations. More...
 
void SetFillStrokeCmyk (double c, double m, double y, double k)
 Set CMYK color for both fill and stroke operations. More...
 
void MoveTo (double x, double y)
 Begin new sub-path (m)
More...
 
void MoveTo (PdfPoint pt)
 Begin new sub-path (m)
More...
 
void MoveToPolar (PdfPoint center, double radius, double alpha)
 Begin a new sub-path starting from a point on a circle. More...
 
void MoveToPolar (double radius, double alpha)
 Begin a new sub-path starting from a point on a circle with the center at the origin. More...
 
void LineTo (double x, double y)
 Append a straight line segment to the current sub-path (l). More...
 
void LineTo (PdfPoint pt)
 Append a straight line segment to the current sub-path (l). More...
 
void LineToPolar (PdfPoint center, double radius, double alpha)
 Append a straight line to the current sub-path with endpoint on a circle. More...
 
void LineToPolar (double radius, double alpha)
 Append a straight line to the current sub-path with endpoint on a circle about the origin. More...
 
void Polygon (PdfPoint[] points)
 Adds a polygon defined by an array of points to the current graphics path.
More...
 
void Rectangle (double x, double y, double width, double height)
 Append a rectangle to the current path as a complete subpath (re). More...
 
void Rectangle (PdfRectangle rc)
 Append a rectangle to the current path as a complete sub-path (re). More...
 
void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3)
 Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier control points (c or y). More...
 
void CurveTo (double x2, double y2, double x3, double y3)
 Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bézier control points (v). More...
 
void Circle (double x, double y, double radius)
 Appends a circle to the current path, given its center and radius. More...
 
void Ellipse (double x, double y, double a, double b)
 Appends an ellipse to the current path, given its center and radii. More...
 
void Ellipse (PdfRectangle rc)
 Appends an ellipse to the current path, given its bounding rectangle. More...
 
void ArcTo (double x, double y, double radius, double angleFrom, double angleTo)
 Appends a circular arc to the current path, given a center, a radius and delimited by two angles measured in degrees, counter-clockwise. More...
 
void DrawCurve (PdfPoint[] points, double tension=0.5)
 Draws a cardinal spline through a specified array of Point structures. More...
 
void DrawClosedCurve (PdfPoint[] points, double tension=0.5)
 Draws a closed cardinal spline through a specified array of Point structures. More...
 
void DrawImage (PdfImagePage image)
 Draws an image. More...
 
void DrawImage (PdfImagePage image, PdfMatrix m)
 Draws an image after applying given transformation matrix More...
 
void FitImage (PdfImagePage image)
 Scale and draw an image to cover a frame or the canvas. More...
 
void FitImage (PdfImagePage image, PdfRectangle rect)
 Scale and draw an image to cover a frame or the canvas. More...
 
void Concat (PdfMatrix m)
 Concatenates with the current transformation matrix (cm). More...
 
void Save ()
 Saves the graphics state (q)
 
void Restore ()
 Restores the graphics state (Q)
 
void Transform (double scaleX, double scaleY, double translateX, double translateY, double angle)
 Scale, translate and rotate the coordinates. More...
 
void Scale (double sx, double sy)
 Scales the coordinates in x and y directions. More...
 
void Translate (double x, double y)
 Translates the coordinates. More...
 
void Translate (PdfPoint point)
 Translates the coordinates. More...
 
void Rotate (double angle)
 Rotates the coordinates. More...
 
void Rotate (double x, double y, double angle)
 Translate, then rotate the coordinates. More...
 
void Rotate (PdfPoint pt, double angle)
 Translate, then rotate the coordinates. More...
 
void ClipPath ()
 Modify the current clipping path by intersecting it with the current path.
 
void SetLineWidth (double width)
 Set the line width in the graphics state (w) More...
 
void SetLineSolid ()
 Resets a previous dash pattern to solid line.
 
void SetLineDash (int dash, int gap=0, int phase=0)
 Sets dash and gap pattern (d). More...
 
void SetLineDash (string pattern, int phase=0)
 Sets user defined array of dashes and gaps. The pattern must be enclosed in square brackets (e.g. '[3 1 1 1]' for a dash-dot pattern). More...
 
void SetLineCap (PdfLineCap cap)
 Set the line cap style in the graphics state. More...
 
void SetLineJoin (PdfLineJoin join)
 Set the line join style in the graphics state. More...
 
void SetMiterLimit (double miterLimit)
 Set the miter limit in the graphics state. More...
 
void SetCharSpacing (double charSpace)
 Set the character spacing in unscaled text units (Tc). Initial value: 0. More...
 
void SetWordSpacing (double wordSpace)
 Set the word spacing in unscaled text units (Tw). Initial value: 0. More...
 
void SetHorzScale (double scale)
 Set the horizontal scaling. (Tz) Initial value: 100. More...
 
void SetLeading (double leading)
 Set the text leading: the vertical distance between the baselines of adjacent lines of text. (TL) More...
 
void SetRendering (PdfRendering value)
 Set the text rendering mode. More...
 
void SetFont (PdfFont font, double size)
 Sets the supplied font for subsequent text output. More...
 
void SetTextRise (double rise)
 Sets the text rise: the distance to move the baseline up or down from its default location. (Ts) More...
 
void NextLine ()
 Move to the start of the next line (T*).
 
void NextLine (double x, double y)
 Move to the start of the next line, offset from the start of the current line by (x,y). (Td) More...
 
void NextLineSetLeading (double x, double y)
 Same as NextLine except that it also sets the leading parameter in the text state. (TD) More...
 
void SetTextMatrix (PdfMatrix m)
 Sets the text matrix and the text line matrix. (Tm) More...
 
void BeginText ()
 Begin text object (BT).
 
void SetTextPos (double x, double y)
 Sets the absolute position for the next text output. More...
 
double GetTextWidth (string text)
 Computes the width of a text string without drawing it. More...
 
void DrawText (string text, bool newLine=false)
 Draws text either at the current location or at the start of the next line. More...
 
void ContinueText (string text)
 Moves to the next line and draws a text string More...
 
void DrawText (double x, double y, string text)
 Draws text at given location. More...
 
void DrawText (double x, double y, double angle, string text)
 Draws text at specified location and rotation angle. More...
 
void CenterText (double x, double y, double dx, string text)
 Centers text horizontally. More...
 
void EndText ()
 End text object (ET).
 
void DrawWatermark (string text, int fontSize=80, double alpha=0.5, int rotate=45, bool stroke=false)
 Draws a diagonal watermark with default parameters. More...
 
void DrawWatermark (string text, PdfFont font, double fontSize, Color color, double alpha=0.5, int rotate=45, bool stroke=false)
 Draws a watermark text. More...
 
void DrawText (PdfFont font, double size, double left, double bottom, string text)
 Draws a text using the specified font. More...
 
void CenterText (PdfFont font, double size, double left, double bottom, double width, string text)
 Centers text horizontally. The font size is dynamically adjusted to ensure that the specified text fits in the given width. More...
 

Properties

double Width [get, set]
 Gets the width of the canvas in logical units.
 
double Height [get, set]
 Gets the height of the canvas in logical units.
 
double FontAscent [get]
 Gets the maximum ascent height.
 
double FontDescent [get]
 Gets the maximum descent depth.
 
PdfPoint TextPos [get]
 Gets the current text position.
 
PdfPoint LinePos [get]
 Gets the current line position.
 

Detailed Description

PdfPainter composes a PDF page content stream by printing PDF commands.

Member Function Documentation

◆ AppendContent() [1/2]

void Opait.Pdf.PdfPainter.AppendContent ( byte[]  content)

Appends the specified content to the end of current content.

Parameters
contentThe content to append.

◆ AppendContent() [2/2]

void Opait.Pdf.PdfPainter.AppendContent ( PdfPage  page)

Appends the content of the specified page to this page.

Parameters
pageThe PDF page whose content will be appended to this page..

◆ ArcTo()

void Opait.Pdf.PdfPainter.ArcTo ( double  x,
double  y,
double  radius,
double  angleFrom,
double  angleTo 
)

Appends a circular arc to the current path, given a center, a radius and delimited by two angles measured in degrees, counter-clockwise.

Parameters
xThe x-coordinate of the center.
yThe y-coordinate of the center.
radiusThe radius of the arc.
angleFromThe starting angle in degrees.
angleToThe ending angle in degrees.

◆ CenterText() [1/2]

void Opait.Pdf.PdfPainter.CenterText ( double  x,
double  y,
double  dx,
string  text 
)

Centers text horizontally.

Parameters
xThe x-coordinate of drawing region.
yThe y-coordinate of drawing region.
dxThe width of the drawing region.
textThe text to center between x and x + dx.

◆ CenterText() [2/2]

void Opait.Pdf.PdfPainter.CenterText ( PdfFont  font,
double  size,
double  left,
double  bottom,
double  width,
string  text 
)

Centers text horizontally. The font size is dynamically adjusted to ensure that the specified text fits in the given width.

Parameters
fontThe font for drawing text.
sizeThe font size in points.
leftThe left coordinate of the text in PDF units.
widthThe maximum width of the rendered text.
bottomThe bottom coordinate of the text in PDF units.
textThe text to draw.

◆ Circle()

void Opait.Pdf.PdfPainter.Circle ( double  x,
double  y,
double  radius 
)

Appends a circle to the current path, given its center and radius.

Parameters
xThe x-coordinate of the center.
yThe y-coordinate of the center.
radiusThe radius of the circle.

◆ Concat()

void Opait.Pdf.PdfPainter.Concat ( PdfMatrix  m)

Concatenates with the current transformation matrix (cm).

Parameters
mThe transformation matrix to concatenate.

◆ ContinueText()

void Opait.Pdf.PdfPainter.ContinueText ( string  text)

Moves to the next line and draws a text string

Parameters
textThe text string to draw.

◆ CurveTo() [1/2]

void Opait.Pdf.PdfPainter.CurveTo ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)

Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier control points (c or y).

Parameters
x1The x-coordinate of the first control point.
y1The y-coordinate of the first control point.
x2The x-coordinate of the second control point.
y2The y-coordinate of the second control point.
x3The x-coordinate of the end point.
y3The x-coordinate of the end point.

◆ CurveTo() [2/2]

void Opait.Pdf.PdfPainter.CurveTo ( double  x2,
double  y2,
double  x3,
double  y3 
)

Append a cubic Bézier curve to the current path. The curve extends from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bézier control points (v).

Parameters
x2The x-coordinate of the second control point.
y2The y-coordinate of the second control point.
x3The x-coordinate of the end point.
y3The x-coordinate of the end point.


◆ DrawClosedCurve()

void Opait.Pdf.PdfPainter.DrawClosedCurve ( PdfPoint[]  points,
double  tension = 0.5 
)

Draws a closed cardinal spline through a specified array of Point structures.

Parameters
pointsControl points for the Bezier curve.
tensionThe tension of the cardinal spline.

◆ DrawCurve()

void Opait.Pdf.PdfPainter.DrawCurve ( PdfPoint[]  points,
double  tension = 0.5 
)

Draws a cardinal spline through a specified array of Point structures.

Parameters
pointsControl points for the Bezier curve.
tensionThe tension of the cardinal spline.

◆ DrawImage() [1/2]

void Opait.Pdf.PdfPainter.DrawImage ( PdfImagePage  image)

Draws an image.

Parameters
imageThe image to draw.

◆ DrawImage() [2/2]

void Opait.Pdf.PdfPainter.DrawImage ( PdfImagePage  image,
PdfMatrix  m 
)

Draws an image after applying given transformation matrix

Parameters
imageThe image to draw.
mThe transformation matrix to apply.

◆ DrawText() [1/4]

void Opait.Pdf.PdfPainter.DrawText ( double  x,
double  y,
double  angle,
string  text 
)

Draws text at specified location and rotation angle.

Parameters
xThe x-coordinate.
yThe y-coordinate.
angleThe angle of text in degrees.
textThe text string to draw.

◆ DrawText() [2/4]

void Opait.Pdf.PdfPainter.DrawText ( double  x,
double  y,
string  text 
)

Draws text at given location.

Parameters
xThe x-coordinate.
yThe y-coordinate.
textThe text string to draw.

◆ DrawText() [3/4]

void Opait.Pdf.PdfPainter.DrawText ( PdfFont  font,
double  size,
double  left,
double  bottom,
string  text 
)

Draws a text using the specified font.

Parameters
fontThe font for drawing text.
sizeThe font size in points.
leftThe left coordinate of the text in PDF units.
bottomThe bottom coordinate of the text in PDF units.
textThe text to draw.

◆ DrawText() [4/4]

void Opait.Pdf.PdfPainter.DrawText ( string  text,
bool  newLine = false 
)

Draws text either at the current location or at the start of the next line.

Parameters
textThe text string to draw.
newLineIf true, start the text on the next line.

◆ DrawWatermark() [1/2]

void Opait.Pdf.PdfPainter.DrawWatermark ( string  text,
int  fontSize = 80,
double  alpha = 0.5,
int  rotate = 45,
bool  stroke = false 
)

Draws a diagonal watermark with default parameters.

Parameters
textThe text to draw.
fontSizeThe maximum font size to use.
alphaThe transparency alpha constant [0-1] => [transparent-opaque]
rotateThe counterclockwise rotation about the center of the page.
strokeIf true, stoke the text, otherwise fill.

◆ DrawWatermark() [2/2]

void Opait.Pdf.PdfPainter.DrawWatermark ( string  text,
PdfFont  font,
double  fontSize,
Color  color,
double  alpha = 0.5,
int  rotate = 45,
bool  stroke = false 
)

Draws a watermark text.

Parameters
textThe text to draw.
fontThe font to use.
fontSizeThe maximum font size to use.
colorThe color of the watermark.
alphaThe transparency alpha constant [0-1] => [transparent-opaque]
rotateThe counterclockwise rotation about the center of the page.
strokeIf true, stoke the text, otherwise fill.

◆ Ellipse() [1/2]

void Opait.Pdf.PdfPainter.Ellipse ( double  x,
double  y,
double  a,
double  b 
)

Appends an ellipse to the current path, given its center and radii.

Parameters
xThe x-coordinate of the center.
yThe y-coordinate of the center.
aThe distance from center point to the right edge.
bThe distance from the center to the top edge.

◆ Ellipse() [2/2]

void Opait.Pdf.PdfPainter.Ellipse ( PdfRectangle  rc)

Appends an ellipse to the current path, given its bounding rectangle.

Parameters
rcThe rectangle that defines the ellipse.

◆ FitImage() [1/2]

void Opait.Pdf.PdfPainter.FitImage ( PdfImagePage  image)

Scale and draw an image to cover a frame or the canvas.

Parameters
imageThe image to draw.

◆ FitImage() [2/2]

void Opait.Pdf.PdfPainter.FitImage ( PdfImagePage  image,
PdfRectangle  rect 
)

Scale and draw an image to cover a frame or the canvas.

Parameters
imageThe image to draw.
rectThe rectangle to fit the image into.

◆ GetContent()

byte[] Opait.Pdf.PdfPainter.GetContent ( )

Gets the content of the page as a byte array.

Returns
The content of the page.

◆ GetTextWidth()

double Opait.Pdf.PdfPainter.GetTextWidth ( string  text)

Computes the width of a text string without drawing it.

Parameters
textThe text string to measure.
Returns
The width of the text when rendered.

◆ LineTo() [1/2]

void Opait.Pdf.PdfPainter.LineTo ( double  x,
double  y 
)

Append a straight line segment to the current sub-path (l).

Parameters
xThe x-coordinate of the ending point.
yThe y-coordinate of the ending point.

◆ LineTo() [2/2]

void Opait.Pdf.PdfPainter.LineTo ( PdfPoint  pt)

Append a straight line segment to the current sub-path (l).

Parameters
ptThe ending point of the line.

◆ LineToPolar() [1/2]

void Opait.Pdf.PdfPainter.LineToPolar ( double  radius,
double  alpha 
)

Append a straight line to the current sub-path with endpoint on a circle about the origin.

Parameters
radiusRadius of the circle.
alphaAngle between vertical axis and a line from the point to the origin.


◆ LineToPolar() [2/2]

void Opait.Pdf.PdfPainter.LineToPolar ( PdfPoint  center,
double  radius,
double  alpha 
)

Append a straight line to the current sub-path with endpoint on a circle.

Parameters
centerCenter point of the circle.
radiusRadius of the circle.
alphaAngle between vertical axis and a line from the point to the origin.


◆ MoveTo() [1/2]

void Opait.Pdf.PdfPainter.MoveTo ( double  x,
double  y 
)

Begin new sub-path (m)

Parameters
xThe starting x-coordinate.
yThe starting y-coordinate.

◆ MoveTo() [2/2]

void Opait.Pdf.PdfPainter.MoveTo ( PdfPoint  pt)

Begin new sub-path (m)

Parameters
ptThe starting point.

◆ MoveToPolar() [1/2]

void Opait.Pdf.PdfPainter.MoveToPolar ( double  radius,
double  alpha 
)

Begin a new sub-path starting from a point on a circle with the center at the origin.

Parameters
radiusRadius of the circle.
alphaAngle between vertical axis and a line from the point to the origin.

◆ MoveToPolar() [2/2]

void Opait.Pdf.PdfPainter.MoveToPolar ( PdfPoint  center,
double  radius,
double  alpha 
)

Begin a new sub-path starting from a point on a circle.

Parameters
centerCenter point of the circle.
radiusRadius of the circle.
alphaAngle between vertical axis and a line from the point to the origin.

◆ NextLine()

void Opait.Pdf.PdfPainter.NextLine ( double  x,
double  y 
)

Move to the start of the next line, offset from the start of the current line by (x,y). (Td)

Parameters
xThe x-offset.
yThe y-offset.

◆ NextLineSetLeading()

void Opait.Pdf.PdfPainter.NextLineSetLeading ( double  x,
double  y 
)

Same as NextLine except that it also sets the leading parameter in the text state. (TD)

Parameters
xThe x-offset.
yThe y-offset.

◆ Polygon()

void Opait.Pdf.PdfPainter.Polygon ( PdfPoint[]  points)

Adds a polygon defined by an array of points to the current graphics path.

Parameters
pointsSet of the points on the polygon.

◆ Rectangle() [1/2]

void Opait.Pdf.PdfPainter.Rectangle ( double  x,
double  y,
double  width,
double  height 
)

Append a rectangle to the current path as a complete subpath (re).

Parameters
xThe left coordinate.
yThe bottom coordinate.
widthThe width of the rectangle.
heightThe height of the rectangle.

◆ Rectangle() [2/2]

void Opait.Pdf.PdfPainter.Rectangle ( PdfRectangle  rc)

Append a rectangle to the current path as a complete sub-path (re).

Parameters
rcThe PdfRect to append.

◆ Rotate() [1/3]

void Opait.Pdf.PdfPainter.Rotate ( double  angle)

Rotates the coordinates.

Parameters
angleThe angle of rotation.

◆ Rotate() [2/3]

void Opait.Pdf.PdfPainter.Rotate ( double  x,
double  y,
double  angle 
)

Translate, then rotate the coordinates.

Parameters
xThe horizontal displacement.
yThe vertical displacement.
angleThe rotation angle.

◆ Rotate() [3/3]

void Opait.Pdf.PdfPainter.Rotate ( PdfPoint  pt,
double  angle 
)

Translate, then rotate the coordinates.

Parameters
ptThe displacement vector.
angleThe rotation angle.

◆ Scale()

void Opait.Pdf.PdfPainter.Scale ( double  sx,
double  sy 
)

Scales the coordinates in x and y directions.

Parameters
sxThe horizontal scale factor.
syThe vertical scale factor.

◆ SeekEnd()

long Opait.Pdf.PdfPainter.SeekEnd ( )

Goes to the end of the content stream for appends.

Returns
The new offset into the content stream.

◆ SetAlpha()

void Opait.Pdf.PdfPainter.SetAlpha ( double  alpha)

Set opacity value for non-stroking operations

Parameters
alphaOpacity value [0-1] => [transparent, opaque]

◆ SetBlendMode()

void Opait.Pdf.PdfPainter.SetBlendMode ( BlendMode  blend)

Set color blending mode.

Parameters
blendEnumerated blending methods.

◆ SetCharSpacing()

void Opait.Pdf.PdfPainter.SetCharSpacing ( double  charSpace)

Set the character spacing in unscaled text units (Tc). Initial value: 0.

Parameters
charSpaceThe character spacing to set.

◆ SetCmyk()

void Opait.Pdf.PdfPainter.SetCmyk ( double  c,
double  m,
double  y,
double  k 
)

Set CMYK color for non-stroking operations (rg).

Parameters
cThe cyan component in the range [0, 1].
mThe magenta component in the range [0, 1].
yThe yellow component in the range [0, 1].
kThe black component in the range [0, 1].

◆ SetColor() [1/2]

void Opait.Pdf.PdfPainter.SetColor ( Color  c)

Set RGB color for non-stroking operations (rg)

Parameters
cThe color to set.

◆ SetColor() [2/2]

void Opait.Pdf.PdfPainter.SetColor ( double  r,
double  g,
double  b 
)

Set RGB color for non-stroking operations (rg).

Parameters
rThe red component in the range [0,1]
gThe Green component in the range [0,1]
bThe Blue component in the range [0,1]

◆ SetContent()

void Opait.Pdf.PdfPainter.SetContent ( byte[]  content)

Sets the content of the page from the specified byte array.

Parameters
contentThe new content of the page.

◆ SetContentStream()

void Opait.Pdf.PdfPainter.SetContentStream ( MemoryStream  content)

Replaces the content stream with the specified stream.

Parameters
contentThe new content stream.

◆ SetFillStrokeCmyk()

void Opait.Pdf.PdfPainter.SetFillStrokeCmyk ( double  c,
double  m,
double  y,
double  k 
)

Set CMYK color for both fill and stroke operations.

Parameters
cThe cyan component in the range [0, 1].
mThe magenta component in the range [0, 1].
yThe yellow component in the range [0, 1].
kThe black component in the range [0, 1].

◆ SetFillStrokeColor() [1/2]

void Opait.Pdf.PdfPainter.SetFillStrokeColor ( Color  c)

Set RGB color for both filling and stroking operations.

Parameters
cThe color to set.

◆ SetFillStrokeColor() [2/2]

void Opait.Pdf.PdfPainter.SetFillStrokeColor ( double  r,
double  g,
double  b 
)

Set RGB color for both fill and stroke operations.

Parameters
rThe red component in the range [0,1]
gThe Green component in the range [0,1]
bThe Blue component in the range [0,1]

◆ SetFillStrokeGray()

void Opait.Pdf.PdfPainter.SetFillStrokeGray ( double  g)

Set gray level both fill and stroke operations.

Parameters
gThe gray component in the range [0,1].

◆ SetFont()

void Opait.Pdf.PdfPainter.SetFont ( PdfFont  font,
double  size 
)

Sets the supplied font for subsequent text output.

Parameters
fontThe font to set.
sizeThe size of the font in points.

◆ SetGray()

void Opait.Pdf.PdfPainter.SetGray ( double  g)

Set gray level for non-stroking operations (g).

Parameters
gThe gray level between 0 and 1.

◆ SetHorzScale()

void Opait.Pdf.PdfPainter.SetHorzScale ( double  scale)

Set the horizontal scaling. (Tz) Initial value: 100.

Parameters
scaleThe horizontal scaling factor.

◆ SetLeading()

void Opait.Pdf.PdfPainter.SetLeading ( double  leading)

Set the text leading: the vertical distance between the baselines of adjacent lines of text. (TL)

Parameters
leadingThe text leading to set.

Setting a new font size will reset the text leading to a default value for single spaced lines. For custom line spacing, set the text leading after the font size.

◆ SetLineCap()

void Opait.Pdf.PdfPainter.SetLineCap ( PdfLineCap  cap)

Set the line cap style in the graphics state.

Parameters
capThe PdfLineCap style to set.

◆ SetLineDash() [1/2]

void Opait.Pdf.PdfPainter.SetLineDash ( int  dash,
int  gap = 0,
int  phase = 0 
)

Sets dash and gap pattern (d).

The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The dash array’s elements are numbers that specify the lengths of alternating dashes and gaps; the numbers must be nonnegative and not all zero. The dash phase specifies the distance into the dash pattern at which to start the dash.The elements of both the dash array and the dash phase are expressed in user space units.

Parameters
dashThe dash length.
gapThe gap length, 0 means same as the dash length.
phaseThe dash phase.

◆ SetLineDash() [2/2]

void Opait.Pdf.PdfPainter.SetLineDash ( string  pattern,
int  phase = 0 
)

Sets user defined array of dashes and gaps. The pattern must be enclosed in square brackets (e.g. '[3 1 1 1]' for a dash-dot pattern).

Parameters
patternThe dash gap pattern.
phaseThe dash phase.

◆ SetLineJoin()

void Opait.Pdf.PdfPainter.SetLineJoin ( PdfLineJoin  join)

Set the line join style in the graphics state.

Parameters
joinThe PdfLineJoin style to set.

◆ SetLineWidth()

void Opait.Pdf.PdfPainter.SetLineWidth ( double  width)

Set the line width in the graphics state (w)

Parameters
widthThe line width.

◆ SetMiterLimit()

void Opait.Pdf.PdfPainter.SetMiterLimit ( double  miterLimit)

Set the miter limit in the graphics state.

Parameters
miterLimitThe miter limit to set.

◆ SetRendering()

void Opait.Pdf.PdfPainter.SetRendering ( PdfRendering  value)

Set the text rendering mode.

Parameters
valueThe PdfRendering mode to set.

◆ SetStrokeAlpha()

void Opait.Pdf.PdfPainter.SetStrokeAlpha ( double  alpha)

Set opacity value for stroking operations

Parameters
alphaOpacity value [0-1] => [transparent, opaque]

◆ SetStrokeCmyk()

void Opait.Pdf.PdfPainter.SetStrokeCmyk ( double  c,
double  m,
double  y,
double  k 
)

Set CMYK color for stroking operations (RG).

Parameters
cThe cyan component in the range [0, 1].
mThe magenta component in the range [0, 1].
yThe yellow component in the range [0, 1].
kThe black component in the range [0, 1].

◆ SetStrokeColor() [1/2]

void Opait.Pdf.PdfPainter.SetStrokeColor ( Color  c)

Set RGB color for stroking operations (RG).

Parameters
cThe color to set.

◆ SetStrokeColor() [2/2]

void Opait.Pdf.PdfPainter.SetStrokeColor ( double  r,
double  g,
double  b 
)

Set RGB color for stroking operations (RG)

Parameters
rThe red component in the range [0,1]
gThe Green component in the range [0,1]
bThe Blue component in the range [0,1]

◆ SetStrokeGray()

void Opait.Pdf.PdfPainter.SetStrokeGray ( double  g)

Set gray level for stroking operations (G).

Parameters
gThe gray level between 0 and 1.

◆ SetTextMatrix()

void Opait.Pdf.PdfPainter.SetTextMatrix ( PdfMatrix  m)

Sets the text matrix and the text line matrix. (Tm)

Parameters
mThe text matrix to set.

◆ SetTextPos()

void Opait.Pdf.PdfPainter.SetTextPos ( double  x,
double  y 
)

Sets the absolute position for the next text output.

Parameters
xThe x-coordinate.
yThe y-coordinate.

◆ SetTextRise()

void Opait.Pdf.PdfPainter.SetTextRise ( double  rise)

Sets the text rise: the distance to move the baseline up or down from its default location. (Ts)

Parameters
riseThe text rise to set.

◆ SetWordSpacing()

void Opait.Pdf.PdfPainter.SetWordSpacing ( double  wordSpace)

Set the word spacing in unscaled text units (Tw). Initial value: 0.

Parameters
wordSpaceThe word spacing to set.

◆ Transform()

void Opait.Pdf.PdfPainter.Transform ( double  scaleX,
double  scaleY,
double  translateX,
double  translateY,
double  angle 
)

Scale, translate and rotate the coordinates.

Parameters
scaleXThe horizontal scale factor.
scaleYThe vertical scale factor.
translateXThe horizontal displacement.
translateYThe vertical displacement.
angleThe angle of rotation.

◆ Translate() [1/2]

void Opait.Pdf.PdfPainter.Translate ( double  x,
double  y 
)

Translates the coordinates.

Parameters
xThe horizontal displacement.
yThe vertical displacement.

◆ Translate() [2/2]

void Opait.Pdf.PdfPainter.Translate ( PdfPoint  point)

Translates the coordinates.

Parameters
pointThe displacement point.