Table of Contents

Class PdfContentByte

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

PdfContentByte is an object containing the user positioned text and graphic contents of a page. It knows how to apply the proper font encoding.

public class PdfContentByte
Inheritance
PdfContentByte
Derived
Inherited Members

Constructors

PdfContentByte(PdfWriter)

public PdfContentByte(PdfWriter wr)

Parameters

wr PdfWriter

Fields

ALIGN_CENTER

The alignement is center

public const int ALIGN_CENTER = 1

Field Value

int

ALIGN_LEFT

The alignement is left

public const int ALIGN_LEFT = 0

Field Value

int

ALIGN_RIGHT

The alignement is right

public const int ALIGN_RIGHT = 2

Field Value

int

Content

This is the actual content

protected ByteBuffer Content

Field Value

ByteBuffer

LINE_CAP_BUTT

A possible line cap value

public const int LINE_CAP_BUTT = 0

Field Value

int

LINE_CAP_PROJECTING_SQUARE

A possible line cap value

public const int LINE_CAP_PROJECTING_SQUARE = 2

Field Value

int

LINE_CAP_ROUND

A possible line cap value

public const int LINE_CAP_ROUND = 1

Field Value

int

LINE_JOIN_BEVEL

A possible line join value

public const int LINE_JOIN_BEVEL = 2

Field Value

int

LINE_JOIN_MITER

A possible line join value

public const int LINE_JOIN_MITER = 0

Field Value

int

LINE_JOIN_ROUND

A possible line join value

public const int LINE_JOIN_ROUND = 1

Field Value

int

LayerDepth

The list were we save/restore the layer depth

protected List<int> LayerDepth

Field Value

List<int>

Pdf

This is the PdfDocument

protected PdfDocument Pdf

Field Value

PdfDocument

Separator

The separator between commands.

protected int Separator

Field Value

int

State

This is the GraphicState in use

protected PdfContentByte.GraphicState State

Field Value

PdfContentByte.GraphicState

StateList

The list were we save/restore the state

protected List<PdfContentByte.GraphicState> StateList

Field Value

List<PdfContentByte.GraphicState>

TEXT_RENDER_MODE_CLIP

A possible text rendering value

public const int TEXT_RENDER_MODE_CLIP = 7

Field Value

int

TEXT_RENDER_MODE_FILL

A possible text rendering value

public const int TEXT_RENDER_MODE_FILL = 0

Field Value

int

TEXT_RENDER_MODE_FILL_CLIP

A possible text rendering value

public const int TEXT_RENDER_MODE_FILL_CLIP = 4

Field Value

int

TEXT_RENDER_MODE_FILL_STROKE

A possible text rendering value

public const int TEXT_RENDER_MODE_FILL_STROKE = 2

Field Value

int

TEXT_RENDER_MODE_FILL_STROKE_CLIP

A possible text rendering value

public const int TEXT_RENDER_MODE_FILL_STROKE_CLIP = 6

Field Value

int

TEXT_RENDER_MODE_INVISIBLE

A possible text rendering value

public const int TEXT_RENDER_MODE_INVISIBLE = 3

Field Value

int

TEXT_RENDER_MODE_STROKE

A possible text rendering value

public const int TEXT_RENDER_MODE_STROKE = 1

Field Value

int

TEXT_RENDER_MODE_STROKE_CLIP

A possible text rendering value

public const int TEXT_RENDER_MODE_STROKE_CLIP = 5

Field Value

int

Writer

membervariables

protected PdfWriter Writer

Field Value

PdfWriter

Properties

CharacterSpacing

Gets the current character spacing.

public float CharacterSpacing { get; }

Property Value

float

the current character spacing

Duplicate

Gets a duplicate of this PdfContentByte . All the members are copied by reference but the buffer stays different.

public virtual PdfContentByte Duplicate { get; }

Property Value

PdfContentByte

a copy of this PdfContentByte

HorizontalScaling

Gets the current character spacing.

public float HorizontalScaling { get; }

Property Value

float

the current character spacing

InternalBuffer

Gets the internal buffer.

