Packageorg.purepdf.pdf
Classpublic class PdfContentByte
InheritancePdfContentByte Inheritance it.sephiroth.utils.ObjectHash
Subclasses PdfTemplate



Public Properties
 PropertyDefined By
  pageResources : PageResources
[read-only]
PdfContentByte
  pdfDocument : PdfDocument
[read-only]
PdfContentByte
  size : uint
[read-only]
PdfContentByte
  writer : PdfWriter
PdfContentByte
  xTLM : Number
[read-only] Get the x position of the text line matrix.
PdfContentByte
  yTLM : Number
[read-only] Get the y position of the text line matrix
PdfContentByte
Protected Properties
 PropertyDefined By
  content : ByteBuffer
PdfContentByte
  inText : Boolean = false
PdfContentByte
  layerDepth : Vector.<int>
PdfContentByte
  mcDepth : int = 0
PdfContentByte
  pdf : PdfDocument
PdfContentByte
  separator : int
PdfContentByte
  state : GraphicState
PdfContentByte
  stateList : Vector.<GraphicState>
PdfContentByte
  _writer : PdfWriter
PdfContentByte
Public Methods
 MethodDefined By
  
PdfContentByte
  
add(other:PdfContentByte):void
Adds the content of another PdfContent object to this object.
PdfContentByte
  
PdfContentByte
  
PdfContentByte
  
Adds an ImageElement to the page.
PdfContentByte
  
addImage1(image:ImageElement, inlineImage:Boolean):void
Adds an ImageElement to the page.
PdfContentByte
  
addImage2(image:ImageElement, width:Number, b:Number, c:Number, height:Number, x:Number, y:Number, inlineImage:Boolean):void
Adds an ImageElement to the page.
PdfContentByte
  
addImage3(image:ImageElement, width:Number, b:Number, c:Number, height:Number, x:Number, y:Number):void
Adds an ImageElement to the page.
PdfContentByte
  
addTemplate(template:PdfTemplate, a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0):void
Adds a template to this content
PdfContentByte
  
addTemplateReference(template:PdfIndirectReference, name:PdfName, a:Number, b:Number, c:Number, d:Number, e:Number, f:Number):void
PdfContentByte
  
arc(x1:Number, y1:Number, x2:Number, y2:Number, startAng:Number, extent:Number):void
Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2, starting at startAng degrees and covering extent degrees.
PdfContentByte
  
beginLayer(layer:IPdfOCG):void
Begins a graphic block whose visibility is controlled by the layer.
PdfContentByte
  
Begins a marked content sequence.
PdfContentByte
  
beginMarkedContentSequence2(tag:PdfName, property:PdfDictionary, inline:Boolean):void
Begins a marked content sequence.
PdfContentByte
  
This is just a shorthand to beginMarkedContentSequence2
PdfContentByte
  
beginText():void
start writing text
PdfContentByte
  
bezierArc(x1:Number, y1:Number, x2:Number, y2:Number, startAng:Number, extent:Number):Vector.<Vector.<Number>>
[static] Generates an array of bezier curves to draw an arc.
PdfContentByte
  
Check if the template is a pattern.
PdfContentByte
  
circle(x:Number, y:Number, r:Number):void
Draws a circle.
PdfContentByte
  
clip(even_odd:Boolean = false):void
Modify the current clipping path by intersecting it with the current path, using the even_odd winding number rule to determine which regions lie inside the clipping path.
PdfContentByte
  
closePath():void
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath.
PdfContentByte
  
closePathFillStroke(even_odd:Boolean = false):void
Closes the path, fills it using the even_odd winding number rule to determine the region to fill and strokes it.
PdfContentByte
  
Closes the path and strokes it.
PdfContentByte
  
concatCTM(a:Number, b:Number, c:Number, d:Number, e:Number, f:Number):void
Concatenate a matrix to the current matrix.
PdfContentByte
  
concatMatrix(matrix:Matrix):void
Concatenate a matrix to the current matrix.
PdfContentByte
  
createAppearance(width:Number, height:Number):PdfAppearance
PdfContentByte
  
createPattern(width:Number, height:Number, xstep:Number, ystep:Number):PdfPatternPainter
Create a new colored tiling pattern.
PdfContentByte
  
createPatternColor(width:Number, height:Number, xstep:Number, ystep:Number, color:RGBColor):PdfPatternPainter
Create a new uncolored tiling pattern.
PdfContentByte
  
createTemplate(width:Number, height:Number, forcedName:PdfName = null):PdfTemplate
Creates a new template.
PdfContentByte
  
curveTo(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number):void
Appends a Bezier curve to the path, starting from the current point.
PdfContentByte
  
PdfContentByte
  
ellipse(x1:Number, y1:Number, x2:Number, y2:Number):void
Draws an ellipse inscribed within the rectangle x1,y1,x2,y2.
PdfContentByte
  
endLayer():void
PdfContentByte
  
Ends a marked content sequence
PdfContentByte
  
