Packageorg.purepdf.pdf
Classpublic class PdfShading
InheritancePdfShading Inheritance it.sephiroth.utils.ObjectHash



Public Properties
 PropertyDefined By
  antiAlias : Boolean
PdfShading
  bBox : Vector.<Number>
PdfShading
  colorDetails : ColorDetails
[read-only]
PdfShading
  colorSpace : RGBColor
PdfShading
  shadingName : PdfName
[read-only]
PdfShading
  shadingReference : PdfIndirectReference
[read-only]
PdfShading
  writer : PdfWriter
[read-only]
PdfShading
Protected Properties
 PropertyDefined By
  _antiAlias : Boolean = false
PdfShading
  _bBox : Vector.<Number>
PdfShading
  _colorDetails : ColorDetails
PdfShading
  _shading : PdfDictionary
PdfShading
  _shadingName : PdfName
PdfShading
  _shadingReference : PdfIndirectReference
PdfShading
  _shadingType : int
PdfShading
  _writer : PdfWriter
PdfShading
Public Methods
 MethodDefined By
  
PdfShading
  
addToBody():void
PdfShading
  
[static]
PdfShading
  
complexAxial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading
[static] Create a linear gradient shading with multiple colors ( for 2 colors use simpleAxial ) Example: var cb: PdfContentByte = document.getDirectContent(); var axial: PdfShading = PdfShading.complexAxial( writer, 0, 0, 297, 420, Vector.<RGBColor>([ RGBColor.BLACK, RGBColor.BLUE, RGBColor.CYAN ]), Vector.<Number>([ 0, 0.5, 1 ] ) ); cb.paintShading( axial );
PdfShading
  
complexRadial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, r0:Number, r1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading
[static] Create a radial gradient shading with multiple colors ( for 2 colors use simpleRadial ) Example: var cb: PdfContentByte = document.getDirectContent(); var axial: PdfShading = PdfShading.complexRadial( writer, 0, 0, 297, 420, 0, 100, Vector.<RGBColor>([ RGBColor.BLACK, RGBColor.BLUE, RGBColor.CYAN ]), Vector.<Number>([ 0, 0.5, 1 ] ) ); cb.paintShading( axial );
PdfShading
  
getColorArray(color:RGBColor):Vector.<Number>
[static]
PdfShading
  
setName(number:int):void
PdfShading
  
simpleAxial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, startColor:RGBColor, endColor:RGBColor, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading
[static] Create a liear gradient shading with 2 colors Example: var cb: PdfContentByte = document.getDirectContent(); var axial: PdfShading = PdfShading.simpleAxial( writer, 0, 0, 297, 420, RGBColor.BLACK, RGBColor.BLUE ); cb.paintShading( axial );
PdfShading
  
simpleRadial(writer:PdfWriter, x0:Number, y0:Number, r0:Number, x1:Number, y1:Number, r1:Number, startColor:RGBColor, endColor:RGBColor, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading
[static]
PdfShading
  
[static]
PdfShading
  
type1(writer:PdfWriter, cs:RGBColor, domain:Vector.<Number>, tMatrix:Vector.<Number>, fn:PdfFunction):PdfShading
[static]
PdfShading
  
type2(writer:PdfWriter, cs:RGBColor, coords:Vector.<Number>, domain:Vector.<Number>, fn:PdfFunction, extend:Vector.<Boolean>):PdfShading
[static]
PdfShading
  
type3(writer:PdfWriter, cs:RGBColor, coords:Vector.<Number>, domain:Vector.<Number>, fn:PdfFunction, extend:Vector.<Boolean>):PdfShading
[static]
PdfShading
Property Detail
_antiAliasproperty
protected var _antiAlias:Boolean = false

_bBoxproperty 
protected var _bBox:Vector.<Number>

_colorDetailsproperty 
protected var _colorDetails:ColorDetails

_shadingproperty 
protected var _shading:PdfDictionary

_shadingNameproperty 
protected var _shadingName:PdfName

_shadingReferenceproperty 
protected var _shadingReference:PdfIndirectReference

_shadingTypeproperty 
protected var _shadingType:int

_writerproperty 
protected var _writer:PdfWriter

antiAliasproperty 
antiAlias:Boolean


Implementation
    public function get antiAlias():Boolean
    public function set antiAlias(value:Boolean):void
bBoxproperty 
bBox:Vector.<Number>


Implementation
    public function get bBox():Vector.<Number>
    public function set bBox(value:Vector.<Number>):void
colorDetailsproperty 
colorDetails:ColorDetails  [read-only]


Implementation
    public function get colorDetails():ColorDetails
colorSpaceproperty 
colorSpace:RGBColor


Implementation
    public function get colorSpace():RGBColor
    public function set colorSpace(value:RGBColor):void
shadingNameproperty 
shadingName:PdfName  [read-only]


Implementation
    public function get shadingName():PdfName
shadingReferenceproperty 
shadingReference:PdfIndirectReference  [read-only]


Implementation
    public function get shadingReference():PdfIndirectReference
writerproperty 
writer:PdfWriter  [read-only]


Implementation
    public function get writer():PdfWriter
Constructor Detail
PdfShading()Constructor
public function PdfShading($writer:PdfWriter)



Parameters
$writer:PdfWriter
Method Detail
addToBody()method
public function addToBody():void

checkCompatibleColors()method 
public static function checkCompatibleColors(c1:RGBColor, c2:RGBColor):void

Parameters

c1:RGBColor
 
c2:RGBColor

complexAxial()method 
public static function complexAxial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading

Create a linear gradient shading with multiple colors ( for 2 colors use simpleAxial )

Example:

Parameters

writer:PdfWriter — left side of the color rect bound
 
x0:Number — top side of the color rect bound
 
y0:Number — right side of the color rect bound
 
x1:Number — bottom side of the color rect bound
 
y1:Number — Vector of RGBColor
 
colors:Vector.<RGBColor> — Vector of Number. This is the color spread ratios. If null is passed a default ratio will be created
 
ratios:Vector.<Number>
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)