public ByteBuffer InternalBuffer { get; }

Property Value

ByteBuffer

the internal buffer

Leading

Gets the current text leading.

public float Leading { get; }

Property Value

float

the current text leading

PdfDocument

Gets the PdfDocument in use by this object.

public PdfDocument PdfDocument { get; }

Property Value

PdfDocument

the PdfDocument in use by this object

PdfWriter

Gets the PdfWriter in use by this object.

public PdfWriter PdfWriter { get; }

Property Value

PdfWriter

the PdfWriter in use by this object

RootOutline

Gets the root outline.

public PdfOutline RootOutline { get; }

Property Value

PdfOutline

the root outline

WordSpacing

Gets the current word spacing.

public float WordSpacing { get; }

Property Value

float

the current word spacing

Xtlm

Gets the x position of the text line matrix.

public float Xtlm { get; }

Property Value

float

the x position of the text line matrix

Ytlm

Gets the y position of the text line matrix.

public float Ytlm { get; }

Property Value

float

the y position of the text line matrix

Methods

Add(PdfContentByte)

public void Add(PdfContentByte other)

Parameters

other PdfContentByte

AddImage(Image)

Adds an Image to the page. The Image must have absolute positioning. @throws DocumentException if the Image does not have absolute positioning

public virtual void AddImage(Image image)

Parameters

image Image

the Image object

AddImage(Image, bool)

Adds an Image to the page. The Image must have absolute positioning. The image can be placed inline. @throws DocumentException if the Image does not have absolute positioning

public virtual void AddImage(Image image, bool inlineImage)

Parameters

image Image

the Image object

inlineImage bool

true to place this image inline, false otherwise

AddImage(Image, float, float, float, float, float, float)

Adds an Image to the page. The positioning of the Image is done with the transformation matrix. To position an image at (x,y) use AddImage(image, image_width, 0, 0, image_height, x, y). @throws DocumentException on error

public virtual void AddImage(Image image, float a, float b, float c, float d, float e, float f)

Parameters

image Image

the Image object

a float

an element of the transformation matrix

b float

an element of the transformation matrix

c float

an element of the transformation matrix

d float

an element of the transformation matrix

e float

an element of the transformation matrix

f float

an element of the transformation matrix

AddImage(Image, float, float, float, float, float, float, bool)

Adds an Image to the page. The positioning of the Image is done with the transformation matrix. To position an image at (x,y) use AddImage(image, image_width, 0, 0, image_height, x, y). The image can be placed inline. @throws DocumentException on error

public virtual void AddImage(Image image, float a, float b, float c, float d, float e, float f, bool inlineImage)

Parameters

image Image

the Image object

a float

an element of the transformation matrix

b float

an element of the transformation matrix

c float

an element of the transformation matrix

d float

an element of the transformation matrix

e float

an element of the transformation matrix

f float

an element of the transformation matrix

inlineImage bool

true to place this image inline, false otherwise

AddOutline(PdfOutline, string)

Adds a named outline to the document.

public void AddOutline(PdfOutline outline, string name)

Parameters

outline PdfOutline

the outline

name string

the name for the local destination

AddPsxObject(PdfPsxObject)

Adds a PostScript XObject to this content.

public void AddPsxObject(PdfPsxObject psobject)

Parameters

psobject PdfPsxObject

the object

AddTemplate(PdfTemplate, float, float)

Adds a template to this content.

public void AddTemplate(PdfTemplate pdfTemplate, float x, float y)

Parameters

pdfTemplate PdfTemplate

the template

x float

the x location of this template

y float

the y location of this template

AddTemplate(PdfTemplate, float, float, float, float, float, float)

Adds a template to this content.

public virtual void AddTemplate(PdfTemplate pdfTemplate, float a, float b, float c, float d, float e, float f)

Parameters

pdfTemplate PdfTemplate

the template

a float

an element of the transformation matrix

b float

an element of the transformation matrix

c float

an element of the transformation matrix

d float

an element of the transformation matrix

e float

an element of the transformation matrix

f float

an element of the transformation matrix