endText():void
PdfContentByte
  
[static]
PdfContentByte
  
[static]
PdfContentByte
  
fill(even_odd:Boolean = false):void
fill the path
PdfContentByte
  
fillStroke(even_odd:Boolean = false):void
Fills the path using the even_odd winding number rule to determine the region to fill and strokes it.
PdfContentByte
  
Get the current character spacing
PdfContentByte
  
getEffectiveStringWidth(text:String, kerned:Boolean = false):Number
Computes the width of the given string taking in account the current values of "Character spacing", "Word Spacing" and "Horizontal Scaling"
PdfContentByte
  
Return the internal buffer
PdfContentByte
  
[static] Constructs a kern array for a text in a certain font
PdfContentByte
  
lineTo(x:Number, y:Number):void
PdfContentByte
  
moveText(x:Number, y:Number):void
Moves to the start of the next line, offset from the start of the current line.
PdfContentByte
  
moveTo(x:Number, y:Number):void
Move the current point omitting any connecting line segment.
PdfContentByte
  
newlineShowText(text:String):void
Moves to the next line and shows text
PdfContentByte
  
newPath():void
Ends the path without filling or stroking it.
PdfContentByte
  
Paint using a shading object
PdfContentByte
  
Paints using a shading pattern.
PdfContentByte
  
rectangle(... params):void
Adds a rectangle to the current path Either a RectangleElement or 4 Numbers are accepted as parameters. Example: cb.setFillColor( RGBColor.BLACK ); cb.rectangle( 0, 0, 100, 100 ); cb.fill(); var rect: RectangleElement = new RectangleElement( 0, 0, 100, 100 ); rect.setBorderSides( RectangleElement.ALL ); rect.setBorderWidth(5); rect.setBackgroundColor( RGBColor.RED ); cb.rectangle( rect );
PdfContentByte
  
reset(value:Boolean = true):void
Makes this PdfContentByte empty.
PdfContentByte
  
resetFill():void
PdfContentByte
  
PdfContentByte
  
Restores the graphic state.
PdfContentByte
  
roundRectangle(x:Number, y:Number, w:Number, h:Number, r:Number):void
Adds a round rectangle to the current path.
PdfContentByte
  
saveState():void
Saves the graphic state.
PdfContentByte
  
setCharacterSpacing(charSpace:Number):void
Change the character spacing
PdfContentByte
  
setCMYKFillColor(cyan:Number, magenta:Number, yellow:Number, black:Number):void
Changes the current color for filling paths (device dependent colors!).
PdfContentByte
  
setCMYKStrokeColor(cyan:Number, magenta:Number, yellow:Number, black:Number):void
Sets the color space to DeviceCMYK (or the DefaultCMYK color space), and sets the color to use for stroking paths. Each value must be between 0 and 1.
PdfContentByte
  
Sets the fill color
PdfContentByte
  
PdfContentByte
  
setFillColor(value:uint):void
Changes the current color for filling paths Sets the color space to DeviceRGB
PdfContentByte
  
setFontAndSize(bf:BaseFont, size:Number):void
Set the font and the size for the subsequent text writing
PdfContentByte
  
setGrayFill(gray:Number):void
PdfContentByte
  
setGrayStroke(gray:Number):void
PdfContentByte
  
setGState(gstate:PdfGState):void
Apply the graphic state
PdfContentByte
  
setLeading(value:Number):void
Sets the text leading parameter.
PdfContentByte
  
setLineCap(style:int):void
Changes the Line cap style The line cap style specifies the shape to be used at the end of open subpaths when they are stroked.
PdfContentByte
  
setLineDash(phase:Number):void
Changes the value of the line dash pattern.
PdfContentByte
  
setLineDash2(unitsOn:Number, phase:Number):void
Changes the value of the line dash pattern. The line dash pattern controls the pattern of dashes and gaps used to stroke paths.
PdfContentByte
  
setLineDash3(unitsOn:Number, unitsOff:Number, phase:Number):void
Changes the value of the line dash pattern The line dash pattern controls the pattern of dashes and gaps used to stroke paths.
PdfContentByte
  
setLineDash4(array:Vector.<Number>, phase:Number):void
Changes the value of the line dash pattern The line dash pattern controls the pattern of dashes and gaps used to stroke paths.
PdfContentByte
  
setLineJoin(joint:String):void
Changes the Line join style The line join style specifies the shape to be used at the corners of paths that are stroked. Allowed values are JointStyle.MITER (Miter joins), JointStyle.ROUND (Round joins) and JointStyle.BEVEL (Bevel joins).
PdfContentByte
  
setLineWidth(w:Number):void
Changes the line width.
PdfContentByte
  
setLiteral(value:String):void
Output a String directly to the content
PdfContentByte
  
setMiterLimit(miterLimit:Number):void
Changes the Miter limit.
PdfContentByte
  
Set the fill color to a pattern
PdfContentByte
  
Set the fill color of an uncolored pattern
PdfContentByte
  