Returns
PdfShading

Throws
ArgumentError if — colors.length ne ratios.length

See also

complexRadial()method 
public static function complexRadial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, r0:Number, r1:Number, colors:Vector.<RGBColor>, ratios:Vector.<Number>, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading

Create a radial gradient shading with multiple colors ( for 2 colors use simpleRadial )

Example:

Parameters

writer:PdfWriter — left side of the color rect bound
 
x0:Number — top side of the color rect bound
 
y0:Number — right side of the color rect bound
 
x1:Number — bottom side of the color rect bound
 
y1:Number — Inner radius
 
r0:Number — Outer radius
 
r1:Number — Vector of RGBColor
 
colors:Vector.<RGBColor> — Vector of Number. This is the color spread ratios. If null is passed a default ratio will be created
 
ratios:Vector.<Number>
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)

Returns
PdfShading

Throws
ArgumentError if — colors.length ne ratios.length

See also

getColorArray()method 
public static function getColorArray(color:RGBColor):Vector.<Number>

Parameters

color:RGBColor

Returns
Vector.<Number>
setName()method 
public function setName(number:int):void

Parameters

number:int

simpleAxial()method 
public static function simpleAxial(writer:PdfWriter, x0:Number, y0:Number, x1:Number, y1:Number, startColor:RGBColor, endColor:RGBColor, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading

Create a liear gradient shading with 2 colors

Example:

Parameters

writer:PdfWriter — left side of the color rect bound
 
x0:Number — top side of the color rect bound
 
y0:Number — right side of the color rect bound
 
x1:Number — bottom side of the color rect bound
 
y1:Number — gradient start color
 
startColor:RGBColor — gradient end color
 
endColor:RGBColor
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)

Returns
PdfShading

See also

simpleRadial()method 
public static function simpleRadial(writer:PdfWriter, x0:Number, y0:Number, r0:Number, x1:Number, y1:Number, r1:Number, startColor:RGBColor, endColor:RGBColor, extendStart:Boolean = true, extendEnd:Boolean = true):PdfShading

Parameters

writer:PdfWriter
 
x0:Number
 
y0:Number
 
r0:Number
 
x1:Number
 
y1:Number
 
r1:Number
 
startColor:RGBColor
 
endColor:RGBColor
 
extendStart:Boolean (default = true)
 
extendEnd:Boolean (default = true)

Returns
PdfShading
throwColorSpaceErrror()method 
public static function throwColorSpaceErrror():void

type1()method 
public static function type1(writer:PdfWriter, cs:RGBColor, domain:Vector.<Number>, tMatrix:Vector.<Number>, fn:PdfFunction):PdfShading

Parameters

writer:PdfWriter
 
cs:RGBColor
 
domain:Vector.<Number>
 
tMatrix:Vector.<Number>
 
fn:PdfFunction

Returns
PdfShading
type2()method 
public static function type2(writer:PdfWriter, cs:RGBColor, coords:Vector.<Number>, domain:Vector.<Number>, fn:PdfFunction, extend:Vector.<Boolean>):PdfShading

Parameters

writer:PdfWriter
 
cs:RGBColor
 
coords:Vector.<Number>
 
domain:Vector.<Number>
 
fn:PdfFunction
 
extend:Vector.<Boolean>

Returns
PdfShading
type3()method 
public static function type3(writer:PdfWriter, cs:RGBColor, coords:Vector.<Number>, domain:Vector.<Number>, fn:PdfFunction, extend:Vector.<Boolean>):PdfShading

Parameters

writer:PdfWriter
 
cs:RGBColor
 
coords:Vector.<Number>
 
domain:Vector.<Number>
 
fn:PdfFunction
 
extend:Vector.<Boolean>

Returns
PdfShading