Arc(float, float, float, float, float, float)

Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, starting at startAng degrees and covering extent degrees. Angles start with 0 to the right (+x) and increase counter-clockwise.

public void Arc(float x1, float y1, float x2, float y2, float startAng, float extent)

Parameters

x1 float

a corner of the enclosing rectangle

y1 float

a corner of the enclosing rectangle

x2 float

a corner of the enclosing rectangle

y2 float

a corner of the enclosing rectangle

startAng float

starting angle in degrees

extent float

angle extent in degrees

BeginLayer(IPdfOcg)

Begins a graphic block whose visibility is controled by the layer . Blocks can be nested. Each block must be terminated by an {@link #endLayer()}. Note that nested layers with {@link PdfLayer#addChild(PdfLayer)} only require a single call to this method and a single call to {@link #endLayer()}; all the nesting control is built in.

public void BeginLayer(IPdfOcg layer)

Parameters

layer IPdfOcg

the layer

BeginMarkedContentSequence(PdfName)

This is just a shorthand to beginMarkedContentSequence(tag, null, false) .

public void BeginMarkedContentSequence(PdfName tag)

Parameters

tag PdfName

the tag

BeginMarkedContentSequence(PdfName, PdfDictionary, bool)

Begins a marked content sequence. If property is null the mark will be of the type BMC otherwise it will be BDC . to include the property in the resource dictionary with the possibility of reusing

public void BeginMarkedContentSequence(PdfName tag, PdfDictionary property, bool inline)

Parameters

tag PdfName

the tag

property PdfDictionary

the property

inline bool

true to include the property in the content or false

BeginMarkedContentSequence(PdfStructureElement)

Begins a marked content sequence. This sequence will be tagged with the structure struc . The same structure can be used several times to connect text that belongs to the same logical segment but is in a different location, like the same paragraph crossing to another page, for example.

public void BeginMarkedContentSequence(PdfStructureElement struc)

Parameters

struc PdfStructureElement

the tagging structure

BeginText()

Starts the writing of text.

public void BeginText()

BezierArc(float, float, float, float, float, float)

Generates an array of bezier curves to draw an arc. (x1, y1) and (x2, y2) are the corners of the enclosing rectangle. Angles, measured in degrees, start with 0 to the right (the positive X axis) and increase counter-clockwise. The arc extends from startAng to startAng+extent. I.e. startAng=0 and extent=180 yields an openside-down semi-circle. The resulting coordinates are of the form float[]{x1,y1,x2,y2,x3,y3, x4,y4} such that the curve goes from (x1, y1) to (x4, y4) with (x2, y2) and (x3, y3) as their respective Bezier control points. Note: this code was taken from ReportLab (www.reportlab.com), an excelent PDF generator for Python.

public static IList<double[]> BezierArc(float x1, float y1, float x2, float y2, float startAng, float extent)

Parameters

x1 float

a corner of the enclosing rectangle

y1 float

a corner of the enclosing rectangle

x2 float

a corner of the enclosing rectangle

y2 float

a corner of the enclosing rectangle

startAng float

starting angle in degrees

extent float

angle extent in degrees

Returns

IList<double[]>

a list of float[] with the bezier curves

CheckWriter()

Check if we have a valid PdfWriter.

protected virtual void CheckWriter()

Circle(float, float, float)

Draws a circle. The endpoint will (x+r, y).

public void Circle(float x, float y, float r)

Parameters

x float

x center of circle

y float

y center of circle

r float

radius of circle

Clip()

public void Clip()

ClosePath()

public void ClosePath()

ClosePathEoFillStroke()

public void ClosePathEoFillStroke()

ClosePathFillStroke()

public void ClosePathFillStroke()

ClosePathStroke()

public void ClosePathStroke()

ConcatCtm(float, float, float, float, float, float)

Concatenate a matrix to the current transformation matrix.

public void ConcatCtm(float a, float b, float c, float d, float e, float f)

Parameters

a float

an element of the transformation matrix

b float

an element of the transformation matrix

c float

an element of the transformation matrix

d float

an element of the transformation matrix

e float

an element of the transformation matrix

f float

an element of the transformation matrix

CreateAppearance(float, float)

Creates a new appearance to be used with form fields.

public PdfAppearance CreateAppearance(float width, float height)

Parameters

width float

the bounding box width

height float

the bounding box height

Returns

PdfAppearance

the appearance created

CreatePattern(float, float)

Create a new colored tiling pattern. Variables xstep and ystep are set to the same values of width and height.

public PdfPatternPainter CreatePattern(float width, float height)

Parameters

width float

the width of the pattern

height float

the height of the pattern

Returns

PdfPatternPainter

the PdfPatternPainter where the pattern will be created

CreatePattern(float, float, float, float)

Create a new colored tiling pattern. May be either positive or negative, but not zero. May be either positive or negative, but not zero.

public PdfPatternPainter CreatePattern(float width, float height, float xstep, float ystep)

Parameters

width float

the width of the pattern

height float

the height of the pattern

xstep float

the desired horizontal spacing between pattern cells.

ystep float

the desired vertical spacing between pattern cells.

Returns

PdfPatternPainter

the PdfPatternPainter where the pattern will be created

CreatePattern(float, float, float, float, BaseColor)

Create a new uncolored tiling pattern. May be either positive or negative, but not zero. May be either positive or negative, but not zero.

public PdfPatternPainter CreatePattern(float width, float height, float xstep, float ystep, BaseColor color)

Parameters

width float

the width of the pattern

height float

the height of the pattern

xstep float

the desired horizontal spacing between pattern cells.

ystep float

the desired vertical spacing between pattern cells.

color BaseColor

the default color. Can be null

Returns

PdfPatternPainter

the PdfPatternPainter where the pattern will be created

CreatePattern(float, float, BaseColor)

Create a new uncolored tiling pattern. Variables xstep and ystep are set to the same values of width and height.

public PdfPatternPainter CreatePattern(float width, float height, BaseColor color)

Parameters

width float

the width of the pattern

height float

the height of the pattern

color BaseColor

the default color. Can be null

Returns

PdfPatternPainter

the PdfPatternPainter where the pattern will be created

CreateTemplate(float, float)

Creates a new template. Creates a new template that is nothing more than a form XObject. This template can be included in this PdfContentByte or in another template. Templates are only written to the output when the document is closed permitting things like showing text in the first page that is only defined in the last page.

public PdfTemplate CreateTemplate(float width, float height)

Parameters

width float

the bounding box width

height float

the bounding box height

Returns

PdfTemplate

the templated created

CurveFromTo(float, float, float, float)

public void CurveFromTo(float x1, float y1, float x3, float y3)

Parameters

x1 float
y1 float
x3 float
y3 float

CurveTo(double, double, double, double, double, double)

public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)

