Packageorg.alivepdf.pdf
Classpublic class UnicodePDF
InheritanceUnicodePDF Inheritance PDF Inheritance Object



Public Properties
 PropertyDefined By
  isUnicode : Boolean
Getter/Setter for _cidFont
UnicodePDF
 InheritedtotalFonts : int
[read-only] Lets you retrieve the total number of fonts used in the PDF document.
PDF
 InheritedtotalPages : int
[read-only] Lets you retrieve the number of pages in the PDF document.
PDF
Protected Properties
 PropertyDefined By
  _cache_maxsize_UTF8StringToArray : Number = 100
[static] Gestion CID Font unicode
UnicodePDF
  _cache_size_UTF8StringToArray : Number = 0
UnicodePDF
  _cache_UTF8StringToArray : Object
UnicodePDF
  _cache_UTF8StringToArrayKeys : Array
UnicodePDF
Public Methods
 MethodDefined By
  
UnicodePDF(orientation:String = Portrait, unit:String = Mm, autoPageBreak:Boolean = true, pageSize:Size = null, rotation:int = 0)
UnicodePDF
 Inherited
addAnnotation(annotation:Annotation):void
Lets you add an annotation to the current page
PDF
 Inherited
addBookmark(text:String, level:int = 0, y:Number = -1, color:RGBColor = null):void
Lets you add a bookmark.
PDF
 Inherited