setPatternFill3(p:PdfPatternPainter, color:RGBColor, tint:Number):void
Set the fill color to an uncolored pattern
PdfContentByte
  
Sets the stroke color to a pattern
PdfContentByte
  
Sets the stroke color to an uncolored pattern
PdfContentByte
  
setPatternStroke3(p:PdfPatternPainter, color:RGBColor, tint:Number):void
Sets the stroke color to an uncolored pattern
PdfContentByte
  
setRGBFillColor(red:int, green:int, blue:int):void
Changes the current color for filling paths Sets the color space to DeviceRGB
PdfContentByte
  
setRGBStrokeColor(red:int, green:int, blue:int):void
PdfContentByte
  
Sets the shading fill pattern.
PdfContentByte
  
Sets the shading stroke pattern
PdfContentByte
  
setSpotFillColor(sp:PdfSpotColor, tint:Number):void
Sets the fill color to a spot color.
PdfContentByte
  
setSpotStrokeColor(sp:PdfSpotColor, tint:Number):void
Sets the stroke color to a spot color
PdfContentByte
  
setStrokeColor(value:uint):void
PdfContentByte
  
setTextMatrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, x:Number = 0, y:Number = 0):void
Change the text matrix
PdfContentByte
  
setTextRenderingMode(rendering:int):void
Sets the text rendering mode
PdfContentByte
  
setTextRise(rise:Number):void
This allows to write text in subscript or superscript mode
PdfContentByte
  
setTransform(m:Matrix):void
Concatenates the transformation to the current matrix
PdfContentByte
  
setWordSpacing(wordSpace:Number):void
Change the word spacing
PdfContentByte
  
showText(text:String):void
Shows the text
PdfContentByte
  
showTextAligned(alignment:int, text:String, x:Number, y:Number, rotation:Number, kerned:Boolean = false):void
Shows text aligned (left, center or right) with rotation.
PdfContentByte
  
Show an array of kerned text
PdfContentByte
  
showTextKerned(text:String):void
Shows the text kerned
PdfContentByte
  
stroke():void
Strokes the path.
PdfContentByte
  
PdfContentByte
  
toString():String
PdfContentByte
  
Adds a variable width border to the current path.
PdfContentByte
Protected Methods
 MethodDefined By
  
PdfContentByte
  
Checks for any error in mismatched save/restore state, begin/end text, begin/end layer, or begin/end marked content sequence.
PdfContentByte
Public Constants
 ConstantDefined By
  ALIGN_CENTER : int = 1
[static]
PdfContentByte
  ALIGN_LEFT : int = 0
[static]
PdfContentByte
  ALIGN_RIGHT : int = 2
[static]
PdfContentByte
  LINE_CAP_BUTT : int = 0
[static]
PdfContentByte
  LINE_CAP_PROJECTING_SQUARE : int = 2
[static]
PdfContentByte
  LINE_CAP_ROUND : int = 1
[static]
PdfContentByte
  LINE_JOIN_BEVEL : int = 2
[static]
PdfContentByte
  LINE_JOIN_MITER : int = 0
[static]
PdfContentByte
  LINE_JOIN_ROUND : int = 1
[static]
PdfContentByte
  TEXT_RENDER_MODE_CLIP : int = 7
[static]
PdfContentByte
  TEXT_RENDER_MODE_FILL : int = 0
[static]
PdfContentByte
  TEXT_RENDER_MODE_FILL_CLIP : int = 4
[static]
PdfContentByte
  TEXT_RENDER_MODE_FILL_STROKE : int = 2
[static]
PdfContentByte
  TEXT_RENDER_MODE_FILL_STROKE_CLIP : int = 6
[static]
PdfContentByte
  TEXT_RENDER_MODE_INVISIBLE : int = 3
[static]
PdfContentByte
  TEXT_RENDER_MODE_STROKE : int = 1
[static]
PdfContentByte
  TEXT_RENDER_MODE_STROKE_CLIP : int = 5
[static]
PdfContentByte
Property Detail
_writerproperty
protected var _writer:PdfWriter

contentproperty 
protected var content:ByteBuffer

inTextproperty 
protected var inText:Boolean = false

layerDepthproperty 
protected var layerDepth:Vector.<int>

mcDepthproperty 
protected var mcDepth:int = 0

pageResourcesproperty 
pageResources:PageResources  [read-only]


Implementation
    public function get pageResources():PageResources
pdfproperty 
protected var pdf:PdfDocument

pdfDocumentproperty 
pdfDocument:PdfDocument  [read-only]


Implementation
    public function get pdfDocument():PdfDocument
separatorproperty 
protected var separator:int

sizeproperty 
size:uint  [read-only]


Implementation
    public function get size():uint
stateproperty 
protected var state:GraphicState

stateListproperty 
protected var stateList:Vector.<GraphicState>

writerproperty 
writer:PdfWriter


Implementation
    public function get writer():PdfWriter
    public function set writer(value:PdfWriter):void