Parameters

x1 double
y1 double
x2 double
y2 double
x3 double
y3 double

CurveTo(float, float, float, float)

public void CurveTo(float x2, float y2, float x3, float y3)

Parameters

x2 float
y2 float
x3 float
y3 float

CurveTo(float, float, float, float, float, float)

public void CurveTo(float x1, float y1, float x2, float y2, float x3, float y3)

Parameters

x1 float
y1 float
x2 float
y2 float
x3 float
y3 float

DrawButton(float, float, float, float, string, BaseFont, float)

public void DrawButton(float llx, float lly, float urx, float ury, string text, BaseFont bf, float size)

Parameters

llx float
lly float
urx float
ury float
text string
bf BaseFont
size float

DrawRadioField(float, float, float, float, bool)

public void DrawRadioField(float llx, float lly, float urx, float ury, bool on)

Parameters

llx float
lly float
urx float
ury float
on bool

DrawTextField(float, float, float, float)

public void DrawTextField(float llx, float lly, float urx, float ury)

Parameters

llx float
lly float
urx float
ury float

Ellipse(float, float, float, float)

Draws an ellipse inscribed within the rectangle x1,y1,x2,y2.

public void Ellipse(float x1, float y1, float x2, float y2)

Parameters

x1 float

a corner of the enclosing rectangle

y1 float

a corner of the enclosing rectangle

x2 float

