Packageorg.purepdf.elements
Classpublic class Chunk
InheritanceChunk Inheritance Object
Implements IElement



Public Properties
 PropertyDefined By
  attributes : HashMap
Chunk
  content : String
[read-only]
Chunk
  font : Font
Chunk
  hasAttributes : Boolean
[read-only]
Chunk
  isContent : Boolean
[read-only]
Chunk
  isEmpty : Boolean
[read-only]
Chunk
  isNestable : Boolean
[read-only]
Chunk
  _NEXTPAGE : Chunk
[static]
Chunk
  NEXTPAGE : Chunk
[static] [read-only]
Chunk
  type : int
[read-only]
Chunk
Protected Properties
 PropertyDefined By
  _attributes : HashMap = null
Chunk
  _content : String
Chunk
  _font : Font
Chunk
Public Methods
 MethodDefined By
  
Chunk(content:String, font:Font = null)
Chunk
  
append(value:String):String
Chunk
  
fromImage(image:ImageElement, offsetX:Number, offsetY:Number):Chunk
[static]
Chunk
  
getChunks():Vector.<Object>
Chunk
  
Chunk
  
Chunk
  
getTextRise():Number
Gets the text displacement relative to the baseline
Chunk
  
getWidthPoint():Number
Gets the width of the Chunk in points.
Chunk
  
process(listener:IElementListener):Boolean
Chunk
  
Chunk
  
setAnchor(url:String):Chunk
Chunk
  
Chunk
  
setAttribute(name:String, obj:Object):Chunk
Chunk
  
setBackground(color:RGBColor, extraLeft:Number = 0, extraBottom:Number = 0, extraRight:Number = 0, extraTop:Number = 0):Chunk
Set the color and size of the background color for this chunk element
Chunk
  
setGenericTag(text:String):Chunk
Sets the generic tag Chunk.
Chunk
  
Sets the text horizontal scaling.
Chunk
  
Chunk
  
setLocalGoto(name:String):Chunk
Chunk
  
Chunk
  
setSkew(alpha:Number, beta:Number):Chunk
Skews the text to simulate italic and other effects
Chunk
  
Chunk
  
setTextRenderMode(mode:int, strokeWidth:Number, strokeColor:RGBColor):Chunk
Sets the text rendering mode.
Chunk
  
setTextRise(rise:Number):Chunk
Chunk
  
setUnderline(color:RGBColor = null, thickness:Number = 1, thicknessMul:Number = 0, yPosition:Number = 0, yPositionMul:Number = 0, cap:int = 0):Chunk
Chunk
  
toString():String
Chunk
Public Constants
 ConstantDefined By
  ACTION : String = ACTION
[static]
Chunk
  BACKGROUND : String = BACKGROUND
[static]
Chunk
  CHAR_SPACING : String = CHAR_SPACING
[static]
Chunk
  COLOR : String = COLOR
[static]
Chunk
  ENCODING : String = ENCODING
[static]
Chunk
  GENERICTAG : String = GENERICTAG
[static]
Chunk
  HSCALE : String = HSCALE
[static]
Chunk
  HYPHENATION : String = HYPHENATION
[static]
Chunk
  IMAGE : String = IMAGE
[static]
Chunk
  LOCALDESTINATION : String = LOCALDESTINATION
[static]
Chunk
  LOCALGOTO : String = LOCALGOTO
[static]
Chunk
  NEWLINE : Chunk
[static]
Chunk
  NEWPAGE : String = NEWPAGE
[static]
Chunk
  OBJECT_REPLACEMENT_CHARACTER : String = 
[static]
Chunk
  PDFANNOTATION : String = PDFANNOTATION
[static]
Chunk
  REMOTEGOTO : String = REMOTEGOTO
[static]
Chunk
  SEPARATOR : String = SEPARATOR
[static]
Chunk
  SKEW : String = SKEW
[static]
Chunk
  SPLITCHARACTER : String = SPLITCHARACTER
[static]
Chunk
  SUBSUPSCRIPT : String = SUBSUPSCRIPT
[static]
Chunk
  TAB : String = TAB