xTLMproperty 
xTLM:Number  [read-only]

Get the x position of the text line matrix.


Implementation
    public function get xTLM():Number
yTLMproperty 
yTLM:Number  [read-only]

Get the y position of the text line matrix


Implementation
    public function get yTLM():Number
Constructor Detail
PdfContentByte()Constructor
public function PdfContentByte($writer:PdfWriter)

Parameters
$writer:PdfWriter
Method Detail
add()method
public function add(other:PdfContentByte):void

Adds the content of another PdfContent object to this object.

Parameters

other:PdfContentByte

addAnnotation()method 
public function addAnnotation(annot:PdfAnnotation):void

Parameters

annot:PdfAnnotation

addContent()method 
public function addContent(other:PdfContentByte):void

Parameters

other:PdfContentByte


Throws
RuntimeError
addImage()method 
public function addImage(image:ImageElement):void

Adds an ImageElement to the page. The ImageElement must have absolute positioning.

Parameters

image:ImageElement — the ImageElement object

See also

addImage1()method 
public function addImage1(image:ImageElement, inlineImage:Boolean):void

Adds an ImageElement to the page. The ImageElement must have absolute positioning. The image can be placed inline.

Parameters

image:ImageElement — the ImageElement object
 
inlineImage:Booleantrue to place this image inline, false otherwise

See also

addImage2()method 
public function addImage2(image:ImageElement, width:Number, b:Number, c:Number, height:Number, x:Number, y:Number, inlineImage:Boolean):void

Adds an ImageElement to the page. The positioning of the ImageElement is done with the transformation matrix. To position an ImageElement at (x,y) use addImage(image, image_width, 0, 0, image_height, x, y)

Parameters

image:ImageElement — the ImageElement object
 
width:Number
 
b:Number — element of the matrix
 
c:Number — element of the matrix
 
height:Number
 
x:Number
 
y:Number
 
inlineImage:Boolean

See also

addImage3()method 
public function addImage3(image:ImageElement, width:Number, b:Number, c:Number, height:Number, x:Number, y:Number):void

Adds an ImageElement to the page. The positioning of the ImageElement is done with the transformation matrix. To position an ImageElement at (x,y) use addImage(image, image_width, 0, 0, image_height, x, y).

Parameters

image:ImageElement — the ImageElement object
 
width:Number
 
b:Number — element of the transformation matrix
 
c:Number — element of the transformation matrix
 
height:Number
 
x:Number
 
y:Number

See also

addTemplate()method 
public function addTemplate(template:PdfTemplate, a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0):void

Adds a template to this content

Parameters

template:PdfTemplate — the template
 
a:Number (default = 1) — element of the matrix
 
b:Number (default = 0) — element matrix
 
c:Number (default = 0) — element matrix
 
d:Number (default = 1) — element matrix
 
tx:Number (default = 0) — element matrix
 
ty:Number (default = 0) — element matrix

See also

flash.geom.Matrix
addTemplateReference()method 
public function addTemplateReference(template:PdfIndirectReference, name:PdfName, a:Number, b:Number, c:Number, d:Number, e:Number, f:Number):void

Parameters

template:PdfIndirectReference
 
name:PdfName
 
a:Number
 
b:Number
 
c:Number
 
d:Number
 
e:Number
 
f:Number

arc()method 
public function arc(x1:Number, y1:Number, x2:Number, y2:Number, startAng:Number, extent:Number):void

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.

Parameters

x1:Number — a corner of the enclosing rectangle
 
y1:Number — a corner of the enclosing rectangle
 
x2:Number — a corner of the enclosing rectangle
 
y2:Number — a corner of the enclosing rectangle
 
startAng:Number — starting angle in degrees
 
extent:Number — angle extent in degrees

beginLayer()method 
public function beginLayer(layer:IPdfOCG):void