a corner of the enclosing rectangle

y2 float

a corner of the enclosing rectangle

EndLayer()

Ends a layer controled graphic block. It will end the most recent open block.

public void EndLayer()

EndMarkedContentSequence()

Ends a marked content sequence

public void EndMarkedContentSequence()

EndText()

Ends the writing of text and makes the current font invalid.

public void EndText()

EoClip()

public void EoClip()

EoFill()

public void EoFill()

EoFillStroke()

public void EoFillStroke()

Fill()

public void Fill()

FillStroke()

public void FillStroke()

GetEffectiveStringWidth(string, bool)

public float GetEffectiveStringWidth(string text, bool kerned)

Parameters

text string
kerned bool

Returns

float

GetKernArray(string, BaseFont)

Constructs a kern array for a text in a certain font

public static PdfTextArray GetKernArray(string text, BaseFont font)

Parameters

text string

the text

font BaseFont

the font

Returns

PdfTextArray

a PdfTextArray

LineTo(double, double)

public void LineTo(double x, double y)

Parameters

x double
y double

LineTo(float, float)

public void LineTo(float x, float y)

Parameters

x float
y float

LocalDestination(string, PdfDestination)

The local destination to where a local goto with the same name will jump. false if a local destination with the same name already exists

public bool LocalDestination(string name, PdfDestination destination)

Parameters

name string

the name of this local destination

destination PdfDestination

the PdfDestination with the jump coordinates

Returns

bool

true if the local destination was added,

LocalGoto(string, float, float, float, float)

Implements a link to other part of the document. The jump will be made to a local destination with the same name, that must exist.

public void LocalGoto(string name, float llx, float lly, float urx, float ury)

Parameters

name string

the name for this link

llx float

the lower left x corner of the activation area

lly float

the lower left y corner of the activation area

urx float

the upper right x corner of the activation area

ury float

the upper right y corner of the activation area

MoveText(float, float)

Moves to the start of the next line, offset from the start of the current line.

public void MoveText(float x, float y)

Parameters

x float

x-coordinate of the new current point

y float

y-coordinate of the new current point

MoveTextWithLeading(float, float)

Moves to the start of the next line, offset from the start of the current line. As a side effect, this sets the leading parameter in the text state.

public void MoveTextWithLeading(float x, float y)

Parameters

x float

offset of the new current point

y float

y-coordinate of the new current point

MoveTo(double, double)

public void MoveTo(double x, double y)

Parameters

x double
y double

NewPath()

public void NewPath()

NewlineShowText(float, float, string)

Moves to the next line and shows text string, using the given values of the character and word spacing parameters.

public void NewlineShowText(float wordSpacing, float charSpacing, string text)

Parameters

wordSpacing float

a parameter

charSpacing float

a parameter

text string

the text to write

NewlineShowText(string)

Moves to the next line and shows text .

public void NewlineShowText(string text)

Parameters

text string

the text to write

NewlineText()

Moves to the start of the next line.

public void NewlineText()

PaintShading(PdfShading)

Paints using a shading object.

public virtual void PaintShading(PdfShading shading)

Parameters

shading PdfShading

the shading object

PaintShading(PdfShadingPattern)

Paints using a shading pattern.

public virtual void PaintShading(PdfShadingPattern shading)

Parameters

shading PdfShadingPattern

the shading pattern

Rectangle(float, float, float, float)

public void Rectangle(float x, float y, float w, float h)

Parameters

x float
y float
w float
h float

Rectangle(Rectangle)

public void Rectangle(Rectangle rectangle)

Parameters

rectangle Rectangle

RemoteGoto(string, int, float, float, float, float)

Implements a link to another document.

public void RemoteGoto(string filename, int page, float llx, float lly, float urx, float ury)

Parameters

filename string

the filename for the remote document

page int

the page to jump to

llx float

the lower left x corner of the activation area

lly float

the lower left y corner of the activation area

urx float

the upper right x corner of the activation area

ury float

the upper right y corner of the activation area

RemoteGoto(string, string, float, float, float, float)

Implements a link to another document.