[static]
Chunk
  TEXTRENDERMODE : String = TEXTRENDERMODE
[static]
Chunk
  UNDERLINE : String = UNDERLINE
[static]
Chunk
Property Detail
_attributesproperty
protected var _attributes:HashMap = null

_contentproperty 
protected var _content:String

_fontproperty 
protected var _font:Font

_NEXTPAGEproperty 
public static var _NEXTPAGE:Chunk

attributesproperty 
attributes:HashMap


Implementation
    public function get attributes():HashMap
    public function set attributes(value:HashMap):void
contentproperty 
content:String  [read-only]


Implementation
    public function get content():String
fontproperty 
font:Font


Implementation
    public function get font():Font
    public function set font(value:Font):void
hasAttributesproperty 
hasAttributes:Boolean  [read-only]


Implementation
    public function get hasAttributes():Boolean
isContentproperty 
isContent:Boolean  [read-only]


Implementation
    public function get isContent():Boolean
isEmptyproperty 
isEmpty:Boolean  [read-only]


Implementation
    public function get isEmpty():Boolean
isNestableproperty 
isNestable:Boolean  [read-only]


Implementation
    public function get isNestable():Boolean
NEXTPAGEproperty 
NEXTPAGE:Chunk  [read-only]


Implementation
    public static function get NEXTPAGE():Chunk
typeproperty 
type:int  [read-only]


Implementation
    public function get type():int
Constructor Detail
Chunk()Constructor
public function Chunk(content:String, font:Font = null)



Parameters
content:String
 
font:Font (default = null)
Method Detail
append()method
public function append(value:String):String

Parameters

value:String

Returns
String
fromImage()method 
public static function fromImage(image:ImageElement, offsetX:Number, offsetY:Number):Chunk

Parameters

image:ImageElement
 
offsetX:Number
 
offsetY:Number

Returns
Chunk
getChunks()method 
public function getChunks():Vector.<Object>

Returns
Vector.<Object>
getHorizontalScaling()method 
public function getHorizontalScaling():Number

Returns
Number
getImage()method 
public function getImage():ImageElement

Returns
ImageElement
getTextRise()method 
public function getTextRise():Number

Gets the text displacement relative to the baseline

Returns
Number
getWidthPoint()method 
public function getWidthPoint():Number

Gets the width of the Chunk in points.

Returns
Number — a width in points
process()method 
public function process(listener:IElementListener):Boolean

Parameters

listener:IElementListener

Returns
Boolean
setAction()method 
public function setAction(action:PdfAction):Chunk

Parameters

action:PdfAction

Returns
Chunk
setAnchor()method 
public function setAnchor(url:String):Chunk

Parameters

url:String

Returns
Chunk
setAnnotation()method 
public function setAnnotation(annotation:PdfAnnotation):Chunk

Parameters

annotation:PdfAnnotation

Returns
Chunk
setAttribute()method 
public function setAttribute(name:String, obj:Object):Chunk

Parameters

name:String
 
obj:Object

Returns
Chunk
setBackground()method 
public function setBackground(color:RGBColor, extraLeft:Number = 0, extraBottom:Number = 0, extraRight:Number = 0, extraTop:Number = 0):Chunk

Set the color and size of the background color for this chunk element

Parameters

color:RGBColor
 
extraLeft:Number (default = 0)
 
extraBottom:Number (default = 0)
 
extraRight:Number (default = 0)
 
extraTop:Number (default = 0)

Returns
Chunk
setGenericTag()method 
public function setGenericTag(text:String):Chunk

Sets the generic tag Chunk. The text for this tag can be retrieved with ChunkEvent.

Parameters

text:String

Returns
Chunk

See also

setHorizontalScaling()method 
public function setHorizontalScaling(scale:Number):Chunk

Sets the text horizontal scaling. A value of 1 is normal and a value of 0.5f shrinks the text to half it's width.

Parameters

scale:Number

Returns
Chunk
setLocalDestination()method 
public function setLocalDestination(name:String):Chunk

Parameters

name:String

Returns
Chunk
setLocalGoto()method 
public function setLocalGoto(name:String):Chunk

Parameters

name:String