addCell(width:Number = 0, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
Add a cell with some text to the current page.
PDF
 Inherited
addCellFitScale(width:Number, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
Adds a cell with horizontal scaling only if necessary
PDF
 Inherited
addCellFitScaleForce(width:Number, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
Adds a cell with horizontal scaling always
PDF
 Inherited
addCellFitSpace(width:Number, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
Adds a cell with character spacing only if necessary
PDF
 Inherited
addCellFitSpaceForce(width:Number, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
Adds a cell with character spacing always
PDF
 Inherited
addCodaBar(codaBar:CodaBar):void
Allows you to add a CodaBar (Monarch) to the current page at any position.
PDF
 Inherited
addEPSImage(stream:ByteArray, x:Number = 0, y:Number = 0, w:Number = 0, h:Number = 0, useBoundingBox:Boolean = true):void
The addEPSImage method takes an incoming EPS (.eps) file or Adobe® Illustrator® file (.ai) and render it on the current page.
PDF
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
PDF
 Inherited
addGrid(grid:Grid, x:Number = 0, y:Number = 0, repeatHeader:Boolean = true):void
Adds a dynamic table to the current page.
PDF
 Inherited
addImage(displayObject:DisplayObject, resizeMode:Resize = null, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, rotation:Number = 0, alpha:Number = 1, keepTransformation:Boolean = true, imageFormat:String = PNG, quality:Number = 100, blendMode:String = Normal, link:ILink = null):void
The addImage method takes an incoming DisplayObject.
PDF
 Inherited
addImageStream(imageBytes:ByteArray, colorSpace:String, resizeMode:Resize = null, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, rotation:Number = 0, alpha:Number = 1, blendMode:String = Normal, link:ILink = null):void
The addImageStream method takes an incoming image as a ByteArray.
PDF
 Inherited
addJavaScript(script:String):void
The addJavaScript allows you to inject JavaScript code to be executed when the PDF document is opened.
PDF
 Inherited
addLink(x:Number, y:Number, width:Number, height:Number, link:ILink, highlight:String = I):void
Lets you add clickable link to a specific position Link can be internal (document level navigation) or external (HTTP).
PDF
 Inherited
addMultiCell(width:Number, height:Number, text:String, border:* = 0, align:String = J, filled:int = 0):void
Add a multicell with some text to the current page.
PDF
 Inherited
addPage(page:Page = null):Page
Lets you add a page to the current PDF.
PDF
 Inherited
addText(text:String, x:Number = 0, y:Number = 0):void
Lets you set some text to any position on the page.
PDF
 Inherited
addTransition(style:String = R, duration:Number = 1, dimension:String = H, motionDirection:String = I, transitionDirection:int = 0):void
Lets you add a transition between each PDF page Note : PDF must be shown in fullscreen to see the transitions, use the setDisplayMode method with the PageMode.FULL_SCREEN parameter.
PDF
 Inherited
beginBitmapFill(bitmap:BitmapData, matrix:Matrix = null):void
The beginBitmapFill method fills a surface with a bitmap as a texture.
PDF
 Inherited
beginFill(color:IColor, tint:Number = 100):void
Sets the filling color for different color spaces CMYK, RGB or DEVICEGRAY.
PDF
 Inherited
clip(x:Number, y:Number, width:Number, height:Number):void
PDF
 Inherited
clippedCell(width:Number, height:Number = 0, text:String, border:* = 0, ln:Number = 0, align:String, fill:Number = 0, link:ILink = null):void
PDF
 Inherited
clippingCircle(x:Number, y:Number, radius:Number, outline:Boolean = false):void
PDF
 Inherited
clippingEllipse(x:Number, y:Number, ty:Number, ry:Number, outline:Boolean = false):void
PDF
 Inherited
clippingPolygon(points:Array, outline:Boolean = false):void
PDF
 Inherited
clippingRect(x:Number, y:Number, width:Number, height:Number, outline:Boolean = false):void
PDF
 Inherited
clippingRoundedRect(x:Number, y:Number, width:Number, height:Number, radius:Number, outline:Boolean = false):void
PDF
 Inherited
clippingText(x:Number, y:Number, text:String, outline:Boolean = false):void
PDF
 Inherited
curveTo(controlX1:Number, controlY1:Number, controlX2:Number, controlY2:Number, finalX3:Number, finalY3:Number):void
The curveTo method draws a cubic bezier curve.
PDF
 Inherited
dispatchEvent(event:Event):Boolean
PDF
 Inherited
drawCircle(x:Number, y:Number, radius:Number):void
The drawCircle method draws a circle.
PDF
 Inherited
drawEllipse(x:Number, y:Number, radiusX:Number, radiusY:Number):void
The drawEllipse method draws an ellipse.
PDF
 Inherited
drawLine(x1:Number, y1:Number, x2:Number, y2:Number):void
PDF
 Inherited
drawPolygone(points:Array):void
The drawPolygone method draws a polygone.
PDF
 Inherited
drawRect(rect:Rectangle):void
The drawRect method draws a rectangle shape.
PDF
 Inherited
drawRoundRect(rect:Rectangle, ellipseWidth:Number):void
The drawRoundedRect method draws a rounded rectangle shape.
PDF
 Inherited
drawRoundRectComplex(rect:Rectangle, topLeftEllipseWidth:Number, topRightEllipseWidth:Number, bottomLeftEllipseWidth:Number, bottomRightEllipseWidth:Number):void
The drawComplexRoundRect method draws a rounded rectangle shape.
PDF
 Inherited
drawSector(xCenter:Number, yCenter:Number, radius:Number, a:Number, b:Number, style:String = FD, clockWise:Boolean = true, angleOrigin:Number = 90):void
The drawSector method draws a sector, which allows you to draw a pie chart.
PDF
 Inherited
end(closePath:Boolean = true):void
The end method closes the stroke.
PDF
 Inherited
endFill():void
Ends all previous filling.
PDF
 Inherited
footer(footerText:String, showPageNumber:Boolean = false, position:String = left):void
PDF
 Inherited
Returns an InternalLink object linked to the current page at the current Y in the page.
PDF
 Inherited
Lets you retrieve the current Page.
PDF
 Inherited
Returns the default PDF orientation.
PDF
 Inherited
Returns the default PDF Size.
PDF
 Inherited
Returns the default PDF unit unit.
PDF
 Inherited
getFonts():Array
Lets you retrieve the fonts used in the PDF document.
PDF
 Inherited
getMargins():Rectangle
Lets you retrieve the margins dimensions.
PDF
 Inherited
getPage(index:int):Page
Lets you retrieve a Page object.
PDF
 Inherited
getPages():Array
Lets you retrieve all the PDF pages.
PDF
 Inherited
getX():Number
Lets you retrieve the X position for the current page.
PDF
 Inherited
getY():Number
Lets you retrieve the Y position for the current page.
PDF
 Inherited
gotoPage(index:int):void
Lets you move to a Page in the PDF.
PDF
 Inherited
hasEventListener(type:String):Boolean
PDF
 Inherited
header(headerText:String):void
PDF
 Inherited
linearGradient(x:Number, y:Number, width:Number, height:Number, col1:Array, col2:Array, coordinates:Array):void
PDF
 Inherited
lineStyle(color:IColor, thickness:Number = 1, flatness:Number = 0, alpha:Number = 1, rule:String = NonZeroWinding, blendMode:String = Normal, style:DashedLine = null, caps:String = null, joints:String = null, miterLimit:Number = 3):void
Sets the stroke style.
PDF
 Inherited
lineTo(x:Number, y:Number):void
Lets you draw a stroke from the current point to the new point.
PDF
 Inherited
moveTo(x:Number, y:Number):void
Lets you move the current drawing point to the specified destination.
PDF
 Inherited
newLine(height:*):void
Lets you insert a line break for text.
PDF
 Inherited
radialGradient(x:Number, y:Number, width:Number, height:Number, col1:Array, col2:Array, coordinates:Array):void
PDF
 Inherited
Lets you remove all the pages from the PDF.
PDF
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
PDF
 Inherited
removeFont(font:IFont):void
Lets you remove an embedded font from the PDF.
PDF
 Inherited
removePage(index:int):Page
Lets you remove a Page from the PDF.
PDF
 Inherited
Lets you reset the margins dimensions.
PDF
 Inherited
rotate(angle:Number, x:Number = -1, y:Number = -1):void
Allows you to rotate any content drawn after the rotate() call
PDF
 Inherited
rotatePage(number:int, rotation:Number):void
Lets you rotate a specific page (between 1 and n-1).
PDF
 Inherited
save(method:String, url:String, downloadMethod:String = inline, fileName:String = generated.pdf, frame:String = _blank):*
Allows you to save the PDF locally (Flash Player 10 minmum required) or remotely through a server-side script.
PDF
 Inherited
setAdvanceTiming(timing:int):void
Lets you set specify the timing (in seconds) a page is shown when the PDF is shown in fullscreen mode.
PDF
 Inherited
setAliasNbPages(alias:String = {nb}):void
Lets you specify an alias for the total number of pages.
PDF
 Inherited
setAlpha(alpha:Number, blendMode:String = Normal):void
Lets you specify the opacity for the next drawing operations, from 0 (100% transparent) to 1 (100% opaque).
PDF
 Inherited
setAuthor(author:String):void
Sets the specified author for the PDF.
PDF
 Inherited
setAutoPageBreak(auto:Boolean, margin:Number):void
Lets you enable or disable auto page break mode and triggering margin.
PDF
 Inherited
setBottomMargin(margin:Number):void
Lets you specify the bottom margin
PDF
 Inherited
setCreator(creator:String):void
Sets the specified creator for the PDF.
PDF
 Inherited
setDisplayMode(zoom:String = FullWidth, layout:String = SinglePage, mode:String = UseNone, zoomValue:Number = 1):void
Lets you set a specific display mode, the DisplayMode takes care of the general layout of the PDF in the PDF reader
PDF
 Inherited
setFont(font:IFont, size:int = 12, underlined:Boolean = false):void
Lets you set a specific font.
PDF
 Inherited
setFontSize(size:int):void
Lets you set a new size for the current font.
PDF
 Inherited
setGridPositionOnNextPages(xvalue:Number = 10, yvalue:Number = 10):void
This method is used to add grid when used in auto mode for big chunck of data into other pages.
PDF
 Inherited
setKeywords(keywords:String):void
Sets the specified keywords for the PDF.
PDF
 Inherited
setLeftMargin(margin:Number):void
Lets you specify the left margin.
PDF
 Inherited
setMargins(left:Number, top:Number, right:Number = -1, bottom:Number = 20):void
Lets you specify the left, top, and right margins.
PDF
 Inherited
setRightMargin(margin:Number):void
Lets you specify the right margin.
PDF
 Inherited
setStartingPage(index:int):void
Lets you specify which page should be viewed by default when the document is opened.
PDF
 Inherited
setSubject(subject:String):void
Lets you set a subject for the PDF.
PDF
 Inherited
setTitle(title:String):void
Lets you set a title for the PDF.
PDF
 Inherited
setTopMargin(margin:Number):void
Lets you specify the top margin.
PDF
 Inherited
setViewerPreferences(toolbar:String = false, menubar:String = false, windowUI:String = false, fitWindow:String = false, centeredWindow:String = false, displayTitle:String = false):void
Lets you control the way the document is to be presented on the screen or in print.
PDF
 Inherited
setVisible(visible:String):void
PDF
 Inherited
setX(x:Number):void
Lets you specify the X position for the current page.
PDF
 Inherited
setXY(x:Number, y:Number):void
Lets you specify the X and Y position for the current page.
PDF
 Inherited
setY(y:Number):void
Lets you specify the Y position for the current page.
PDF
 Inherited
skew(ax:Number, ay:Number, x:Number = -1, y:Number = -1):void
Allows you to skew any content drawn after the skew() call
PDF
 Inherited
textStyle(color:IColor, alpha:Number = 1, rendering:int = 0, wordSpace:Number = 0, characterSpace:Number = 0, scale:Number = 100, leading:Number = 0):void
Sets the text style with an appropriate color, alpha etc.
PDF
 Inherited
toString():String
PDF
 Inherited
PDF
 Inherited
willTrigger(type:String):Boolean
PDF
  
writeFlashHtmlText(pHeight:Number, pText:String, pLink:ILink = null):void
[override]
UnicodePDF
 Inherited
writeText(lineHeight:Number, text:String, link:ILink = null):void
Lets you write some text in the current page.
PDF
Protected Methods
 MethodDefined By
  
_putfontwidths(cidFont:ICidFont, cidoffset:int = 0):void
Outputs font widths
UnicodePDF
  
[override]
UnicodePDF
  
arrUTF8ToUTF16BE(unicode:Array, setbom:Boolean = false):String
Converts array of UTF-8 characters to UTF16-BE string. Based on: http://www.faqs.org/rfcs/rfc2781.html Encoding UTF-16: Encoding of a single character from an ISO 10646 character value to UTF-16 proceeds as follows.
UnicodePDF
  
countUniqueValues(arr:Array):Number
UnicodePDF
  
escapeIt(content:String):String
[override]
UnicodePDF
  
fromCharCode(code:uint):String
UnicodePDF
  
implode(arr:Array, sep:String = ):String
UnicodePDF
  
[override]
UnicodePDF
  
putcidfont0(cdiFont:ICidFont):void
Output CID-0 fonts.
UnicodePDF
  
UTF8StringToArray(str:String, strBytes:ByteArray):Array
Converts UTF-8 strings to codepoints array. Invalid byte sequences will be replaced with 0xFFFD (replacement character) Based on: http://www.faqs.org/rfcs/rfc3629.html Char.
UnicodePDF
  
writeStream(stream:String):void
[override]
UnicodePDF
Events
 Event Summary Defined By
 InheritedDispatched when a page has been added to the PDF.PDF
 InheritedDispatched when PDF has been generated and available.PDF
 InheritedDispatched when the PDF page tree has been generated.PDF
 InheritedDispatched when the required resources (fonts, images, etc.) haven been written into the PDF.PDF
 InheritedDispatched when the PDF generation has been initiated.PDF
Property Detail
_cache_maxsize_UTF8StringToArrayproperty
protected static var _cache_maxsize_UTF8StringToArray:Number = 100

Gestion CID Font unicode

_cache_size_UTF8StringToArrayproperty 
protected var _cache_size_UTF8StringToArray:Number = 0

_cache_UTF8StringToArrayproperty 
protected var _cache_UTF8StringToArray:Object

_cache_UTF8StringToArrayKeysproperty 
protected var _cache_UTF8StringToArrayKeys:Array

isUnicodeproperty 
isUnicode:Boolean

Getter/Setter for _cidFont


Implementation
    public function get isUnicode():Boolean
    public function set isUnicode(value:Boolean):void
Constructor Detail
UnicodePDF()Constructor
public function UnicodePDF(orientation:String = Portrait, unit:String = Mm, autoPageBreak:Boolean = true, pageSize:Size = null, rotation:int = 0)



Parameters
orientation:String (default = Portrait)
 
unit:String (default = Mm)
 
autoPageBreak:Boolean (default = true)
 
pageSize:Size (default = null)
 
rotation:int (default = 0)
Method Detail
_putfontwidths()method
protected function _putfontwidths(cidFont:ICidFont, cidoffset:int = 0):void

Since : 4.4.000 (2008-12-07)

Outputs font widths

Parameters

cidFont:ICidFont
 
cidoffset:int (default = 0)

addFont()method 
override protected function addFont(font:IFont):IFont

Parameters

font:IFont

Returns
IFont
arrUTF8ToUTF16BE()method 
protected function arrUTF8ToUTF16BE(unicode:Array, setbom:Boolean = false):String

Since : 2.1.000 (2008-01-08)

Converts array of UTF-8 characters to UTF16-BE string. Based on: http://www.faqs.org/rfcs/rfc2781.html

		   Encoding UTF-16:
		 
		   Encoding of a single character from an ISO 10646 character value to
		    UTF-16 proceeds as follows. Let U be the character number, no greater
		    than 0x10FFFF.
		 
		    1) If U is less than 0x10000, encode U as a 16-bit unsigned integer and
		       terminate.
		 
		    2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF,
		       U' must be less than or equal to 0xFFFFF. That is, U' can be
		       represented in 20 bits.
		 
		    3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and
		       0xDC00, respectively. These integers each have 10 bits free to
		       encode the character value, for a total of 20 bits.
		 
		    4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order
		       bits of W1 and the 10 low-order bits of U' to the 10 low-order
		       bits of W2. Terminate.
		 
		    Graphically, steps 2 through 4 look like:
		    U' = yyyyyyyyyyxxxxxxxxxx
		    W1 = 110110yyyyyyyyyy
		    W2 = 110111xxxxxxxxxx
		 

Parameters

unicode:Array — $unicode array containing UTF-8 unicode values
 
setbom:Boolean (default = false) — $setbom if true set the Byte Order Mark (BOM = 0xFEFF)

Returns
String — string

See also

UTF8ToUTF16BE()
countUniqueValues()method 
protected function countUniqueValues(arr:Array):Number

Parameters

arr:Array

Returns
Number
escapeIt()method 
override protected function escapeIt(content:String):String

Parameters

content:String

Returns
String
fromCharCode()method 
protected function fromCharCode(code:uint):String

Parameters

code:uint

Returns
String
implode()method 
protected function implode(arr:Array, sep:String = ):String

Parameters

arr:Array
 
sep:String (default = )

Returns
String
insertFonts()method 
override protected function insertFonts():void

putcidfont0()method 
protected function putcidfont0(cdiFont:ICidFont):void

Since : 3.2.000 (2008-06-23)

Output CID-0 fonts.

Parameters

cdiFont:ICidFont — $font font data

UTF8StringToArray()method 
protected function UTF8StringToArray(str:String, strBytes:ByteArray):Array

Since : 1.53.0.TC005 (2005-01-05)

Converts UTF-8 strings to codepoints array. Invalid byte sequences will be replaced with 0xFFFD (replacement character) Based on: http://www.faqs.org/rfcs/rfc3629.html

		 	  Char. number range  |        UTF-8 octet sequence
		       (hexadecimal)    |              (binary)
		    --------------------+-----------------------------------------------
		    0000 0000-0000 007F | 0xxxxxxx
		    0000 0080-0000 07FF | 110xxxxx 10xxxxxx
		    0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
		    0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
		    ---------------------------------------------------------------------
		 		   ABFN notation:
		   ---------------------------------------------------------------------
		   UTF8-octets =  UTF8-char )
		   UTF8-char   = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
		   UTF8-1      = %x00-7F
		   UTF8-2      = %xC2-DF UTF8-tail
		 		   UTF8-3      = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
		                 %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
		   UTF8-4      = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
		                 %xF4 %x80-8F 2( UTF8-tail )
		   UTF8-tail   = %x80-BF
		   ---------------------------------------------------------------------
		 

Parameters

str:String — $str string to process.
 
strBytes:ByteArray

Returns
Array — array containing codepoints (UTF-8 characters values)
writeFlashHtmlText()method 
override public function writeFlashHtmlText(pHeight:Number, pText:String, pLink:ILink = null):void

Parameters

pHeight:Number
 
pText:String
 
pLink:ILink (default = null)

writeStream()method 
override protected function writeStream(stream:String):void

Parameters

stream:String