public static void RemoteGoto(string filename, string name, float llx, float lly, float urx, float ury)

Parameters

filename string

the filename for the remote document

name string

the name to jump to

llx float

the lower left x corner of the activation area

lly float

the lower left y corner of the activation area

urx float

the upper right x corner of the activation area

ury float

the upper right y corner of the activation area

Reset()

Closes the path and strokes it.

public void Reset()

Reset(bool)

Makes this PdfContentByte empty. @since 2.1.6

public void Reset(bool validateContent)

Parameters

validateContent bool

will call sanityCheck() if true.

ResetCmykColorFill()

public virtual void ResetCmykColorFill()

ResetCmykColorStroke()

public virtual void ResetCmykColorStroke()

ResetGrayFill()

public virtual void ResetGrayFill()

ResetGrayStroke()

public virtual void ResetGrayStroke()

ResetRgbColorFill()

public virtual void ResetRgbColorFill()

ResetRgbColorStroke()

public virtual void ResetRgbColorStroke()

RestoreState()

Restores the graphic state. saveState and restoreState must be balanced.

public void RestoreState()

RoundRectangle(float, float, float, float, float)

Adds a round rectangle to the current path.

public void RoundRectangle(float x, float y, float w, float h, float r)

Parameters

x float

x-coordinate of the starting point

y float

y-coordinate of the starting point

w float

width

h float

height

r float

radius of the arc corner

SanityCheck()

Checks for any dangling state: Mismatched save/restore state, begin/end text, begin/end layer, or begin/end marked content sequence. If found, this function will throw. This function is called automatically during a reset() (from Document.newPage() for example), and before writing itself out in toPdf(). One possible cause: not calling myPdfGraphics2D.dispose() will leave dangling saveState() calls. @since 2.1.6 @throws IllegalPdfSyntaxException (a runtime exception)

public void SanityCheck()

SaveState()

Saves the graphic state. saveState and restoreState must be balanced.

public void SaveState()

SetAction(PdfAction, float, float, float, float)

Implements an action in an area.

public virtual void SetAction(PdfAction action, float llx, float lly, float urx, float ury)

Parameters

action PdfAction

the PdfAction

llx float

the lower left x corner of the activation area

lly float

the lower left y corner of the activation area

urx float

the upper right x corner of the activation area

ury float

the upper right y corner of the activation area

SetCharacterSpacing(float)

Sets the character spacing parameter.

public void SetCharacterSpacing(float value)

Parameters

value float

a parameter

SetCmykColorFill(int, int, int, int)

public virtual void SetCmykColorFill(int cyan, int magenta, int yellow, int black)

Parameters

cyan int
magenta int
yellow int
black int

SetCmykColorFillF(float, float, float, float)

public virtual void SetCmykColorFillF(float cyan, float magenta, float yellow, float black)

Parameters

cyan float
magenta float
yellow float
black float

SetCmykColorStroke(int, int, int, int)

public virtual void SetCmykColorStroke(int cyan, int magenta, int yellow, int black)

Parameters

cyan int
magenta int
yellow int
black int

SetCmykColorStrokeF(float, float, float, float)

public virtual void SetCmykColorStrokeF(float cyan, float magenta, float yellow, float black)

Parameters

cyan float
magenta float
yellow float
black float

SetColorFill(BaseColor)

Sets the fill color. color can be an ExtendedColor .

public virtual void SetColorFill(BaseColor value)

Parameters

value BaseColor

the color

SetColorFill(PdfSpotColor, float)

Sets the fill color to a spot color. is 100% color

public virtual void SetColorFill(PdfSpotColor sp, float tint)

Parameters

sp PdfSpotColor

the spot color

tint float

the tint for the spot color. 0 is no color and 1

SetColorStroke(BaseColor)

Sets the stroke color. color can be an ExtendedColor .

public virtual void SetColorStroke(BaseColor value)

Parameters

value BaseColor

the color

SetColorStroke(PdfSpotColor, float)

Sets the stroke color to a spot color. is 100% color

public virtual void SetColorStroke(PdfSpotColor sp, float tint)

Parameters

sp PdfSpotColor

