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
ALIGN_LEFT
The alignement is left
public const int ALIGN_LEFT = 0
Field Value
ALIGN_RIGHT
The alignement is right
public const int ALIGN_RIGHT = 2
Field Value
Content
This is the actual content
protected ByteBuffer Content
Field Value
LINE_CAP_BUTT
A possible line cap value
public const int LINE_CAP_BUTT = 0
Field Value
LINE_CAP_PROJECTING_SQUARE
A possible line cap value
public const int LINE_CAP_PROJECTING_SQUARE = 2
Field Value
LINE_CAP_ROUND
A possible line cap value
public const int LINE_CAP_ROUND = 1
Field Value
LINE_JOIN_BEVEL
A possible line join value
public const int LINE_JOIN_BEVEL = 2
Field Value
LINE_JOIN_MITER
A possible line join value
public const int LINE_JOIN_MITER = 0
Field Value
LINE_JOIN_ROUND
A possible line join value
public const int LINE_JOIN_ROUND = 1
Field Value
LayerDepth
The list were we save/restore the layer depth
protected List<int> LayerDepth
Field Value
This is the PdfDocument
protected PdfDocument Pdf
Field Value
Separator
The separator between commands.
protected int Separator
Field Value
State
This is the GraphicState in use
protected PdfContentByte.GraphicState State
Field Value
StateList
The list were we save/restore the state
protected List<PdfContentByte.GraphicState> StateList
Field Value
TEXT_RENDER_MODE_CLIP
A possible text rendering value
public const int TEXT_RENDER_MODE_CLIP = 7
Field Value
TEXT_RENDER_MODE_FILL
A possible text rendering value
public const int TEXT_RENDER_MODE_FILL = 0
Field Value
TEXT_RENDER_MODE_FILL_CLIP
A possible text rendering value
public const int TEXT_RENDER_MODE_FILL_CLIP = 4
Field Value
TEXT_RENDER_MODE_FILL_STROKE
A possible text rendering value
public const int TEXT_RENDER_MODE_FILL_STROKE = 2
Field Value
TEXT_RENDER_MODE_FILL_STROKE_CLIP
A possible text rendering value
public const int TEXT_RENDER_MODE_FILL_STROKE_CLIP = 6
Field Value
TEXT_RENDER_MODE_INVISIBLE
A possible text rendering value
public const int TEXT_RENDER_MODE_INVISIBLE = 3
Field Value
TEXT_RENDER_MODE_STROKE
A possible text rendering value
public const int TEXT_RENDER_MODE_STROKE = 1
Field Value
TEXT_RENDER_MODE_STROKE_CLIP
A possible text rendering value
public const int TEXT_RENDER_MODE_STROKE_CLIP = 5
Field Value
Writer
membervariables
protected PdfWriter Writer
Field Value
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
Imagethe 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
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
Imagethe Image object
a
floatan element of the transformation matrix
b
floatan element of the transformation matrix
c
floatan element of the transformation matrix
d
floatan element of the transformation matrix
e
floatan element of the transformation matrix
f
floatan 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
Imagethe Image object
a
floatan element of the transformation matrix
b
floatan element of the transformation matrix
c
floatan element of the transformation matrix
d
floatan element of the transformation matrix
e
floatan element of the transformation matrix
f
floatan element of the transformation matrix
inlineImage
booltrue 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
PdfOutlinethe outline
name
stringthe name for the local destination
AddPsxObject(PdfPsxObject)
Adds a PostScript XObject to this content.
public void AddPsxObject(PdfPsxObject psobject)
Parameters
psobject
PdfPsxObjectthe object
AddTemplate(PdfTemplate, float, float)
Adds a template to this content.
public void AddTemplate(PdfTemplate pdfTemplate, float x, float y)
Parameters
pdfTemplate
PdfTemplatethe template
x
floatthe x location of this template
y
floatthe 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
PdfTemplatethe template
a
floatan element of the transformation matrix
b
floatan element of the transformation matrix
c
floatan element of the transformation matrix
d
floatan element of the transformation matrix
e
floatan element of the transformation matrix
f
floatan 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
floata corner of the enclosing rectangle
y1
floata corner of the enclosing rectangle
x2
floata corner of the enclosing rectangle
y2
floata corner of the enclosing rectangle
startAng
floatstarting angle in degrees
extent
floatangle 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
IPdfOcgthe layer
BeginMarkedContentSequence(PdfName)
This is just a shorthand to beginMarkedContentSequence(tag, null, false) .
public void BeginMarkedContentSequence(PdfName tag)
Parameters
tag
PdfNamethe 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
PdfNamethe tag
property
PdfDictionarythe property
inline
booltrue 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
PdfStructureElementthe 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
floata corner of the enclosing rectangle
y1
floata corner of the enclosing rectangle
x2
floata corner of the enclosing rectangle
y2
floata corner of the enclosing rectangle
startAng
floatstarting angle in degrees
extent
floatangle extent in degrees
Returns
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
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
floatan element of the transformation matrix
b
floatan element of the transformation matrix
c
floatan element of the transformation matrix
d
floatan element of the transformation matrix
e
floatan element of the transformation matrix
f
floatan 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
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
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
floatthe width of the pattern
height
floatthe height of the pattern
xstep
floatthe desired horizontal spacing between pattern cells.
ystep
floatthe 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
floatthe width of the pattern
height
floatthe height of the pattern
xstep
floatthe desired horizontal spacing between pattern cells.
ystep
floatthe desired vertical spacing between pattern cells.
color
BaseColorthe 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
floatthe width of the pattern
height
floatthe height of the pattern
color
BaseColorthe 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
Returns
- PdfTemplate
the templated created
CurveFromTo(float, float, float, float)
public void CurveFromTo(float x1, float y1, float x3, float y3)
Parameters
CurveTo(double, double, double, double, double, double)
public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
Parameters
CurveTo(float, float, float, float)
public void CurveTo(float x2, float y2, float x3, float y3)
Parameters
CurveTo(float, float, float, float, float, float)
public void CurveTo(float x1, float y1, float x2, float y2, float x3, float y3)
Parameters
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
DrawRadioField(float, float, float, float, bool)
public void DrawRadioField(float llx, float lly, float urx, float ury, bool on)
Parameters
DrawTextField(float, float, float, float)
public void DrawTextField(float llx, float lly, float urx, float ury)
Parameters
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
floata corner of the enclosing rectangle
y1
floata corner of the enclosing rectangle
x2
floata corner of the enclosing rectangle
y2
floata 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
Returns
GetKernArray(string, BaseFont)
Constructs a kern array for a text in a certain font
public static PdfTextArray GetKernArray(string text, BaseFont font)
Parameters
Returns
- PdfTextArray
a PdfTextArray
LineTo(double, double)
public void LineTo(double x, double y)
Parameters
LineTo(float, float)
public void LineTo(float x, float y)
Parameters
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
stringthe name of this local destination
destination
PdfDestinationthe 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
stringthe name for this link
llx
floatthe lower left x corner of the activation area
lly
floatthe lower left y corner of the activation area
urx
floatthe upper right x corner of the activation area
ury
floatthe 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
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
MoveTo(double, double)
public void MoveTo(double x, double y)
Parameters
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
NewlineShowText(string)
Moves to the next line and shows text .
public void NewlineShowText(string text)
Parameters
text
stringthe 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
PdfShadingthe shading object
PaintShading(PdfShadingPattern)
Paints using a shading pattern.
public virtual void PaintShading(PdfShadingPattern shading)
Parameters
shading
PdfShadingPatternthe shading pattern
Rectangle(float, float, float, float)
public void Rectangle(float x, float y, float w, float h)
Parameters
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
stringthe filename for the remote document
page
intthe page to jump to
llx
floatthe lower left x corner of the activation area
lly
floatthe lower left y corner of the activation area
urx
floatthe upper right x corner of the activation area
ury
floatthe 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
stringthe filename for the remote document
name
stringthe name to jump to
llx
floatthe lower left x corner of the activation area
lly
floatthe lower left y corner of the activation area
urx
floatthe upper right x corner of the activation area
ury
floatthe 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
boolwill 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
floatx-coordinate of the starting point
y
floaty-coordinate of the starting point
w
floatwidth
h
floatheight
r
floatradius 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
PdfActionthe PdfAction
llx
floatthe lower left x corner of the activation area
lly
floatthe lower left y corner of the activation area
urx
floatthe upper right x corner of the activation area
ury
floatthe upper right y corner of the activation area
SetCharacterSpacing(float)
Sets the character spacing parameter.
public void SetCharacterSpacing(float value)
Parameters
value
floata parameter
SetCmykColorFill(int, int, int, int)
public virtual void SetCmykColorFill(int cyan, int magenta, int yellow, int black)
Parameters
SetCmykColorFillF(float, float, float, float)
public virtual void SetCmykColorFillF(float cyan, float magenta, float yellow, float black)
Parameters
SetCmykColorStroke(int, int, int, int)
public virtual void SetCmykColorStroke(int cyan, int magenta, int yellow, int black)
Parameters
SetCmykColorStrokeF(float, float, float, float)
public virtual void SetCmykColorStrokeF(float cyan, float magenta, float yellow, float black)
Parameters
SetColorFill(BaseColor)
Sets the fill color. color can be an ExtendedColor .
public virtual void SetColorFill(BaseColor value)
Parameters
value
BaseColorthe 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
PdfSpotColorthe spot color
tint
floatthe 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
BaseColorthe 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
PdfSpotColorthe spot color
tint
floatthe 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
PdfNamethe name of the colorspace. It can be PdfName.DEFAULTGRAY , PdfName.DEFAULTRGB
obj
PdfObjectthe 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
SetGState(PdfGState)
Draws a TextField.
public void SetGState(PdfGState gstate)
Parameters
gstate
PdfGStatethe 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
floata parameter
SetLeading(float)
Adds the content of another PdfContent -object to this object.
public void SetLeading(float v)
Parameters
v
floatanother 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
SetLineDash(float, float, float)
public void SetLineDash(float unitsOn, float unitsOff, float phase)
Parameters
SetLineDash(float[], float)
public void SetLineDash(float[] array, float phase)
Parameters
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
charthe char
SetLiteral(float)
Outputs a float directly to the content.
public void SetLiteral(float n)
Parameters
n
floatthe float
SetLiteral(string)
Outputs a string directly to the content.
public void SetLiteral(string s)
Parameters
s
stringthe 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
PdfPatternPainterthe pattern
SetPatternFill(PdfPatternPainter, BaseColor)
Sets the fill color to an uncolored pattern.
public virtual void SetPatternFill(PdfPatternPainter p, BaseColor color)
Parameters
p
PdfPatternPainterthe pattern
color
BaseColorthe 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
PdfPatternPainterthe pattern
color
BaseColorthe color of the pattern
tint
floatthe 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
PdfPatternPainterthe pattern
SetPatternStroke(PdfPatternPainter, BaseColor)
Sets the stroke color to an uncolored pattern.
public virtual void SetPatternStroke(PdfPatternPainter p, BaseColor color)
Parameters
p
PdfPatternPainterthe pattern
color
BaseColorthe 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
PdfPatternPainterthe pattern
color
BaseColorthe color of the pattern
tint
floatthe 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
SetRgbColorFillF(float, float, float)
public virtual void SetRgbColorFillF(float red, float green, float blue)
Parameters
SetRgbColorStroke(int, int, int)
public virtual void SetRgbColorStroke(int red, int green, int blue)
Parameters
SetRgbColorStrokeF(float, float, float)
public virtual void SetRgbColorStrokeF(float red, float green, float blue)
Parameters
SetShadingFill(PdfShadingPattern)
Sets the shading fill pattern.
public virtual void SetShadingFill(PdfShadingPattern shading)
Parameters
shading
PdfShadingPatternthe shading pattern
SetShadingStroke(PdfShadingPattern)
Sets the shading stroke pattern
public virtual void SetShadingStroke(PdfShadingPattern shading)
Parameters
shading
PdfShadingPatternthe 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
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
floatoperand 1,1 in the matrix
b
floatoperand 1,2 in the matrix
c
floatoperand 2,1 in the matrix
d
floatoperand 2,2 in the matrix
x
floatoperand 3,1 in the matrix
y
floatoperand 3,2 in the matrix
SetTextRenderingMode(int)
Sets the text rendering parameter.
public void SetTextRenderingMode(int value)
Parameters
value
inta 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
floata 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
stringthe text to write
ShowText(PdfTextArray)
Show an array of text.
public void ShowText(PdfTextArray text)
Parameters
text
PdfTextArrayarray 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
intthe alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
text
stringthe text to show
x
floatthe x pivot position
y
floatthe y pivot position
rotation
floatthe 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
intthe alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
text
stringthe text to show
x
floatthe x pivot position
y
floatthe y pivot position
rotation
floatthe rotation to be applied in degrees counterclockwise
ShowTextKerned(string)
Shows the text kerned.
public void ShowTextKerned(string text)
Parameters
text
stringthe 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
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
Rectanglea Rectangle