at level run boundaries.
$prevlevel = -1;
$levcount = 0;
for ($i=0; $i < $numchars; $i++) {
if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) {
if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) {
$chardata[$i]['type'] = 'L';
} elseif (($chardata[$i]['type'] == 'N') AND
(($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND
(($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) {
$chardata[$i]['type'] = 'R';
} elseif ($chardata[$i]['type'] == 'N') {
// N2. Any remaining neutrals take the embedding direction
$chardata[$i]['type'] = $chardata[$i]['sor'];
}
} elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) {
// first char
if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) {
$chardata[$i]['type'] = 'L';
} elseif (($chardata[$i]['type'] == 'N') AND
(($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND
(($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) {
$chardata[$i]['type'] = 'R';
} elseif ($chardata[$i]['type'] == 'N') {
// N2. Any remaining neutrals take the embedding direction
$chardata[$i]['type'] = $chardata[$i]['sor'];
}
} elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) {
//last char
if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) {
$chardata[$i]['type'] = 'L';
} elseif (($chardata[$i]['type'] == 'N') AND
(($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND
(($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) {
$chardata[$i]['type'] = 'R';
} elseif ($chardata[$i]['type'] == 'N') {
// N2. Any remaining neutrals take the embedding direction
$chardata[$i]['type'] = $chardata[$i]['sor'];
}
} elseif ($chardata[$i]['type'] == 'N') {
// N2. Any remaining neutrals take the embedding direction
$chardata[$i]['type'] = $chardata[$i]['sor'];
}
if ($chardata[$i]['level'] != $prevlevel) {
$levcount = 0;
} else {
$levcount++;
}
$prevlevel = $chardata[$i]['level'];
}
// I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels.
// I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level.
for ($i=0; $i < $numchars; $i++) {
$odd = $chardata[$i]['level'] % 2;
if ($odd) {
if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')){
$chardata[$i]['level'] += 1;
}
} else {
if ($chardata[$i]['type'] == 'R') {
$chardata[$i]['level'] += 1;
} elseif (($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')){
$chardata[$i]['level'] += 2;
}
}
$maxlevel = max($chardata[$i]['level'],$maxlevel);
}
// L1. On each line, reset the embedding level of the following characters to the paragraph embedding level:
// 1. Segment separators,
// 2. Paragraph separators,
// 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and
// 4. Any sequence of white space characters at the end of the line.
for ($i=0; $i < $numchars; $i++) {
if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) {
$chardata[$i]['level'] = $pel;
} elseif ($chardata[$i]['type'] == 'WS') {
$j = $i+1;
while ($j < $numchars) {
if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR
(($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) {
$chardata[$i]['level'] = $pel;;
break;
} elseif ($chardata[$j]['type'] != 'WS') {
break;
}
$j++;
}
}
}
// Arabic Shaping
// Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run.
if ($arabic) {
for ($i=0; $i < $numchars; $i++) {
if ($unicode[$chardata[$i]['char']] == 'AL') {
if (($i > 0) AND (($i+1) < $numchars) AND
($unicode[$chardata[($i-1)]['char']] == 'AL') AND
($unicode[$chardata[($i+1)]['char']] == 'AL') AND
($chardata[($i-1)]['type'] == $chardata[$i]['type']) AND
($chardata[($i+1)]['type'] == $chardata[$i]['type'])) {
// medial
if (isset($unicode_arlet[$chardata[$i]['char']][3])) {
$chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][3];
}
} elseif ((($i+1) < $numchars) AND
($unicode[$chardata[($i+1)]['char']] == 'AL') AND
($chardata[($i+1)]['type'] == $chardata[$i]['type'])) {
// initial
if (isset($unicode_arlet[$chardata[$i]['char']][2])) {
$chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][2];
}
} elseif (($i > 0) AND
($unicode[$chardata[($i-1)]['char']] == 'AL') AND
($chardata[($i-1)]['type'] == $chardata[$i]['type'])) {
// final
if (isset($unicode_arlet[$chardata[$i]['char']][1])) {
$chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][1];
}
} elseif (isset($unicode_arlet[$chardata[$i]['char']][0])) {
// isolated
$chardata[$i]['char'] = $unicode_arlet[$chardata[$i]['char']][0];
}
}
}
}
// L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher.
for ($j=$maxlevel; $j > 0; $j--) {
$ordarray = Array();
$revarr = Array();
$onlevel = false;
for ($i=0; $i < $numchars; $i++) {
if ($chardata[$i]['level'] >= $j) {
$onlevel = true;
if (isset($unicode_mirror[$chardata[$i]['char']])) {
// L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true.
$chardata[$i]['char'] = $unicode_mirror[$chardata[$i]['char']];
}
$revarr[] = $chardata[$i];
} else {
if($onlevel) {
$revarr = array_reverse($revarr);
$ordarray = array_merge($ordarray, $revarr);
$revarr = Array();
$onlevel = false;
}
$ordarray[] = $chardata[$i];
}
}
if($onlevel) {
$revarr = array_reverse($revarr);
$ordarray = array_merge($ordarray, $revarr);
}
$chardata = $ordarray;
}
$ordarray = array();
for ($i=0; $i < $numchars; $i++) {
$ordarray[] = $chardata[$i]['char'];
}
return $ordarray;
}
// END OF BIDIRECTIONAL TEXT SECTION -------------------
/*
* Adds a bookmark.
* @param string $txt bookmark description.
* @param int $level bookmark level.
* @param float $y Ordinate of the boorkmark position (default = -1 = current position).
* @access public
* @author Olivier Plathey, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function Bookmark($txt, $level=0, $y=-1) {
if($y == -1) {
$y = $this->GetY();
}
$this->outlines[]=array('t'=>$txt,'l'=>$level,'y'=>$y,'p'=>$this->PageNo());
}
/*
* Create a bookmark PDF string.
* @access private
* @author Olivier Plathey, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function _putbookmarks() {
$nb = count($this->outlines);
if($nb == 0) {
return;
}
$lru = array();
$level = 0;
foreach($this->outlines as $i=>$o) {
if($o['l'] > 0) {
$parent = $lru[$o['l'] - 1];
//Set parent and last pointers
$this->outlines[$i]['parent'] = $parent;
$this->outlines[$parent]['last'] = $i;
if($o['l'] > $level) {
//Level increasing: set first pointer
$this->outlines[$parent]['first'] = $i;
}
} else {
$this->outlines[$i]['parent']=$nb;
}
if($o['l']<=$level and $i>0) {
//Set prev and next pointers
$prev = $lru[$o['l']];
$this->outlines[$prev]['next'] = $i;
$this->outlines[$i]['prev'] = $prev;
}
$lru[$o['l']] = $i;
$level = $o['l'];
}
//Outline items
$n = $this->n+1;
foreach($this->outlines as $i=>$o) {
$this->_newobj();
$this->_out('<_textstring($o['t']));
$this->_out('/Parent '.($n+$o['parent']).' 0 R');
if(isset($o['prev']))
$this->_out('/Prev '.($n+$o['prev']).' 0 R');
if(isset($o['next']))
$this->_out('/Next '.($n+$o['next']).' 0 R');
if(isset($o['first']))
$this->_out('/First '.($n+$o['first']).' 0 R');
if(isset($o['last']))
$this->_out('/Last '.($n+$o['last']).' 0 R');
$this->_out(sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]',1+2*$o['p'],($this->h-$o['y'])*$this->k));
$this->_out('/Count 0>>');
$this->_out('endobj');
}
//Outline root
$this->_newobj();
$this->OutlineRoot=$this->n;
$this->_out('<_out('/Last '.($n+$lru[0]).' 0 R>>');
$this->_out('endobj');
}
// --- JAVASCRIPT - FORMS ------------------------------
/*
* Adds a javascript
* @access public
* @author Johannes G�ntert, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function IncludeJS($script) {
$this->javascript .= $script;
}
/*
* Create a javascript PDF string.
* @access private
* @author Johannes G�ntert, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function _putjavascript() {
if (empty($this->javascript)) {
return;
}
$this->_newobj();
$this->n_js = $this->n;
$this->_out('<<');
$this->_out('/Names [(EmbeddedJS) '.($this->n+1).' 0 R ]');
$this->_out('>>');
$this->_out('endobj');
$this->_newobj();
$this->_out('<<');
$this->_out('/S /JavaScript');
$this->_out('/JS '.$this->_textstring($this->javascript));
$this->_out('>>');
$this->_out('endobj');
}
/*
* Convert color to javascript color.
* @param string $color color name or #RRGGBB
* @access private
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function _JScolor($color) {
static $aColors = array('transparent','black','white','red','green','blue','cyan','magenta','yellow','dkGray','gray','ltGray');
if(substr($color,0,1) == '#') {
return sprintf("['RGB',%.3f,%.3f,%.3f]", hexdec(substr($color,1,2))/255, hexdec(substr($color,3,2))/255, hexdec(substr($color,5,2))/255);
}
if(!in_array($color,$aColors)) {
$this->Error('Invalid color: '.$color);
}
return 'color.'.$color;
}
/*
* Adds a javascript form field.
* @param string $type field type
* @param string $name field name
* @param int $x horizontal position
* @param int $y vertical position
* @param int $w width
* @param int $h height
* @param array $prop array of properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf):
- rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access private
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function _addfield($type, $name, $x, $y, $w, $h, $prop) {
$k = $this->k;
$this->javascript .= sprintf("f=addField('%s','%s',%d,[%.2f,%.2f,%.2f,%.2f]);",$name,$type,$this->PageNo()-1,$x*$k,($this->h-$y)*$k+1,($x+$w)*$k,($this->h-$y-$h)*$k+1);
$this->javascript .= 'f.textSize='.$this->FontSizePt.';';
while(list($key, $val) = each($prop)) {
if (strcmp(substr($key,-5),"Color") == 0) {
$val = $this->_JScolor($val);
} else {
$val = "'".$val."'";
}
$this->javascript .= "f.".$key."=".$val.";";
}
$this->x+=$w;
}
/*
* Creates a text field
* @param string $name field name
* @param int $w width
* @param int $h height
* @param string $prop properties. The value property allows to set the initial value. The multiline property allows to define the field as multiline. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function TextField($name, $w, $h, $prop=array()) {
$this->_addfield('text',$name,$this->x,$this->y,$w,$h,$prop);
}
/*
* Creates a RadioButton field
* @param string $name field name
* @param int $w width
* @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Nicola Asuni
* @since 2.2.003 (2008-03-03)
*/
function RadioButton($name, $w, $prop=array()) {
if(!isset($prop['strokeColor'])) {
$prop['strokeColor']='black';
}
$this->_addfield('radiobutton',$name,$this->x,$this->y,$w,$w,$prop);
}
/*
* Creates a List-box field
* @param string $name field name
* @param int $w width
* @param int $h height
* @param array $values array containing the list of values.
* @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Nicola Asuni
* @since 2.2.003 (2008-03-03)
*/
function ListBox($name, $w, $h, $values, $prop=array()) {
if(!isset($prop['strokeColor'])) {
$prop['strokeColor']='ltGray';
}
$this->_addfield('listbox',$name,$this->x,$this->y,$w,$h,$prop);
$s = '';
foreach($values as $value) {
$s .= "'".addslashes($value)."',";
}
$this->javascript .= 'f.setItems(['.substr($s,0,-1).']);';
}
/*
* Creates a Combo-box field
* @param string $name field name
* @param int $w width
* @param int $h height
* @param array $values array containing the list of values.
* @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function ComboBox($name, $w, $h, $values, $prop=array()) {
$this->_addfield('combobox',$name,$this->x,$this->y,$w,$h,$prop);
$s = '';
foreach($values as $value) {
$s .= "'".addslashes($value)."',";
}
$this->javascript .= 'f.setItems(['.substr($s,0,-1).']);';
}
/*
* Creates a CheckBox field
* @param string $name field name
* @param int $w width
* @param boolean $checked define the initial state (default = false).
* @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function CheckBox($name, $w, $checked=false, $prop=array()) {
$prop['value'] = ($checked ? 'Yes' : 'Off');
if(!isset($prop['strokeColor'])) {
$prop['strokeColor']='black';
}
$this->_addfield('checkbox',$name,$this->x,$this->y,$w,$w,$prop);
}
/*
* Creates a button field
* @param string $name field name
* @param int $w width
* @param int $h height
* @param string $caption caption.
* @param string $action action triggered by the button (JavaScript code).
* @param string $prop properties. Possible values are (http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf): - rect: Position and size of field on page.
- borderStyle: Rectangle border appearance.
- strokeColor: Color of bounding rectangle.
- lineWidth: Width of the edge of the surrounding rectangle.
- rotation: Rotation of field in 90-degree increments.
- fillColor: Background color of field (gray, transparent, RGB, or CMYK).
- userName: Short description of field that appears on mouse-over.
- readonly: Whether the user may change the field contents.
- doNotScroll: Whether text fields may scroll.
- display: Whether visible or hidden on screen or in print.
- textFont: Text font.
- textColor: Text color.
- textSize: Text size.
- richText: Rich text.
- richValue: Text.
- comb: Text comb format.
- multiline: Text multiline.
- charLimit: Text limit to number of characters.
- fileSelect: Text file selection format.
- password: Text password format.
- alignment: Text layout in text fields.
- buttonAlignX: X alignment of icon on button face.
- buttonAlignY: Y alignment of icon on button face.
- buttonFitBounds: Relative scaling of an icon to fit inside a button face.
- buttonScaleHow: Relative scaling of an icon to fit inside a button face.
- buttonScaleWhen: Relative scaling of an icon to fit inside a button face.
- highlight: Appearance of a button when pushed.
- style: Glyph style for checkbox and radio buttons.
- numItems: Number of items in a combo box or list box.
- editable: Whether the user can type in a combo box.
- multipleSelection: Whether multiple list box items may be selected.
* @access public
* @author Denis Van Nuffelen, Nicola Asuni
* @since 2.1.002 (2008-02-12)
*/
function Button($name, $w, $h, $caption, $action, $prop=array()) {
if(!isset($prop['strokeColor'])) {
$prop['strokeColor']='black';
}
if(!isset($prop['borderStyle'])) {
$prop['borderStyle']='beveled';
}
$this->_addfield('button',$name,$this->x,$this->y,$w,$h,$prop);
$this->javascript .= "f.buttonSetCaption('".addslashes($caption)."');";
$this->javascript .= "f.setAction('MouseUp','".addslashes($action)."');";
$this->javascript .= "f.highlight='push';";
$this->javascript .= 'f.print=false;';
}
// END JAVASCRIPT - FORMS ------------------------------
} // END OF TCPDF CLASS
//Handle special IE contype request
if(isset($_SERVER['HTTP_USER_AGENT']) AND ($_SERVER['HTTP_USER_AGENT']=='contype')) {
header('Content-Type: application/pdf');
exit;
}
}
//============================================================+
// END OF FILE
//============================================================+
?>
%PDF-1.5
3 0 obj
<>
endobj
4 0 obj
<>
stream
xQN0sb v!U m"Z˕`6
Zo֛όQb&'z֪1(qV$/VSyM=j1nJfɳ,bI4p
g-P x +}i)d811
!'so\2/֨S?#hs$sBk(o9hnmpm+F2uNJcz%kr
FҪClR? a]X=ZWSVni!5on^͋o~J
endstream
endobj
1 0 obj
<>
endobj
5 0 obj
<>
stream
x|[E/>s,rlw[e˖{=cwR! !
0, `RM!tt)! KM3ږE,͝{9sΙPB?deMeUudU5'QjZ[:{CtMގߴtd~yS(!EW{eWO/ Q]Bb )eZ8;2.={}yEg{o#r!-B.]#?q^Uy銹?Zvٳ0\W"'-`Y^6o؋OYrYG.L%}Nvܙ}?{:H(^FDz6;;D7*PU**ʂ*>"YՍoIoAv3=cˉCCHuQ}I$KzrAR?Kjz0OQJM&]-ŧDOpG)>!N'R$=A6n3F>W~y}vϋ"HJ{x=E
@-0z
z/"UԀv#%}KcdtJ'Hx/}?zߏ8{q
{V Z@gxljc-Z_h8Z=VVMpH@"ZNpZ\yWŕBC!$$$$BFJI:^E\$6|&"5\ɂLHޫ55ԒRGI=^
44G3ڴs+ mG;F@N.|iԃ}tHy:3 ~H%)"W-fh@'|E5Q(frYFV 'stN*.ՑCA12Kr`X
^,(@ $v J?M4Tt4MKC*(
C.n&fXAS9R 29 $ )'I1R4KC.UPU h4ģD4=@SȦ hAK19D.%*\
*V@.Y@Ud)z860(5ԡw=4j#J4S>jG\ħ.ޫ#+J< K2zNt@
tlE^ޝNV,'6^B.#Y8TP~7"Pqoi*BMUŠh
U.Hq
jjZހK
T@S@؉~n\y(.XbE@q($R+,էi>'Ҡ| CP)=j1RSA)p'g7N'IIĿK_Ǥ_@_wcֱ@Te)TTrP0]^m[ZyVAWKfVX)ւϭ҆W;Q߅LçAv=] oˠUov.o
$\GS}HmI.;j_%9-)TlI4p["h:)fg@sJǁ\K|%o@K?@rIAzBzCz_ wįq'V`X=ϥŧħgWOOģ1K+!ekJbxDH5k¼|}m28㌱AA
^n2'HgTnt%+&!'Gq3$f%%ǥZ҄/Pe=PfecOdqwY$+,˒UU4뜬YCYgz"륬we}y#i(w }T_'jtk.Np/ɗ>gIr̒HJ5fE