the spot color

tint float

the tint for the spot color. 0 is no color and 1

SetDefaultColorspace(PdfName, PdfObject)

Sets the default colorspace. or PdfName.DEFAULTCMYK

public virtual void SetDefaultColorspace(PdfName name, PdfObject obj)

Parameters

name PdfName

the name of the colorspace. It can be PdfName.DEFAULTGRAY , PdfName.DEFAULTRGB

obj PdfObject

the colorspace. A null or PdfNull removes any colorspace with the same name

SetFlatness(float)

public void SetFlatness(float value)

Parameters

value float

SetFontAndSize(BaseFont, float)

Set the font and the size for the subsequent text writing.

public virtual void SetFontAndSize(BaseFont bf, float size)

Parameters

bf BaseFont

the font

size float

the font size in points

SetGState(PdfGState)

Draws a TextField.

public void SetGState(PdfGState gstate)

Parameters

gstate PdfGState

the graphic state

SetGrayFill(float)

public virtual void SetGrayFill(float value)

Parameters

value float

SetGrayStroke(float)

public virtual void SetGrayStroke(float value)

Parameters

value float

SetHorizontalScaling(float)

Sets the horizontal scaling parameter.

public void SetHorizontalScaling(float value)

Parameters

value float

a parameter

SetLeading(float)

Adds the content of another PdfContent -object to this object.

public void SetLeading(float v)

Parameters

v float

another PdfByteContent -object

SetLineCap(int)

public void SetLineCap(int value)

Parameters

value int

SetLineDash(float)

public void SetLineDash(float value)

Parameters

value float

SetLineDash(float, float)

public void SetLineDash(float unitsOn, float phase)

Parameters

unitsOn float
phase float

SetLineDash(float, float, float)

public void SetLineDash(float unitsOn, float unitsOff, float phase)

Parameters

unitsOn float
unitsOff float
phase float

SetLineDash(float[], float)

public void SetLineDash(float[] array, float phase)

Parameters

array float[]
phase float

SetLineJoin(int)

public void SetLineJoin(int value)

Parameters

value int

SetLineWidth(float)

public void SetLineWidth(float value)

Parameters

value float

SetLiteral(char)

Outputs a char directly to the content.

public void SetLiteral(char c)

Parameters

c char

the char

SetLiteral(float)

Outputs a float directly to the content.

public void SetLiteral(float n)

Parameters

n float

the float

SetLiteral(string)

Outputs a string directly to the content.

public void SetLiteral(string s)

Parameters

s string

the string

SetMiterLimit(float)

public void SetMiterLimit(float value)

Parameters

value float

SetPatternFill(PdfPatternPainter)

Sets the fill color to a pattern. The pattern can be colored or uncolored.

public virtual void SetPatternFill(PdfPatternPainter p)

Parameters

p PdfPatternPainter

the pattern

SetPatternFill(PdfPatternPainter, BaseColor)

Sets the fill color to an uncolored pattern.

public virtual void SetPatternFill(PdfPatternPainter p, BaseColor color)

Parameters

p PdfPatternPainter

the pattern

color BaseColor

the color of the pattern

SetPatternFill(PdfPatternPainter, BaseColor, float)

Sets the fill color to an uncolored pattern.

public virtual void SetPatternFill(PdfPatternPainter p, BaseColor color, float tint)

Parameters

p PdfPatternPainter

the pattern

color BaseColor

the color of the pattern

tint float

the tint if the color is a spot color, ignored otherwise

SetPatternStroke(PdfPatternPainter)

Sets the stroke color to a pattern. The pattern can be colored or uncolored.

public virtual void SetPatternStroke(PdfPatternPainter p)

Parameters

p PdfPatternPainter

the pattern

SetPatternStroke(PdfPatternPainter, BaseColor)

Sets the stroke color to an uncolored pattern.

public virtual void SetPatternStroke(PdfPatternPainter p, BaseColor color)

Parameters

p PdfPatternPainter

the pattern

color BaseColor

the color of the pattern

SetPatternStroke(PdfPatternPainter, BaseColor, float)