Begins a graphic block whose visibility is controlled by the layer. Blocks can be nested. Each block must be terminated by an {

Parameters

layer:IPdfOCG — the layer


Throws
ArgumentError
beginMarkedContentSequence()method 
public function beginMarkedContentSequence(struc:PdfStructureElement):void

Since : 0.22

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.

Parameters

struc:PdfStructureElement


Throws
IllegalOperationError
beginMarkedContentSequence2()method 
public function beginMarkedContentSequence2(tag:PdfName, property:PdfDictionary, inline:Boolean):void

Begins a marked content sequence. If property is null the mark will be of the type BMC otherwise it will be BDC.

Parameters

tag:PdfName — the tag
 
property:PdfDictionary — the property
 
inline:Boolean — true to include the property in the content or false to include the property in the resource dictionary with the possibility of reusing

beginMarkedContentSequence3()method 
public function beginMarkedContentSequence3(tag:PdfName):void

This is just a shorthand to beginMarkedContentSequence2

Parameters

tag:PdfName — the tag

beginText()method 
public function beginText():void

start writing text

bezierArc()method 
public static function bezierArc(x1:Number, y1:Number, x2:Number, y2:Number, startAng:Number, extent:Number):Vector.<Vector.<Number>>

Generates an array of bezier curves to draw an arc.

Parameters

x1:Number
 
y1:Number
 
x2:Number
 
y2:Number
 
startAng:Number — starting angle in degrees
 
extent:Number — angle extent in degrees

Returns
Vector.<Vector.<Number>>
checkNoPattern()method 
public function checkNoPattern(t:PdfTemplate):void

Check if the template is a pattern. In that case throws an Error c

Parameters

t:PdfTemplate


Throws
RuntimeError
checkWriter()method 
protected function checkWriter():void

circle()method 
public function circle(x:Number, y:Number, r:Number):void

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

Parameters

x:Number — x center of circle
 
y:Number — y center of circle
 
r:Number — radius of circle

clip()method 
public function clip(even_odd:Boolean = false):void

Modify the current clipping path by intersecting it with the current path, using the even_odd winding number rule to determine which regions lie inside the clipping path.

Parameters

even_odd:Boolean (default = false)

closePath()method 
public function closePath():void

Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath.

closePathFillStroke()method 
public function closePathFillStroke(even_odd:Boolean = false):void

Closes the path, fills it using the even_odd winding number rule to determine the region to fill and strokes it.

Parameters

even_odd:Boolean (default = false)

closePathStroke()method 
public function closePathStroke():void

Closes the path and strokes it.

concatCTM()method 
public function concatCTM(a:Number, b:Number, c:Number, d:Number, e:Number, f:Number):void

Concatenate a matrix to the current matrix.

Parameters

a:Number — an element of the matrix
 
b:Number — an element of the matrix
 
c:Number — an element of the matrix
 
d:Number — an element of the matrix
 
e:Number — an element of the matrix
 
f:Number — an element of the matrix

concatMatrix()method 
public function concatMatrix(matrix:Matrix):void

Concatenate a matrix to the current matrix.

Parameters

matrix:Matrix

createAppearance()method 
public function createAppearance(width:Number, height:Number):PdfAppearance

Parameters

width:Number
 
height:Number

Returns
PdfAppearance
createPattern()method 
public function createPattern(width:Number, height:Number, xstep:Number, ystep:Number):PdfPatternPainter

Create a new colored tiling pattern.

Parameters

width:Number — the width of the pattern
 
height:Number — the height of the pattern
 
xstep:Number (default = NaN) — the desired horizontal spacing between pattern cells. May be either positive or negative, but not zero.
 
ystep:Number (default = NaN) — the desired vertical spacing between pattern cells. May be either positive or negative, but not zero.

Returns
PdfPatternPainter — the PdfPatternPainter where the pattern will be created
createPatternColor()method 
public function createPatternColor(width:Number, height:Number, xstep:Number, ystep:Number, color:RGBColor):PdfPatternPainter

Create a new uncolored tiling pattern.

Parameters

width:Number — the width of the pattern
 
height:Number — the height of the pattern
 
xstep:Number — the desired horizontal spacing between pattern cells. May be either positive or negative, but not zero.
 
ystep:Number — the desired vertical spacing between pattern cells. May be either positive or negative, but not zero.
 
color:RGBColor — the default color. Can be null

Returns
PdfPatternPainter — the PdfPatternPainter where the pattern will be created
createTemplate()method 
public function createTemplate(width:Number, height:Number, forcedName:PdfName = null):PdfTemplate

Creates a new template. This template can be included in this PdfContentByte or in another template. Templates are written only when document is closed.

Parameters

width:Number
 
height:Number
 
forcedName:PdfName (default = null)

Returns
PdfTemplate
curveTo()method 
public function curveTo(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number):void

Appends a Bezier curve to the path, starting from the current point.

Parameters

x1:Number — x-coordinate of the first control point
 
y1:Number — y-coordinate of the first control point
 
x2:Number — x-coordinate of the second control point
 
y2:Number — y-coordinate of the second control point
 
x3:Number — x-coordinate of the ending point (= new current point)
 
y3:Number — y-coordinate of the ending point (= new current point)

duplicate()method 
public function duplicate():PdfContentByte

Returns
PdfContentByte
ellipse()method 
public function ellipse(x1:Number, y1:Number, x2:Number, y2:Number):void

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

Parameters

x1:Number — a corner of the enclosing rectangle
 
y1:Number — a corner of the enclosing rectangle
 
x2:Number — a corner of the enclosing rectangle
 
y2:Number — a corner of the enclosing rectangle

endLayer()method 
public function endLayer():void


Throws
IllegalPdfSyntaxError
endMarkedContentSequence()method 
public function endMarkedContentSequence():void

Ends a marked content sequence

endText()method 
public function endText():void


Throws
IllegalPdfSyntaxError
escapeByteArray()method 
public static function escapeByteArray(byte:Bytes):Bytes

Parameters

byte:Bytes

Returns
Bytes
escapeString()method 
public static function escapeString(byte:Bytes, content:ByteBuffer):ByteBuffer

Parameters

byte:Bytes
 
content:ByteBuffer

Returns
ByteBuffer
fill()method 
public function fill(even_odd:Boolean = false):void

fill the path

Parameters

even_odd:Boolean (default = false) — Determine how to draw the path (using the even-odd winding rule or not. Default is false)

fillStroke()method 
public function fillStroke(even_odd:Boolean = false):void

Fills the path using the even_odd winding number rule to determine the region to fill and strokes it.

Parameters

even_odd:Boolean (default = false)

getCharacterSpacing()method 
public function getCharacterSpacing():Number

Get the current character spacing

Returns
Number
getEffectiveStringWidth()method 
public function getEffectiveStringWidth(text:String, kerned:Boolean = false):Number

Computes the width of the given string taking in account the current values of "Character spacing", "Word Spacing" and "Horizontal Scaling"

Parameters

text:String
 
kerned:Boolean (default = false)

Returns
Number
getInternalBuffer()method 
public function getInternalBuffer():ByteBuffer

Return the internal buffer

Returns
ByteBuffer
getKernArray()method 
public static function getKernArray(text:String, font:BaseFont):PdfTextArray

Constructs a kern array for a text in a certain font

Parameters

text:String — the text
 
font:BaseFont — the font

Returns
PdfTextArray — a PdfTextArray
lineTo()method 
public function lineTo(x:Number, y:Number):void

Parameters

x:Number
 
y:Number

moveText()method 
public function moveText(x:Number, y:Number):void

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

Parameters

x:Number — x-coordinate of the new current point
 
y:Number — y-coordinate of the new current point

moveTo()method 
public function moveTo(x:Number, y:Number):void

Move the current point omitting any connecting line segment.

Parameters

x:Number
 
y:Number

newlineShowText()method 
public function newlineShowText(text:String):void

Moves to the next line and shows text

Parameters

text:String — the text to write

newPath()method 
public function newPath():void

Ends the path without filling or stroking it.

paintShading()method 
public function paintShading(value:PdfShading):void

Paint using a shading object

Parameters

value:PdfShading

paintShadingPattern()method 
public function paintShadingPattern(shading:PdfShadingPattern):void

Paints using a shading pattern.

Parameters

shading:PdfShadingPattern

rectangle()method 
public function rectangle(... params):void

Adds a rectangle to the current path Either a RectangleElement or 4 Numbers are accepted as parameters. Example: cb.setFillColor( RGBColor.BLACK ); cb.rectangle( 0, 0, 100, 100 ); cb.fill(); var rect: RectangleElement = new RectangleElement( 0, 0, 100, 100 ); rect.setBorderSides( RectangleElement.ALL ); rect.setBorderWidth(5); rect.setBackgroundColor( RGBColor.RED ); cb.rectangle( rect );

Parameters

... params — x-coordinate of the starting point

See also

reset()method 
public function reset(value:Boolean = true):void

Makes this PdfContentByte empty. Calls reset( true )

Parameters

value:Boolean (default = true)

resetFill()method 
public function resetFill():void

resetStroke()method 
public function resetStroke():void

restoreState()method 
public function restoreState():void

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

roundRectangle()method 
public function roundRectangle(x:Number, y:Number, w:Number, h:Number, r:Number):void

Adds a round rectangle to the current path.

Parameters

x:Number
 
y:Number
 
w:Number
 
h:Number
 
r:Number

sanityCheck()method 
protected function sanityCheck():void

Checks for any error in mismatched save/restore state, begin/end text, begin/end layer, or begin/end marked content sequence.

saveState()method 
public function saveState():void

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

setCharacterSpacing()method 
public function setCharacterSpacing(charSpace:Number):void

Change the character spacing

Parameters

charSpace:Number

setCMYKFillColor()method 
public function setCMYKFillColor(cyan:Number, magenta:Number, yellow:Number, black:Number):void

Changes the current color for filling paths (device dependent colors!).

Parameters

cyan:Number — the intensity of cyan. A value between 0 and 1
 
magenta:Number — the intensity of magenta. A value between 0 and 1
 
yellow:Number — the intensity of yellow. A value between 0 and 1
 
black:Number — the intensity of black. A value between 0 and 1

setCMYKStrokeColor()method 
public function setCMYKStrokeColor(cyan:Number, magenta:Number, yellow:Number, black:Number):void

Sets the color space to (or the color space), and sets the color to use for stroking paths.

Each value must be between 0 and 1.

Parameters

cyan:Number
 
magenta:Number
 
yellow:Number
 
black:Number

setColorFill()method 
public function setColorFill(color:RGBColor):void

Sets the fill color

Parameters

color:RGBColor — the color

setColorStroke()method 
public function setColorStroke(color:RGBColor):void

Parameters

color:RGBColor

setFillColor()method 
public function setFillColor(value:uint):void

Changes the current color for filling paths Sets the color space to DeviceRGB

Parameters

value:uint — Color RGB value

setFontAndSize()method 
public function setFontAndSize(bf:BaseFont, size:Number):void

Set the font and the size for the subsequent text writing

Parameters

bf:BaseFont
 
size:Number

setGrayFill()method 
public function setGrayFill(gray:Number):void

Parameters

gray:Number

setGrayStroke()method 
public function setGrayStroke(gray:Number):void

Parameters

gray:Number

setGState()method 
public function setGState(gstate:PdfGState):void

Apply the graphic state

Parameters

gstate:PdfGState — The graphic state

setLeading()method 
public function setLeading(value:Number):void

Since : 0.22

Sets the text leading parameter. The leading parameter is measured in text space units. It specifies the vertical distance between the baselines of adjacent lines of text.

Parameters

value:Number

setLineCap()method 
public function setLineCap(style:int):void

Changes the

The line cap style specifies the shape to be used at the end of open subpaths when they are stroked.

Parameters

style:int — 0 = CapsStyle.NONE, 1 = CapsStyle.ROUND, 2 = CapsStyle.SQUARE

See also

setLineDash()method 
public function setLineDash(phase:Number):void

Changes the value of the line dash pattern.

Parameters

phase:Number

setLineDash2()method 
public function setLineDash2(unitsOn:Number, phase:Number):void

Changes the value of the line dash pattern. The line dash pattern controls the pattern of dashes and gaps used to stroke paths.

Parameters

unitsOn:Number — the value of the phase
 
phase:Number — the number of units that must be 'on' (equals the number of units that must be 'off').

setLineDash3()method 
public function setLineDash3(unitsOn:Number, unitsOff:Number, phase:Number):void

Changes the value of the line dash pattern The line dash pattern controls the pattern of dashes and gaps used to stroke paths.

Parameters

unitsOn:Number — the value of the phase
 
unitsOff:Number — the number of units that must be 'on'
 
phase:Number — the number of units that must be 'off'

setLineDash4()method 
public function setLineDash4(array:Vector.<Number>, phase:Number):void

Changes the value of the line dash pattern The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by an array and a phase. The array specifies the length of the alternating dashes and gaps. The phase specifies the distance into the dash pattern to start the dash

Parameters

array:Vector.<Number> — length of the alternating dashes and gaps
 
phase:Number — the value of the phase

setLineJoin()method 
public function setLineJoin(joint:String):void

Changes the Line join style

The line join style specifies the shape to be used at the corners of paths that are stroked.

Allowed values are JointStyle.MITER (Miter joins), JointStyle.ROUND (Round joins) and JointStyle.BEVEL (Bevel joins).

Parameters

joint:String

See also

flash.diplay.JointStyle
setLineWidth()method 
public function setLineWidth(w:Number):void

Changes the line width.

Parameters

w:Number

setLiteral()method 
public function setLiteral(value:String):void

Output a String directly to the content

Parameters

value:String — The content to append

setMiterLimit()method 
public function setMiterLimit(miterLimit:Number):void

Changes the Miter limit.

Parameters

miterLimit:Number

setPatternFill()method 
public function setPatternFill(p:PdfPatternPainter):void

Set the fill color to a pattern

Parameters

p:PdfPatternPainter

setPatternFill2()method 
public function setPatternFill2(p:PdfPatternPainter, color:RGBColor):void

Set the fill color of an uncolored pattern

Parameters

p:PdfPatternPainter
 
color:RGBColor

setPatternFill3()method 
public function setPatternFill3(p:PdfPatternPainter, color:RGBColor, tint:Number):void

Set the fill color to an uncolored pattern

Parameters

p:PdfPatternPainter
 
color:RGBColor
 
tint:Number

setPatternStroke()method 
public function setPatternStroke(p:PdfPatternPainter):void

Sets the stroke color to a pattern

Parameters

p:PdfPatternPainter

setPatternStroke2()method 
public function setPatternStroke2(p:PdfPatternPainter, color:RGBColor):void

Sets the stroke color to an uncolored pattern

Parameters

p:PdfPatternPainter
 
color:RGBColor

setPatternStroke3()method 
public function setPatternStroke3(p:PdfPatternPainter, color:RGBColor, tint:Number):void

Sets the stroke color to an uncolored pattern

Parameters

p:PdfPatternPainter
 
color:RGBColor
 
tint:Number

setRectangle()method 
pdf_core function setRectangle(rectangle:RectangleElement):void

Parameters

rectangle:RectangleElement

setRGBFillColor()method 
public function setRGBFillColor(red:int, green:int, blue:int):void

Changes the current color for filling paths Sets the color space to DeviceRGB

Parameters

red:int
 
green:int
 
blue:int

setRGBStrokeColor()method 
public function setRGBStrokeColor(red:int, green:int, blue:int):void

Parameters

red:int
 
green:int
 
blue:int

setShadingFill()method 
public function setShadingFill(shading:PdfShadingPattern):void

Sets the shading fill pattern.

Parameters

shading:PdfShadingPattern

setShadingStroke()method 
public function setShadingStroke(shading:PdfShadingPattern):void

Sets the shading stroke pattern

Parameters

shading:PdfShadingPattern — the shading pattern

setSpotFillColor()method 
public function setSpotFillColor(sp:PdfSpotColor, tint:Number):void

Sets the fill color to a spot color.

Parameters

sp:PdfSpotColor — the spot color
 
tint:Number — the tint for the spot color. ( 0 = no color, 1 = 100% color )

setSpotStrokeColor()method 
public function setSpotStrokeColor(sp:PdfSpotColor, tint:Number):void

Sets the stroke color to a spot color

Parameters

sp:PdfSpotColor
 
tint:Number

setStrokeColor()method 
public function setStrokeColor(value:uint):void

Parameters

value:uint

setTextMatrix()method 
public function setTextMatrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, x:Number = 0, y:Number = 0):void