Returns
Chunk
setNewPage()method 
public function setNewPage():Chunk

Returns
Chunk
setSkew()method 
public function setSkew(alpha:Number, beta:Number):Chunk

Skews the text to simulate italic and other effects

Parameters

alpha:Number — the first angle in degrees
 
beta:Number — the second angle in degrees

Returns
Chunk
setSplitCharacter()method 
public function setSplitCharacter(value:ISplitCharacter):Chunk

Parameters

value:ISplitCharacter

Returns
Chunk
setTextRenderMode()method 
public function setTextRenderMode(mode:int, strokeWidth:Number, strokeColor:RGBColor):Chunk

Sets the text rendering mode. It can outline text, simulate bold and make text invisible.

Parameters

mode:int — It can be PdfContentByte.TEXT_RENDER_MODE_FILL, PdfContentByte.TEXT_RENDER_MODE_STROKE, PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE and PdfContentByte.TEXT_RENDER_MODE_INVISIBLE .
 
strokeWidth:Number — the stroke line width for the modes PdfContentByte.TEXT_RENDER_MODE_STROKE and PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE
 
strokeColor:RGBColor

Returns
Chunk

See also

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

Parameters

rise:Number

Returns
Chunk
setUnderline()method 
public function setUnderline(color:RGBColor = null, thickness:Number = 1, thicknessMul:Number = 0, yPosition:Number = 0, yPositionMul:Number = 0, cap:int = 0):Chunk

Parameters

color:RGBColor (default = null) — the color of the line. null to use text color
 
thickness:Number (default = 1) — the weight of the line
 
thicknessMul:Number (default = 0) — thickness multiplication factor with the font size
 
yPosition:Number (default = 0) — absolute y position relative to the baseline
 
yPositionMul:Number (default = 0) — position multiplication factor with the font size
 
cap:int (default = 0) — the end line cap. Allowed values are PdfContentByte.LINE_CAP_BUTT, PdfContentByte.LINE_CAP_ROUND and PdfContentByte.LINE_CAP_PROJECTING_SQUARE

Returns
Chunk

See also

toString()method 
public function toString():String

Returns
String
Constant Detail
ACTIONConstant
public static const ACTION:String = ACTION

BACKGROUNDConstant 
public static const BACKGROUND:String = BACKGROUND

CHAR_SPACINGConstant 
public static const CHAR_SPACING:String = CHAR_SPACING

COLORConstant 
public static const COLOR:String = COLOR

ENCODINGConstant 
public static const ENCODING:String = ENCODING

GENERICTAGConstant 
public static const GENERICTAG:String = GENERICTAG

HSCALEConstant 
public static const HSCALE:String = HSCALE

HYPHENATIONConstant 
public static const HYPHENATION:String = HYPHENATION

IMAGEConstant 
public static const IMAGE:String = IMAGE

LOCALDESTINATIONConstant 
public static const LOCALDESTINATION:String = LOCALDESTINATION

LOCALGOTOConstant 
public static const LOCALGOTO:String = LOCALGOTO

NEWLINEConstant 
public static const NEWLINE:Chunk

NEWPAGEConstant 
public static const NEWPAGE:String = NEWPAGE

OBJECT_REPLACEMENT_CHARACTERConstant 
public static const OBJECT_REPLACEMENT_CHARACTER:String = 

PDFANNOTATIONConstant 
public static const PDFANNOTATION:String = PDFANNOTATION

REMOTEGOTOConstant 
public static const REMOTEGOTO:String = REMOTEGOTO

SEPARATORConstant 
public static const SEPARATOR:String = SEPARATOR

SKEWConstant 
public static const SKEW:String = SKEW

SPLITCHARACTERConstant 
public static const SPLITCHARACTER:String = SPLITCHARACTER

SUBSUPSCRIPTConstant 
public static const SUBSUPSCRIPT:String = SUBSUPSCRIPT

TABConstant 
public static const TAB:String = TAB

TEXTRENDERMODEConstant 
public static const TEXTRENDERMODE:String = TEXTRENDERMODE

UNDERLINEConstant 
public static const UNDERLINE:String = UNDERLINE