Sets the stroke color to an uncolored pattern.

public virtual void SetPatternStroke(PdfPatternPainter p, BaseColor color, float tint)

Parameters

p PdfPatternPainter

the pattern

color BaseColor

the color of the pattern

tint float

the tint if the color is a spot color, ignored otherwise

SetRgbColorFill(int, int, int)

public virtual void SetRgbColorFill(int red, int green, int blue)

Parameters

red int
green int
blue int

SetRgbColorFillF(float, float, float)

public virtual void SetRgbColorFillF(float red, float green, float blue)

Parameters

red float
green float
blue float

SetRgbColorStroke(int, int, int)

public virtual void SetRgbColorStroke(int red, int green, int blue)

Parameters

red int
green int
blue int

SetRgbColorStrokeF(float, float, float)

public virtual void SetRgbColorStrokeF(float red, float green, float blue)

Parameters

red float
green float
blue float

SetShadingFill(PdfShadingPattern)

Sets the shading fill pattern.

public virtual void SetShadingFill(PdfShadingPattern shading)

Parameters

shading PdfShadingPattern

the shading pattern

SetShadingStroke(PdfShadingPattern)

Sets the shading stroke pattern

public virtual void SetShadingStroke(PdfShadingPattern shading)

Parameters

shading PdfShadingPattern

the shading pattern

SetTextMatrix(float, float)

Changes the text matrix. The first four parameters are {1,0,0,1}. Remark: this operation also initializes the current point position.

public void SetTextMatrix(float x, float y)

Parameters

x float

operand 3,1 in the matrix

y float

operand 3,2 in the matrix

SetTextMatrix(float, float, float, float, float, float)

Changes the text matrix. Remark: this operation also initializes the current point position.

public void SetTextMatrix(float a, float b, float c, float d, float x, float y)

Parameters

a float

operand 1,1 in the matrix

b float

operand 1,2 in the matrix

c float

operand 2,1 in the matrix

d float

operand 2,2 in the matrix

x float

operand 3,1 in the matrix

y float

operand 3,2 in the matrix

SetTextRenderingMode(int)

Sets the text rendering parameter.

public void SetTextRenderingMode(int value)

Parameters

value int

a parameter

SetTextRise(float)

Sets the text rise parameter. This allows to write text in subscript or basescript mode.

public void SetTextRise(float value)

Parameters

value float

a parameter

SetWordSpacing(float)

Sets the word spacing parameter.

public void SetWordSpacing(float value)

Parameters

value float

ShowText(string)

Shows the text .

public void ShowText(string text)

Parameters

text string

the text to write

ShowText(PdfTextArray)

Show an array of text.

public void ShowText(PdfTextArray text)

Parameters

text PdfTextArray

array of text

ShowTextAligned(int, string, float, float, float)

Shows text right, left or center aligned with rotation.

public void ShowTextAligned(int alignment, string text, float x, float y, float rotation)

Parameters

alignment int

the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT

text string

the text to show

x float

the x pivot position

y float

the y pivot position

rotation float

the rotation to be applied in degrees counterclockwise

ShowTextAlignedKerned(int, string, float, float, float)

Shows text kerned right, left or center aligned with rotation.

public void ShowTextAlignedKerned(int alignment, string text, float x, float y, float rotation)

Parameters

alignment int

the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT

text string

the text to show

x float

the x pivot position

y float

the y pivot position

rotation float

the rotation to be applied in degrees counterclockwise

ShowTextKerned(string)

Shows the text kerned.

public void ShowTextKerned(string text)

Parameters

text string

the text to write

Stroke()

public void Stroke()

ToPdf(PdfWriter)

public byte[] ToPdf(PdfWriter writer)

Parameters

writer PdfWriter

Returns

byte[]

ToString()

public override string ToString()

Returns

string

VariableRectangle(Rectangle)

Adds a variable width border to the current path. Only use if {@link com.lowagie.text.Rectangle#isUseVariableBorders() Rectangle.isUseVariableBorders} = true.

public void VariableRectangle(Rectangle rect)

Parameters

rect Rectangle

a Rectangle