Change the text matrix

Parameters

a:Number (default = 1)
 
b:Number (default = 0)
 
c:Number (default = 0)
 
d:Number (default = 1)
 
x:Number (default = 0)
 
y:Number (default = 0)

setTextRenderingMode()method 
public function setTextRenderingMode(rendering:int):void

Sets the text rendering mode

Parameters

rendering:int

setTextRise()method 
public function setTextRise(rise:Number):void

This allows to write text in subscript or superscript mode

Parameters

rise:Number

setTransform()method 
public function setTransform(m:Matrix):void

Concatenates the transformation to the current matrix

Parameters

m:Matrix

setWordSpacing()method 
public function setWordSpacing(wordSpace:Number):void

Change the word spacing

Parameters

wordSpace:Number

showText()method 
public function showText(text:String):void

Shows the text

Parameters

text:String

showTextAligned()method 
public function showTextAligned(alignment:int, text:String, x:Number, y:Number, rotation:Number, kerned:Boolean = false):void

Shows text aligned (left, center or right) with rotation.

Parameters

alignment:int — the alignment can be ALIGN_CENTER, ALIGN_RIGHT or ALIGN_LEFT
 
text:String — the text to show
 
x:Number — the x position
 
y:Number — the y position
 
rotation:Number — the rotation in degrees
 
kerned:Boolean (default = false)

showTextArray()method 
public function showTextArray(text:PdfTextArray):void

Show an array of kerned text

Parameters

text:PdfTextArray

showTextKerned()method 
public function showTextKerned(text:String):void

Shows the text kerned

Parameters

text:String

stroke()method 
public function stroke():void

Strokes the path.

toPdf()method 
public function toPdf($writer:PdfWriter):Bytes

Parameters

$writer:PdfWriter

Returns
Bytes
toString()method 
public function toString():String

Returns
String
variableRectangle()method 
public function variableRectangle(rect:RectangleElement):void

Adds a variable width border to the current path. Only use if isUseVariableBorders = true

Parameters

rect:RectangleElement — a RectangleElement

Constant Detail
ALIGN_CENTERConstant
public static const ALIGN_CENTER:int = 1

ALIGN_LEFTConstant 
public static const ALIGN_LEFT:int = 0

ALIGN_RIGHTConstant 
public static const ALIGN_RIGHT:int = 2

LINE_CAP_BUTTConstant 
public static const LINE_CAP_BUTT:int = 0

LINE_CAP_PROJECTING_SQUAREConstant 
public static const LINE_CAP_PROJECTING_SQUARE:int = 2

LINE_CAP_ROUNDConstant 
public static const LINE_CAP_ROUND:int = 1

LINE_JOIN_BEVELConstant 
public static const LINE_JOIN_BEVEL:int = 2

LINE_JOIN_MITERConstant 
public static const LINE_JOIN_MITER:int = 0

LINE_JOIN_ROUNDConstant 
public static const LINE_JOIN_ROUND:int = 1

TEXT_RENDER_MODE_CLIPConstant 
public static const TEXT_RENDER_MODE_CLIP:int = 7

TEXT_RENDER_MODE_FILLConstant 
public static const TEXT_RENDER_MODE_FILL:int = 0

TEXT_RENDER_MODE_FILL_CLIPConstant 
public static const TEXT_RENDER_MODE_FILL_CLIP:int = 4

TEXT_RENDER_MODE_FILL_STROKEConstant 
public static const TEXT_RENDER_MODE_FILL_STROKE:int = 2

TEXT_RENDER_MODE_FILL_STROKE_CLIPConstant 
public static const TEXT_RENDER_MODE_FILL_STROKE_CLIP:int = 6

TEXT_RENDER_MODE_INVISIBLEConstant 
public static const TEXT_RENDER_MODE_INVISIBLE:int = 3

TEXT_RENDER_MODE_STROKEConstant 
public static const TEXT_RENDER_MODE_STROKE:int = 1

TEXT_RENDER_MODE_STROKE_CLIPConstant 
public static const TEXT_RENDER_MODE_STROKE_CLIP:int = 5