diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index d9dcd77..afae2ee 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,14 @@ +4.8.000 (2009-09-07) + - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54). + - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button(). + - Support for Widget annotations was improved. + - Alignment of annotation objects was fixed (examples 36 and 41 were updated). + - addJavascriptObject() method was added. + - Signature of Image() method was changed. + - htmlcolors.php file was updated. + +-------------------------------------------------------------------------------- + 4.7.003 (2009-09-03) - Support for TCPDF methods on HTML was improved (see example n. 49). @@ -1088,4 +1099,5 @@ - removed commercial fonts for licensing issue. - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html). - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist. - + +EOF ---------------------------------------------------------------------------- diff --git a/README.TXT b/README.TXT index 145a3ae..9a2a1fd 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 4.7.003 -Release date: 2009-09-02 +Version: 4.8.000 +Release date: 2009-09-07 Author: Nicola Asuni Copyright (c) 2001-2009: @@ -35,9 +35,9 @@ Main Features: // * supports UTF-8 Unicode and Right-To-Left languages; // * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; // * supports document encryption; -// * includes methods to publish some XHTML code; +// * includes methods to publish some XHTML code, including forms; // * includes graphic (geometric) and transformation methods; -// * includes Javascript and forms support; +// * includes Javascript and Forms support; // * includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS; // * includes methods to set Bookmarks and print a Table of Content; // * includes methods to move and delete pages; diff --git a/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index effa929..0560de6 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -45,7 +45,7 @@

- Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index 31389b8..782f1cc 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -74,7 +74,7 @@ Source Location: /tcpdf.php

Version:

@@ -111,6 +111,7 @@ Source Location: /tcpdf.php

  • $CurrentFont
  • $currpagegroup
  • $customlistindent
  • +
  • $default_form_prop
  • $default_monospaced_font
  • $default_table_columns
  • $diffs
  • @@ -144,6 +145,10 @@ Source Location: /tcpdf.php

  • $footerpos
  • $footer_font
  • $footer_margin
  • +
  • $form_action
  • +
  • $form_enctype
  • +
  • $form_mode
  • +
  • $form_obj_id
  • $fwPt
  • $gradients
  • $h
  • @@ -169,6 +174,9 @@ Source Location: /tcpdf.php

  • $isunicode
  • $javascript
  • $jpeg_quality
  • +
  • $js_objects
  • +
  • $js_obj_id
  • +
  • $js_start_obj_id
  • $k
  • $keywords
  • $l
  • @@ -274,6 +282,7 @@ Source Location: /tcpdf.php

  • AddFont
  • addHtmlLink
  • addHTMLVertSpace
  • +
  • addJavascriptObject
  • AddLink
  • AddPage
  • AddSpotColor
  • @@ -308,6 +317,7 @@ Source Location: /tcpdf.php

  • GetAbsX
  • getAliasNbPages
  • getAliasNumPage
  • +
  • getAnnotOptFromJSProp
  • GetArrStringWidth
  • getBarcode
  • getBorderMode
  • @@ -324,6 +334,7 @@ Source Location: /tcpdf.php

  • getFontStyle
  • getFooterFont
  • getFooterMargin
  • +
  • getFormDefaultProp
  • getGDgamma
  • getGraphicVars
  • getGroupPageNo
  • @@ -432,6 +443,7 @@ Source Location: /tcpdf.php

  • setFooter
  • setFooterFont
  • setFooterMargin
  • +
  • setFormDefaultProp
  • setGraphicVars
  • setHeader
  • setHeaderData
  • @@ -602,7 +614,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  4.7.003 + version:  4.8.000 link:  http://www.tcpdf.org @@ -1371,6 +1383,30 @@ This is a PHP class for generating PDF documents without requiring external exte Type:   HTML + + +

    +
    [ Top ]

    + +

    +

    $default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255),'strokeColor'=>array(128,128,128))

    +

    [line 1368]

    +

    +

    Tags:

    +
    + + + + +
    access:  protected
    +
    + +
    +
    + + + +
    Type:  mixed


    @@ -2271,6 +2307,114 @@ This is a PHP class for generating PDF documents without requiring external exte Type:   Minimum + + +

    +
    [ Top ]

    + +

    +

    $form_action =  ''

    +

    [line 1396]

    + Current form action (used during XHTML rendering)



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $form_enctype =  'application/x-www-form-urlencoded'

    +

    [line 1403]

    + Current form encryption type (used during XHTML rendering)



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $form_mode =  'post'

    +

    [line 1410]

    + Current method to submit forms.



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $form_obj_id = array()

    +

    [line 1361]

    + Array of form annotations IDs



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + +
    Type:  mixed


    @@ -2965,6 +3109,87 @@ This is a PHP class for generating PDF documents without requiring external exte access:  protected + + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $js_objects = array()

    +

    [line 1375]

    + Javascript objects array



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $js_obj_id =  300000

    +

    [line 1389]

    + Current ID of javascript object



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected
    +
    + +
    +
    + + + + + +
    Type:  mixed
    +


    +
    [ Top ]

    + +

    +

    $js_start_obj_id =  300000

    +

    [line 1382]

    + Start ID for javascript objects



    +

    Tags:

    +
    + + + + + + + +
    since:  4.8.000 (2009-09-07)
    access:  protected

    @@ -5452,7 +5677,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    -

    constructor __construct [line 1373]

    +

    constructor __construct [line 1430]

    @@ -5521,7 +5746,7 @@ $diskcache = false])
    -

    destructor __destruct [line 1495]

    +

    destructor __destruct [line 1554]

    @@ -5549,7 +5774,7 @@ $diskcache = false])
    -

    method AcceptPageBreak [line 3430]

    +

    method AcceptPageBreak [line 3505]

    @@ -5580,7 +5805,7 @@ $diskcache = false])
    -

    method addExtGState [line 9926]

    +

    method addExtGState [line 10963]

    @@ -5616,7 +5841,7 @@ $parms)
    -

    method AddFont [line 3004]

    +

    method AddFont [line 3063]

    @@ -5673,7 +5898,7 @@ $fontfile = ''])
    -

    method addHtmlLink [line 7176]

    +

    method addHtmlLink [line 7475]

    @@ -5742,7 +5967,7 @@ $style = -1])
    -

    method addHTMLVertSpace [line 13088]

    +

    method addHTMLVertSpace [line 14369]

    @@ -5806,9 +6031,51 @@ $closing = false])
    [ Top ]
    +
    + +

    method addJavascriptObject [line 9686]

    +
    +
    +
    + void addJavascriptObject( + +$script, [ +$onload = false]) +
    +

    + +

    +

    Tags:

    +
    + + + + +
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + + + + + + +
      $script  
      $onload  
    +

    +
    [ Top ]
    +

    -

    method AddLink [line 3245]

    +

    method AddLink [line 3304]

    @@ -5839,7 +6106,7 @@ $closing = false])
    -

    method AddPage [line 2220]

    +

    method AddPage [line 2279]

    @@ -5887,7 +6154,7 @@ $format = ''])
    -

    method AddSpotColor [line 2637]

    +

    method AddSpotColor [line 2696]

    @@ -5953,7 +6220,7 @@ $k)
    -

    method addTOC [line 14110]

    +

    method addTOC [line 15391]

    @@ -6007,7 +6274,7 @@ $filler = '.'])
    -

    method AliasNbPages [line 9734]

    +

    method AliasNbPages [line 10771]

    @@ -6049,7 +6316,7 @@ $alias = '{nb}'])
    -

    method AliasNumPage [line 9761]

    +

    method AliasNumPage [line 10798]

    @@ -6091,14 +6358,14 @@ $alias = '{pnb}'])
    -

    method Annotation [line 3301]

    +

    method Annotation [line 3360]

    void Annotation( -float -$x, float -$y, float +[float +$x = ''], [float +$y = ''], float $w, float $h, string $text, [array @@ -6166,7 +6433,7 @@ $spaces = 0])
    -

    method Arrow [line 8633]

    +

    method Arrow [line 8936]

    @@ -6244,7 +6511,7 @@ $arm_angle = 15])
    -

    method arrUTF8ToUTF16BE [line 7074]

    +

    method arrUTF8ToUTF16BE [line 7373]

    @@ -6319,7 +6586,7 @@ $setbom = true])
    -

    method Bookmark [line 9277]

    +

    method Bookmark [line 9580]

    + + + + + + + + + + + + + + + + + + + +
    @@ -6373,7 +6640,7 @@ $page = ''])
    -

    method Button [line 9567]

    +

    method Button [line 10493]

    @@ -6384,7 +6651,11 @@ $w, $h, $caption, $action, [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -6432,6 +6703,26 @@ $prop = array()])
       $prop  
      $opt  
      $x  
      $y  
      $js  

    @@ -6439,7 +6730,7 @@ $prop = array()])
    -

    method Cell [line 3491]

    +

    method Cell [line 3566]

    + + + + + + + + + + + + + + + + + + + + + + + + +
    @@ -6535,7 +6826,7 @@ $ignore_min_height = false])
    -

    method CheckBox [line 9547]

    +

    method CheckBox [line 10439]

    @@ -6544,7 +6835,12 @@ $ignore_min_height = false]) $name, $w, [ $checked = false], [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$onvalue = 'Yes'], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -6582,6 +6878,31 @@ $prop = array()])
       $prop  
      $opt  
      $onvalue  
      $x  
      $y  
      $js  

    @@ -6589,7 +6910,7 @@ $prop = array()])
    -

    method checkPageBreak [line 3443]

    +

    method checkPageBreak [line 3518]

    @@ -6643,7 +6964,7 @@ $addpage = true])
    -

    method Circle [line 8296]

    +

    method Circle [line 8599]

    @@ -6742,7 +7063,7 @@ $afinish:)
    -

    method Clip [line 10189]

    +

    method Clip [line 11226]

    @@ -6802,7 +7123,7 @@ $h)
    -

    method Close [line 2114]

    +

    method Close [line 2173]

    @@ -6833,7 +7154,7 @@ $h)
    -

    method closeHTMLTagHandler [line 12757]

    +

    method closeHTMLTagHandler [line 14032]

    + + + + + + + + + + + + + + + + + + + +
    @@ -6887,7 +7208,7 @@ $dom)
    -

    method ComboBox [line 9528]

    +

    method ComboBox [line 10388]

    @@ -6897,7 +7218,11 @@ $name, $w, $h, $values, [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -6940,6 +7265,26 @@ $prop = array()])
       $prop  
      $opt  
      $x  
      $y  
      $js  

    @@ -6947,7 +7292,7 @@ $prop = array()])
    -

    method commitTransaction [line 14267]

    +

    method commitTransaction [line 15548]

    @@ -6975,7 +7320,7 @@ $prop = array()])
    -

    method convertHTMLColorToDec [line 7209]

    +

    method convertHTMLColorToDec [line 7508]

    @@ -7014,7 +7359,7 @@ $color = '#FFFFFF'])
    -

    method CoonsPatchMesh [line 10109]

    +

    method CoonsPatchMesh [line 11146]

    @@ -7116,7 +7461,7 @@ $coords_max = 1])
    -

    method Curve [line 8071]

    +

    method Curve [line 8374]

    @@ -7218,7 +7563,7 @@ $fill_color = array()])
    -

    method deletePage [line 13970]

    +

    method deletePage [line 15251]

    @@ -7260,7 +7605,7 @@ $page)
    -

    method Ellipse [line 8192]

    +

    method Ellipse [line 8495]

    @@ -7377,7 +7722,7 @@ $afinish:)
    -

    method empty_string [line 14314]

    +

    method empty_string [line 15595]

    @@ -7419,7 +7764,7 @@ $str)
    -

    method endPage [line 2239]

    +

    method endPage [line 2298]

    @@ -7450,7 +7795,7 @@ $str)
    -

    method Error [line 2086]

    +

    method Error [line 2145]

    @@ -7489,7 +7834,7 @@ $msg)
    -

    method Footer [line 2478]

    +

    method Footer [line 2537]

    @@ -7514,7 +7859,7 @@ $msg)
    -

    method formatPageNumber [line 9838]

    +

    method formatPageNumber [line 10875]

    @@ -7553,7 +7898,7 @@ $num)
    -

    method formatTOCPageNumber [line 9850]

    +

    method formatTOCPageNumber [line 10887]

    @@ -7595,7 +7940,7 @@ $num)
    -

    method GetAbsX [line 5011]

    +

    method GetAbsX [line 5086]

    @@ -7626,7 +7971,7 @@ $num)
    -

    method getAliasNbPages [line 9746]

    +

    method getAliasNbPages [line 10783]

    @@ -7657,7 +8002,7 @@ $num)
    -

    method getAliasNumPage [line 9774]

    +

    method getAliasNumPage [line 10811]

    @@ -7686,9 +8031,45 @@ $num)
    [ Top ]
    +
    + +

    method getAnnotOptFromJSProp [line 9817]

    +
    +
    +
    + void getAnnotOptFromJSProp( + +$prop) +
    +

    + +

    +

    Tags:

    +
    + + + + +
    access:  protected
    +
    +

    + + +

    Parameters:

    +
    + + + + + + +
      $prop  
    +

    +
    [ Top ]
    +

    -

    method GetArrStringWidth [line 2916]

    +

    method GetArrStringWidth [line 2975]

    @@ -7751,7 +8132,7 @@ $fontsize = 0])
    -

    method getBarcode [line 10654]

    +

    method getBarcode [line 11691]

    @@ -7779,7 +8160,7 @@ $fontsize = 0])
    -

    method getBorderMode [line 3937]

    +

    method getBorderMode [line 4012]

    @@ -7827,7 +8208,7 @@ $position = 'start'])
    -

    method getBreakMargin [line 1817]

    +

    method getBreakMargin [line 1876]

    @@ -7875,7 +8256,7 @@ $pagenum = ''])
    -

    method getBuffer [line 13656]

    +

    method getBuffer [line 14937]

    @@ -7906,7 +8287,7 @@ $pagenum = ''])
    -

    method getCellCode [line 3543]

    +

    method getCellCode [line 3618]

    @@ -8002,7 +8383,7 @@ $ignore_min_height = false])
    -

    method getCellHeightRatio [line 10012]

    +

    method getCellHeightRatio [line 11049]

    @@ -8027,7 +8408,7 @@ $ignore_min_height = false])
    -

    method GetCharWidth [line 2943]

    +

    method GetCharWidth [line 3002]

    @@ -8072,7 +8453,7 @@ $char)
    -

    method getFontBuffer [line 13816]

    +

    method getFontBuffer [line 15097]

    @@ -8114,7 +8495,7 @@ $font)
    -

    method getFontFamily [line 11128]

    +

    method getFontFamily [line 12165]

    @@ -8145,7 +8526,7 @@ $font)
    -

    method getFontSize [line 11108]

    +

    method getFontSize [line 12145]

    @@ -8176,7 +8557,7 @@ $font)
    -

    method getFontSizePt [line 11118]

    +

    method getFontSizePt [line 12155]

    @@ -8207,7 +8588,7 @@ $font)
    -

    method getFontsList [line 2982]

    +

    method getFontsList [line 3041]

    @@ -8235,7 +8616,7 @@ $font)
    -

    method getFontStyle [line 11138]

    +

    method getFontStyle [line 12175]

    @@ -8266,7 +8647,7 @@ $font)
    -

    method getFooterFont [line 7135]

    +

    method getFooterFont [line 7434]

    @@ -8294,7 +8675,7 @@ $font)
    -

    method getFooterMargin [line 2392]

    +

    method getFooterMargin [line 2451]

    @@ -8318,11 +8699,36 @@ $font)

    +
    [ Top ]
    + +
    + +

    method getFormDefaultProp [line 10192]

    +
    +
    +
    + void getFormDefaultProp( +) +
    +

    + +

    +

    Tags:

    +
    + + + + +
    access:  public
    +
    +

    + +
    [ Top ]

    -

    method getGDgamma [line 4954]

    +

    method getGDgamma [line 5029]

    @@ -8361,7 +8767,7 @@ $v)
    -

    method getGraphicVars [line 13524]

    +

    method getGraphicVars [line 14805]

    @@ -8392,7 +8798,7 @@ $v)
    -

    method getGroupPageNo [line 9787]

    +

    method getGroupPageNo [line 10824]

    @@ -8417,7 +8823,7 @@ $v)
    -

    method getGroupPageNoFormatted [line 9797]

    +

    method getGroupPageNoFormatted [line 10834]

    @@ -8448,7 +8854,7 @@ $v)
    -

    method getHeaderData [line 2347]

    +

    method getHeaderData [line 2406]

    @@ -8476,7 +8882,7 @@ $v)
    -

    method getHeaderFont [line 7115]

    +

    method getHeaderFont [line 7414]

    @@ -8504,7 +8910,7 @@ $v)
    -

    method getHeaderMargin [line 2372]

    +

    method getHeaderMargin [line 2431]

    @@ -8532,7 +8938,7 @@ $v)
    -

    method getHtmlDomArray [line 11174]

    +

    method getHtmlDomArray [line 12211]

    @@ -8571,7 +8977,7 @@ $html)
    -

    method getHTMLUnitToUnits [line 13243]

    +

    method getHTMLUnitToUnits [line 14524]

    @@ -8637,7 +9043,7 @@ $point)
    -

    method getImageBuffer [line 13758]

    +

    method getImageBuffer [line 15039]

    @@ -8647,7 +9053,7 @@ $image)

    - Get page buffer content.



    + Get image buffer content.



    Tags:

    @@ -8679,7 +9085,7 @@ $image)
    -

    method getImageRBX [line 2418]

    +

    method getImageRBX [line 2477]

    @@ -8704,7 +9110,7 @@ $image)
    -

    method getImageRBY [line 2427]

    +

    method getImageRBY [line 2486]

    @@ -8729,7 +9135,7 @@ $image)
    -

    method getImageScale [line 1756]

    +

    method getImageScale [line 1815]

    @@ -8763,7 +9169,7 @@ $image)
    -

    method getLastH [line 1734]

    +

    method getLastH [line 1793]

    @@ -8794,7 +9200,7 @@ $image)
    -

    method GetLineWidth [line 7785]

    +

    method GetLineWidth [line 8088]

    @@ -8828,7 +9234,7 @@ $image)
    -

    method getMargins [line 11071]

    +

    method getMargins [line 12108]

    @@ -8859,7 +9265,7 @@ $image)
    -

    method GetNumChars [line 2970]

    +

    method GetNumChars [line 3029]

    @@ -8901,7 +9307,7 @@ $s)
    -

    method getNumLines [line 4016]

    +

    method getNumLines [line 4091]

    @@ -8949,7 +9355,7 @@ $w = 0])
    -

    method getNumPages [line 2207]

    +

    method getNumPages [line 2266]

    @@ -8983,7 +9389,7 @@ $w = 0])
    -

    method getObjFilename [line 13588]

    +

    method getObjFilename [line 14869]

    @@ -9028,7 +9434,7 @@ $prefix)
    -

    method getOriginalMargins [line 11094]

    +

    method getOriginalMargins [line 12131]

    @@ -9059,7 +9465,7 @@ $prefix)
    -

    method getPage [line 2195]

    +

    method getPage [line 2254]

    @@ -9093,7 +9499,7 @@ $prefix)
    -

    method getPageBuffer [line 13699]

    +

    method getPageBuffer [line 14980]

    @@ -9135,7 +9541,7 @@ $page)
    -

    method getPageDimensions [line 1769]

    +

    method getPageDimensions [line 1828]

    @@ -9180,7 +9586,7 @@ $pagenum = ''])
    -

    method getPageGroupAlias [line 9809]

    +

    method getPageGroupAlias [line 10846]

    @@ -9205,7 +9611,7 @@ $pagenum = ''])
    -

    method getPageHeight [line 1801]

    +

    method getPageHeight [line 1860]

    @@ -9253,7 +9659,7 @@ $pagenum = ''])
    -

    method getPageNumGroupAlias [line 9824]

    +

    method getPageNumGroupAlias [line 10861]

    @@ -9278,7 +9684,7 @@ $pagenum = ''])
    -

    method getPageWidth [line 1785]

    +

    method getPageWidth [line 1844]

    @@ -9326,7 +9732,7 @@ $pagenum = ''])
    -

    method getPDFData [line 7158]

    +

    method getPDFData [line 7457]

    @@ -9351,7 +9757,7 @@ $pagenum = ''])
    -

    method getRemainingWidth [line 4377]

    +

    method getRemainingWidth [line 4452]

    @@ -9379,7 +9785,7 @@ $pagenum = ''])
    -

    method getRTL [line 1697]

    +

    method getRTL [line 1756]

    @@ -9407,7 +9813,7 @@ $pagenum = ''])
    -

    method getScaleFactor [line 1831]

    +

    method getScaleFactor [line 1890]

    @@ -9441,7 +9847,7 @@ $pagenum = ''])
    -

    method GetStringWidth [line 2901]

    +

    method GetStringWidth [line 2960]

    @@ -9504,7 +9910,7 @@ $fontsize = 0])
    -

    method GetX [line 4995]

    +

    method GetX [line 5070]

    @@ -9535,7 +9941,7 @@ $fontsize = 0])
    -

    method GetY [line 5022]

    +

    method GetY [line 5097]

    @@ -9566,7 +9972,7 @@ $fontsize = 0])
    -

    method get_mqr [line 4718]

    +

    method get_mqr [line 4793]

    @@ -9597,7 +10003,7 @@ $fontsize = 0])
    -

    method Gradient [line 10212]

    +

    method Gradient [line 11249]

    @@ -9657,7 +10063,7 @@ $coords)
    -

    method Header [line 2436]

    +

    method Header [line 2495]

    + + + + +
    @@ -9682,7 +10088,7 @@ $coords)
    -

    method Image [line 4499]

    +

    method Image [line 4575]

    @@ -9702,7 +10108,8 @@ $palign = ''], [boolean $ismask = false], [mixed $imgmask = false], [mixed $border = 0], [boolean -$fitbox = false]) +$fitbox = false], [boolean +$hidden = false])

    @@ -9801,6 +10208,11 @@ $fitbox = false])
    boolean   $fitbox   If true scale image dimensions proportionally to fit within the ($w, $h) box.
    boolean  $hidden  if true do not display the image.

    @@ -9808,7 +10220,7 @@ $fitbox = false])
    -

    method ImageEps [line 10384]

    +

    method ImageEps [line 11421]

    @@ -9904,7 +10316,7 @@ $border = 0])
    -

    method ImagePngAlpha [line 4910]

    +

    method ImagePngAlpha [line 4985]

    @@ -10009,7 +10421,7 @@ $palign = ''])
    -

    method IncludeJS [line 9369]

    +

    method IncludeJS [line 9673]

    @@ -10045,7 +10457,7 @@ $script)
    -

    method intToRoman [line 13317]

    +

    method intToRoman [line 14598]

    @@ -10087,7 +10499,7 @@ $number)
    -

    method lastPage [line 2184]

    +

    method lastPage [line 2243]

    @@ -10129,7 +10541,7 @@ $resetmargins = false])
    -

    method Line [line 7938]

    +

    method Line [line 8241]

    @@ -10195,7 +10607,7 @@ $style = array()])
    -

    method LinearGradient [line 10069]

    +

    method LinearGradient [line 11106]

    @@ -10273,7 +10685,7 @@ $coords = array(0,0,1,0)])
    -

    method Link [line 3284]

    +

    method Link [line 3343]

    + + + + + + + + + + + + + + + + + + + +
    @@ -10345,7 +10757,7 @@ $spaces = 0])
    -

    method ListBox [line 9505]

    +

    method ListBox [line 10338]

    @@ -10355,7 +10767,11 @@ $name, $w, $h, $values, [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -10398,6 +10814,26 @@ $prop = array()])
       $prop  
      $opt  
      $x  
      $y  
      $js  

    @@ -10405,7 +10841,7 @@ $prop = array()])
    -

    method Ln [line 4967]

    +

    method Ln [line 5042]

    @@ -10453,7 +10889,7 @@ $cell = false])
    -

    method MirrorH [line 7557]

    +

    method MirrorH [line 7860]

    @@ -10495,7 +10931,7 @@ $x = ''])
    -

    method MirrorL [line 7593]

    +

    method MirrorL [line 7896]

    @@ -10549,7 +10985,7 @@ $y = ''])
    -

    method MirrorP [line 7580]

    +

    method MirrorP [line 7883]

    @@ -10597,7 +11033,7 @@ $y = ''])
    -

    method MirrorV [line 7568]

    +

    method MirrorV [line 7871]

    @@ -10639,7 +11075,7 @@ $y = ''])
    -

    method movePage [line 13833]

    +

    method movePage [line 15114]

    @@ -10687,7 +11123,7 @@ $topage)
    -

    method MultiCell [line 3778]

    +

    method MultiCell [line 3853]

    @@ -10813,7 +11249,7 @@ $maxh = 0])
    -

    method objclone [line 14303]

    +

    method objclone [line 15584]

    @@ -10855,7 +11291,7 @@ $object)
    -

    method Open [line 2101]

    +

    method Open [line 2160]

    @@ -10886,7 +11322,7 @@ $object)
    -

    method openHTMLTagHandler [line 12427]

    +

    method openHTMLTagHandler [line 13495]

    @@ -10940,7 +11376,7 @@ $dom)
    -

    method Output [line 5114]

    +

    method Output [line 5189]

    @@ -10988,7 +11424,7 @@ $dest = 'I'])
    -

    method PageNo [line 2621]

    +

    method PageNo [line 2680]

    @@ -11022,7 +11458,7 @@ $dest = 'I'])
    -

    method PageNoFormatted [line 9860]

    +

    method PageNoFormatted [line 10897]

    @@ -11053,7 +11489,7 @@ $dest = 'I'])
    -

    method PieSector [line 10306]

    +

    method PieSector [line 11343]

    @@ -11155,7 +11591,7 @@ $o:)
    -

    method pixelsToUnits [line 7262]

    +

    method pixelsToUnits [line 7565]

    @@ -11197,7 +11633,7 @@ $px)
    -

    method Polycurve [line 8128]

    +

    method Polycurve [line 8431]

    @@ -11269,7 +11705,7 @@ $fill_color = array()])
    -

    method Polygon [line 8321]

    +

    method Polygon [line 8624]

    @@ -11326,7 +11762,7 @@ $fill_color = array()])
    -

    method putHtmlListBullet [line 13382]

    +

    method putHtmlListBullet [line 14663]

    @@ -11377,7 +11813,7 @@ $size = 10])
    -

    method RadialGradient [line 10087]

    +

    method RadialGradient [line 11124]

    + + + + + + + + + + + + + + + + + + + + + + + + +
    @@ -11455,7 +11891,7 @@ $coords = array(0.5,0.5,0.5,0.5,1)])
    -

    method RadioButton [line 9487]

    +

    method RadioButton [line 10290]

    @@ -11463,7 +11899,12 @@ $coords = array(0.5,0.5,0.5,0.5,1)]) $name, $w, [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$onvalue = ''], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -11496,6 +11937,31 @@ $prop = array()])
       $prop  
      $opt  
      $onvalue  
      $x  
      $y  
      $js  

    @@ -11503,7 +11969,7 @@ $prop = array()])
    -

    method readDiskCache [line 13628]

    +

    method readDiskCache [line 14909]

    @@ -11551,7 +12017,7 @@ $file)
    -

    method Rect [line 7973]

    +

    method Rect [line 8276]

    @@ -11629,7 +12095,7 @@ $fill_color = array()])
    -

    method RegularPolygon [line 8444]

    +

    method RegularPolygon [line 8747]

    @@ -11740,7 +12206,7 @@ $r:)
    -

    method removeSHY [line 3508]

    +

    method removeSHY [line 3583]

    @@ -11782,7 +12248,7 @@ $txt = ''])
    -

    method rfread [line 4880]

    +

    method rfread [line 4955]

    @@ -11833,7 +12299,7 @@ $length)
    -

    method rollbackTransaction [line 14280]

    +

    method rollbackTransaction [line 15561]

    @@ -11864,7 +12330,7 @@ $length)
    -

    method Rotate [line 7652]

    +

    method Rotate [line 7955]

    @@ -11918,7 +12384,7 @@ $y = ''])
    -

    method RoundedRect [line 8548]

    +

    method RoundedRect [line 8851]

    @@ -12005,7 +12471,7 @@ $fill_color = array()])
    -

    method Scale [line 7522]

    +

    method Scale [line 7825]

    @@ -12065,7 +12531,7 @@ $y = ''])
    -

    method ScaleX [line 7482]

    +

    method ScaleX [line 7785]

    @@ -12119,7 +12585,7 @@ $y = ''])
    -

    method ScaleXY [line 7508]

    +

    method ScaleXY [line 7811]

    @@ -12173,7 +12639,7 @@ $y = ''])
    -

    method ScaleY [line 7495]

    +

    method ScaleY [line 7798]

    @@ -12227,7 +12693,7 @@ $y = ''])
    -

    method setAlpha [line 9969]

    +

    method setAlpha [line 11006]

    @@ -12269,7 +12735,7 @@ $bm = 'Normal'])
    -

    method SetAuthor [line 2050]

    +

    method SetAuthor [line 2109]

    @@ -12311,7 +12777,7 @@ $author)
    -

    method SetAutoPageBreak [line 1917]

    +

    method SetAutoPageBreak [line 1976]

    @@ -12359,7 +12825,7 @@ $margin = 0])
    -

    method setBarcode [line 10644]

    +

    method setBarcode [line 11681]

    @@ -12395,7 +12861,7 @@ $bc = ''])
    -

    method SetBooklet [line 13157]

    +

    method SetBooklet [line 14438]

    @@ -12446,7 +12912,7 @@ $outer = -1])
    -

    method setBuffer [line 13638]

    +

    method setBuffer [line 14919]

    @@ -12485,7 +12951,7 @@ $data)
    -

    method setCellHeightRatio [line 10003]

    +

    method setCellHeightRatio [line 11040]

    @@ -12521,7 +12987,7 @@ $h)
    -

    method SetCellPadding [line 1905]

    +

    method SetCellPadding [line 1964]

    @@ -12563,7 +13029,7 @@ $pad)
    -

    method SetCompression [line 2010]

    +

    method SetCompression [line 2069]

    @@ -12602,7 +13068,7 @@ $compress)
    -

    method setContentMark [line 2314]

    +

    method setContentMark [line 2373]

    @@ -12641,7 +13107,7 @@ $page = 0])
    -

    method SetCreator [line 2074]

    +

    method SetCreator [line 2133]

    @@ -12683,7 +13149,7 @@ $creator)
    -

    method SetDefaultMonospacedFont [line 3234]

    +

    method SetDefaultMonospacedFont [line 3293]

    @@ -12722,7 +13188,7 @@ $font)
    -

    method setDefaultTableColumns [line 9993]

    +

    method setDefaultTableColumns [line 11030]

    @@ -12758,7 +13224,7 @@ $cols = 4])
    -

    method SetDisplayMode [line 1932]

    +

    method SetDisplayMode [line 1991]

    @@ -12809,7 +13275,7 @@ $mode = 'UseNone'])
    -

    method SetDrawColor [line 2676]

    +

    method SetDrawColor [line 2735]

    @@ -12869,7 +13335,7 @@ $col4 = -1])
    -

    method SetDrawColorArray [line 2653]

    +

    method SetDrawColorArray [line 2712]

    @@ -12911,7 +13377,7 @@ $color)
    -

    method SetDrawSpotColor [line 2714]

    +

    method SetDrawSpotColor [line 2773]

    @@ -12959,7 +13425,7 @@ $tint = 100])
    -

    method setExtGState [line 9938]

    +

    method setExtGState [line 10975]

    @@ -12995,7 +13461,7 @@ $gs)
    -

    method SetFillColor [line 2756]

    +

    method SetFillColor [line 2815]

    @@ -13055,7 +13521,7 @@ $col4 = -1])
    -

    method SetFillColorArray [line 2733]

    +

    method SetFillColorArray [line 2792]

    @@ -13097,7 +13563,7 @@ $color)
    -

    method SetFillSpotColor [line 2798]

    +

    method SetFillSpotColor [line 2857]

    @@ -13145,7 +13611,7 @@ $tint = 100])
    -

    method SetFont [line 3189]

    +

    method SetFont [line 3248]

    @@ -13205,7 +13671,7 @@ $fontfile = ''])
    -

    method setFontBuffer [line 13774]

    +

    method setFontBuffer [line 15055]

    @@ -13250,7 +13716,7 @@ $data)
    -

    method SetFontSize [line 3209]

    +

    method SetFontSize [line 3268]

    @@ -13292,7 +13758,7 @@ $size)
    -

    method setFontSubBuffer [line 13796]

    +

    method setFontSubBuffer [line 15077]

    @@ -13343,7 +13809,7 @@ $data)
    -

    method setFooter [line 2544]

    +

    method setFooter [line 2603]

    @@ -13371,7 +13837,7 @@ $data)
    -

    method setFooterFont [line 7125]

    +

    method setFooterFont [line 7424]

    @@ -13410,7 +13876,7 @@ $font)
    -

    method setFooterMargin [line 2382]

    +

    method setFooterMargin [line 2441]

    @@ -13444,9 +13910,45 @@ $fm = 10])
    [ Top ]
    +
    + +

    method setFormDefaultProp [line 10181]

    +
    +
    +
    + void setFormDefaultProp( +[ +$prop = array()]) +
    +

    + +

    +

    Tags:

    +
    + + + + +
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + +
      $prop  
    +

    +
    [ Top ]
    +

    -

    method setGraphicVars [line 13555]

    +

    method setGraphicVars [line 14836]

    @@ -13485,7 +13987,7 @@ $gvars)
    -

    method setHeader [line 2513]

    +

    method setHeader [line 2572]

    @@ -13513,7 +14015,7 @@ $gvars)
    -

    method setHeaderData [line 2333]

    +

    method setHeaderData [line 2392]

    @@ -13567,7 +14069,7 @@ $hs = ''])
    -

    method setHeaderFont [line 7105]

    +

    method setHeaderFont [line 7404]

    @@ -13606,7 +14108,7 @@ $font)
    -

    method setHeaderMargin [line 2362]

    +

    method setHeaderMargin [line 2421]

    @@ -13642,7 +14144,7 @@ $hm = 10])
    -

    method setHtmlLinksStyle [line 13228]

    +

    method setHtmlLinksStyle [line 14509]

    @@ -13687,7 +14189,7 @@ $fontstyle = 'U'])
    -

    method setHtmlVSpace [line 13197]

    +

    method setHtmlVSpace [line 14478]

    @@ -13726,7 +14228,7 @@ $tagvs)
    -

    method setImageBuffer [line 13715]

    +

    method setImageBuffer [line 14996]

    @@ -13771,7 +14273,7 @@ $data)
    -

    method setImageScale [line 1745]

    +

    method setImageScale [line 1804]

    @@ -13813,7 +14315,7 @@ $scale)
    -

    method setImageSubBuffer [line 13738]

    +

    method setImageSubBuffer [line 15019]

    @@ -13864,7 +14366,7 @@ $data)
    -

    method setJPEGQuality [line 9980]

    +

    method setJPEGQuality [line 11017]

    @@ -13900,7 +14402,7 @@ $quality)
    -

    method SetKeywords [line 2062]

    +

    method SetKeywords [line 2121]

    @@ -13942,7 +14444,7 @@ $keywords)
    -

    method setLanguageArray [line 7145]

    +

    method setLanguageArray [line 7444]

    @@ -13981,7 +14483,7 @@ $language)
    -

    method setLastH [line 1724]

    +

    method setLastH [line 1783]

    @@ -14023,7 +14525,7 @@ $h)
    -

    method SetLeftMargin [line 1861]

    +

    method SetLeftMargin [line 1920]

    @@ -14065,7 +14567,7 @@ $margin)
    -

    method SetLineStyle [line 7810]

    +

    method SetLineStyle [line 8113]

    @@ -14111,7 +14613,7 @@ $style)
    -

    method SetLineWidth [line 7769]

    +

    method SetLineWidth [line 8072]

    @@ -14153,7 +14655,7 @@ $width)
    -

    method SetLink [line 3261]

    +

    method SetLink [line 3320]

    @@ -14207,7 +14709,7 @@ $page = -1])
    -

    method setListIndentWidth [line 13207]

    +

    method setListIndentWidth [line 14488]

    @@ -14246,7 +14748,7 @@ $width)
    -

    method setLIsymbol [line 13117]

    +

    method setLIsymbol [line 14398]

    @@ -14285,7 +14787,7 @@ $symbol = '!'])
    -

    method SetMargins [line 1844]

    +

    method SetMargins [line 1903]

    @@ -14339,7 +14841,7 @@ $right = -1])
    -

    method setOpenCell [line 13217]

    +

    method setOpenCell [line 14498]

    @@ -14378,7 +14880,7 @@ $isopen)
    -

    method setPage [line 2137]

    +

    method setPage [line 2196]

    @@ -14426,7 +14928,7 @@ $resetmargins = false])
    -

    method setPageBuffer [line 13672]

    +

    method setPageBuffer [line 14953]

    @@ -14477,7 +14979,7 @@ $append = false])
    -

    method setPageFormat [line 1552]

    +

    method setPageFormat [line 1611]

    @@ -14522,7 +15024,7 @@ $orientation = 'P'])
    -

    method setPageMark [line 2303]

    +

    method setPageMark [line 2362]

    @@ -14550,7 +15052,7 @@ $orientation = 'P'])
    -

    method setPageOrientation [line 1625]

    +

    method setPageOrientation [line 1684]

    @@ -14601,7 +15103,7 @@ $bottommargin = ''])
    -

    method setPageUnit [line 1510]

    +

    method setPageUnit [line 1569]

    @@ -14640,7 +15142,7 @@ $unit)
    -

    method setPDFVersion [line 10022]

    +

    method setPDFVersion [line 11059]

    @@ -14676,7 +15178,7 @@ $version = '1.7'])
    -

    method setPrintFooter [line 2409]

    +

    method setPrintFooter [line 2468]

    @@ -14718,7 +15220,7 @@ $value)
    -

    method setPrintHeader [line 2400]

    +

    method setPrintHeader [line 2459]

    @@ -14754,7 +15256,7 @@ $val = true])
    -

    method SetProtection [line 7425]

    +

    method SetProtection [line 7728]

    @@ -14808,7 +15310,7 @@ $owner_pass = null])
    -

    method SetRightMargin [line 1891]

    +

    method SetRightMargin [line 1950]

    @@ -14850,7 +15352,7 @@ $margin)
    -

    method setRTL [line 1681]

    +

    method setRTL [line 1740]

    @@ -14895,7 +15397,7 @@ $resetx = true])
    -

    method setSignature [line 9691]

    +

    method setSignature [line 10728]

    @@ -14961,7 +15463,7 @@ $info = array()])
    -

    method setSpacesRE [line 1666]

    +

    method setSpacesRE [line 1725]

    @@ -15000,7 +15502,7 @@ $re = '/[\s]/'])
    -

    method SetSubject [line 2038]

    +

    method SetSubject [line 2097]

    @@ -15042,7 +15544,7 @@ $subject)
    -

    method setTableHeader [line 2586]

    +

    method setTableHeader [line 2645]

    @@ -15070,7 +15572,7 @@ $subject)
    -

    method setTempRTL [line 1707]

    +

    method setTempRTL [line 1766]

    @@ -15109,7 +15611,7 @@ $mode)
    -

    method SetTextColor [line 2840]

    +

    method SetTextColor [line 2899]

    @@ -15169,7 +15671,7 @@ $col4 = -1])
    -

    method SetTextColorArray [line 2817]

    +

    method SetTextColorArray [line 2876]

    @@ -15211,7 +15713,7 @@ $color)
    -

    method SetTextSpotColor [line 2879]

    +

    method SetTextSpotColor [line 2938]

    @@ -15259,7 +15761,7 @@ $tint = 100])
    -

    method SetTitle [line 2026]

    +

    method SetTitle [line 2085]

    @@ -15301,7 +15803,7 @@ $title)
    -

    method SetTopMargin [line 1876]

    +

    method SetTopMargin [line 1935]

    @@ -15343,7 +15845,7 @@ $margin)
    -

    method setUserRights [line 9661]

    +

    method setUserRights [line 10698]

    @@ -15403,7 +15905,7 @@ $signature = '/Modify'])
    -

    method setViewerPreferences [line 10052]

    +

    method setViewerPreferences [line 11089]

    @@ -15439,7 +15941,7 @@ $preferences)
    -

    method setVisibility [line 9890]

    +

    method setVisibility [line 10927]

    @@ -15475,7 +15977,7 @@ $v)
    -

    method SetX [line 5035]

    +

    method SetX [line 5110]

    @@ -15517,7 +16019,7 @@ $x)
    -

    method SetXY [line 5098]

    +

    method SetXY [line 5173]

    @@ -15565,7 +16067,7 @@ $y)
    -

    method SetY [line 5067]

    +

    method SetY [line 5142]

    @@ -15613,7 +16115,7 @@ $resetx = true])
    -

    method set_mqr [line 4707]

    +

    method set_mqr [line 4782]

    @@ -15652,7 +16154,7 @@ $mqr)
    -

    method Skew [line 7712]

    +

    method Skew [line 8015]

    @@ -15712,7 +16214,7 @@ $y = ''])
    -

    method SkewX [line 7685]

    +

    method SkewX [line 7988]

    @@ -15766,7 +16268,7 @@ $y = ''])
    -

    method SkewY [line 7698]

    +

    method SkewY [line 8001]

    @@ -15820,7 +16322,7 @@ $y = ''])
    -

    method StarPolygon [line 8499]

    +

    method StarPolygon [line 8802]

    @@ -15944,7 +16446,7 @@ $draw_circle:)
    -

    method startPage [line 2263]

    +

    method startPage [line 2322]

    @@ -15992,7 +16494,7 @@ $format = ''])
    -

    method startPageGroup [line 9719]

    +

    method startPageGroup [line 10756]

    @@ -16028,7 +16530,7 @@ $page = ''])
    -

    method startTransaction [line 14253]

    +

    method startTransaction [line 15534]

    @@ -16056,7 +16558,7 @@ $page = ''])
    -

    method StartTransform [line 7453]

    +

    method StartTransform [line 7756]

    @@ -16087,7 +16589,7 @@ $page = ''])
    -

    method StopTransform [line 7466]

    +

    method StopTransform [line 7769]

    @@ -16118,7 +16620,7 @@ $page = ''])
    -

    method swapMargins [line 13173]

    +

    method swapMargins [line 14454]

    @@ -16157,7 +16659,7 @@ $reverse = true])
    -

    method Text [line 3390]

    +

    method Text [line 3465]

    + + + + + + + + + + + + + + + + + + + +
    @@ -16226,7 +16728,7 @@ $clip = false])
    -

    method TextField [line 9474]

    +

    method TextField [line 10210]

    @@ -16235,7 +16737,11 @@ $clip = false]) $name, $w, $h, [ -$prop = array()]) +$prop = array()], [ +$opt = array()], [ +$x = ''], [ +$y = ''], [ +$js = false])

    @@ -16273,6 +16779,26 @@ $prop = array()])
       $prop  
      $opt  
      $x  
      $y  
      $js  

    @@ -16280,7 +16806,7 @@ $prop = array()])
    -

    method Transform [line 7745]

    +

    method Transform [line 8048]

    @@ -16322,7 +16848,7 @@ $tm)
    -

    method Translate [line 7628]

    +

    method Translate [line 7931]

    @@ -16370,7 +16896,7 @@ $t_y)
    -

    method TranslateX [line 7605]

    +

    method TranslateX [line 7908]

    @@ -16412,7 +16938,7 @@ $t_x)
    -

    method TranslateY [line 7616]

    +

    method TranslateY [line 7919]

    @@ -16454,7 +16980,7 @@ $t_y)
    -

    method unhtmlentities [line 7273]

    +

    method unhtmlentities [line 7576]

    @@ -16493,7 +17019,7 @@ $text_to_convert)
    -

    method UniArrSubString [line 4416]

    +

    method UniArrSubString [line 4491]

    @@ -16547,7 +17073,7 @@ $end = ''])
    -

    method unichr [line 4449]

    +

    method unichr [line 4524]

    @@ -16592,7 +17118,7 @@ $c)
    -

    method UTF8ArrayToUniArray [line 4437]

    +

    method UTF8ArrayToUniArray [line 4512]

    @@ -16634,7 +17160,7 @@ $ta)
    -

    method UTF8ArrSubString [line 4393]

    +

    method UTF8ArrSubString [line 4468]

    @@ -16685,7 +17211,7 @@ $end = ''])
    -

    method utf8Bidi [line 8706]

    +

    method utf8Bidi [line 9009]

    @@ -16739,7 +17265,7 @@ $forcertl = false])
    -

    method UTF8StringToArray [line 6907]

    +

    method UTF8StringToArray [line 7206]

    @@ -16805,7 +17331,7 @@ $str)
    -

    method utf8StrRev [line 8692]

    +

    method utf8StrRev [line 8995]

    @@ -16859,7 +17385,7 @@ $forcertl = false])
    -

    method UTF8ToLatin1 [line 7014]

    +

    method UTF8ToLatin1 [line 7313]

    @@ -16901,7 +17427,7 @@ $str)
    -

    method UTF8ToUTF16BE [line 6998]

    +

    method UTF8ToUTF16BE [line 7297]

    @@ -16952,7 +17478,7 @@ $setbom = true])
    -

    method Write [line 4059]

    +

    method Write [line 4134]

    @@ -17048,7 +17574,7 @@ $maxh = 0])
    -

    method write1DBarcode [line 10673]

    +

    method write1DBarcode [line 11710]

    @@ -17138,7 +17664,7 @@ $align = ''])
    -

    method write2DBarcode [line 10924]

    +

    method write2DBarcode [line 11961]

    @@ -17222,7 +17748,7 @@ $align = ''])
    -

    method writeBarcode [line 10874]

    +

    method writeBarcode [line 11911]

    @@ -17312,7 +17838,7 @@ $code)
    -

    method writeDiskCache [line 13600]

    +

    method writeDiskCache [line 14881]

    @@ -17369,7 +17895,7 @@ $file)
    -

    method writeHTML [line 11574]

    +

    method writeHTML [line 12642]

    @@ -17435,7 +17961,7 @@ $align = ''])
    -

    method writeHTMLCell [line 11162]

    +

    method writeHTMLCell [line 12199]

    @@ -17537,7 +18063,7 @@ $autopadding = true])
    -

    method _addfield [line 9439]

    +

    method _addfield [line 9782]

    @@ -17609,7 +18135,7 @@ $prop)
    -

    method _beginpage [line 6674]

    +

    method _beginpage [line 6973]

    @@ -17651,7 +18177,7 @@ $format = ''])
    -

    method _datastring [line 6786]

    +

    method _datastring [line 7085]

    @@ -17690,7 +18216,7 @@ $s)
    -

    method _datestring [line 6799]

    +

    method _datestring [line 7098]

    @@ -17721,7 +18247,7 @@ $s)
    -

    method _destroy [line 5269]

    +

    method _destroy [line 5344]

    @@ -17766,7 +18292,7 @@ $preserve_objcopy = false])
    -

    method _dochecks [line 5297]

    +

    method _dochecks [line 5372]

    @@ -17791,7 +18317,7 @@ $preserve_objcopy = false])
    -

    method _dolinethrough [line 6751]

    +

    method _dolinethrough [line 7050]

    @@ -17839,7 +18365,7 @@ $txt)
    -

    method _dounderline [line 6737]

    +

    method _dounderline [line 7036]

    @@ -17887,7 +18413,7 @@ $txt)
    -

    method _enddoc [line 6571]

    +

    method _enddoc [line 6863]

    @@ -17912,7 +18438,7 @@ $txt)
    -

    method _endpage [line 6713]

    +

    method _endpage [line 7012]

    @@ -17937,7 +18463,7 @@ $txt)
    -

    method _escape [line 6775]

    +

    method _escape [line 7074]

    @@ -17976,7 +18502,7 @@ $s)
    -

    method _escapetext [line 6824]

    +

    method _escapetext [line 7123]

    @@ -18015,7 +18541,7 @@ $s)
    -

    method _freadint [line 6764]

    +

    method _freadint [line 7063]

    @@ -18054,7 +18580,7 @@ $f)
    -

    method _generateencryptionkey [line 7393]

    +

    method _generateencryptionkey [line 7696]

    @@ -18108,7 +18634,7 @@ $protection)
    -

    method _getfontpath [line 5313]

    +

    method _getfontpath [line 5388]

    @@ -18133,7 +18659,7 @@ $protection)
    -

    method _JScolor [line 9415]

    +

    method _JScolor [line 9758]

    @@ -18169,7 +18695,7 @@ $color)
    -

    method _md5_16 [line 7354]

    +

    method _md5_16 [line 7657]

    @@ -18214,7 +18740,7 @@ $str)
    -

    method _newobj [line 6723]

    +

    method _newobj [line 7022]

    @@ -18242,7 +18768,7 @@ $str)
    -

    method _objectkey [line 7286]

    +

    method _objectkey [line 7589]

    @@ -18281,7 +18807,7 @@ $n)
    -

    method _out [line 6855]

    +

    method _out [line 7154]

    @@ -18317,7 +18843,7 @@ $s)
    -

    method _outarc [line 10286]

    +

    method _outarc [line 11323]

    @@ -18389,7 +18915,7 @@ $y3)
    -

    method _outCurve [line 7918]

    +

    method _outCurve [line 8221]

    @@ -18455,7 +18981,7 @@ $y3)
    -

    method _outLine [line 7882]

    +

    method _outLine [line 8185]

    @@ -18497,7 +19023,7 @@ $y)
    -

    method _outPoint [line 7868]

    +

    method _outPoint [line 8171]

    @@ -18539,7 +19065,7 @@ $y)
    -

    method _outRect [line 7899]

    +

    method _outRect [line 8202]

    @@ -18602,7 +19128,7 @@ $op)
    -

    method _Ovalue [line 7367]

    +

    method _Ovalue [line 7670]

    @@ -18653,7 +19179,7 @@ $owner_pass)
    -

    method _parsejpeg [line 4749]

    +

    method _parsejpeg [line 4824]

    @@ -18692,7 +19218,7 @@ $file)
    -

    method _parsepng [line 4775]

    +

    method _parsepng [line 4850]

    @@ -18731,7 +19257,7 @@ $file)
    -

    method _putannotsobjs [line 5492]

    +

    method _putannotsobjs [line 5567]

    @@ -18740,7 +19266,7 @@ $file)

    - Output annotations objects for all pages.

    !!! THIS FUNCTION IS NOT YET COMPLETED !!! See section 8.4 of PDF reference.




    + Output annotations objects for all pages.

    !!! THIS FUNCTION IS NOT YET COMPLETED !!! See section 12.5 of PDF 32000_2008 reference.




    Tags:

    @@ -18762,7 +19288,7 @@ $file)
    -

    method _putannotsrefs [line 5465]

    +

    method _putannotsrefs [line 5540]

    @@ -18804,7 +19330,7 @@ $n)
    -

    method _putbookmarks [line 9305]

    +

    method _putbookmarks [line 9608]

    @@ -18829,7 +19355,7 @@ $n)
    -

    method _putcatalog [line 6423]

    +

    method _putcatalog [line 6696]

    @@ -18854,7 +19380,7 @@ $n)
    -

    method _putcidfont0 [line 6170]

    +

    method _putcidfont0 [line 6443]

    @@ -18896,7 +19422,7 @@ $font)
    -

    method _putEmbeddedFiles [line 3359]

    +

    method _putEmbeddedFiles [line 3434]

    @@ -18927,7 +19453,7 @@ $font)
    -

    method _putencryption [line 7295]

    +

    method _putencryption [line 7598]

    @@ -18955,7 +19481,7 @@ $font)
    -

    method _putextgstates [line 9948]

    +

    method _putextgstates [line 10985]

    @@ -18980,7 +19506,7 @@ $font)
    -

    method _putfonts [line 5856]

    +

    method _putfonts [line 6129]

    @@ -19005,7 +19531,7 @@ $font)
    -

    method _putfontwidths [line 5985]

    +

    method _putfontwidths [line 6258]

    @@ -19053,7 +19579,7 @@ $cidoffset = 0])
    -

    method _putheader [line 6563]

    +

    method _putheader [line 6855]

    @@ -19078,7 +19604,7 @@ $cidoffset = 0])
    -

    method _putimages [line 6231]

    +

    method _putimages [line 6504]

    @@ -19103,7 +19629,7 @@ $cidoffset = 0])
    -

    method _putinfo [line 6389]

    +

    method _putinfo [line 6662]

    @@ -19128,7 +19654,7 @@ $cidoffset = 0])
    -

    method _putjavascript [line 9379]

    +

    method _putjavascript [line 9698]

    @@ -19153,7 +19679,7 @@ $cidoffset = 0])
    -

    method _putocg [line 9869]

    +

    method _putocg [line 10906]

    @@ -19178,7 +19704,7 @@ $cidoffset = 0])
    -

    method _putpages [line 5324]

    +

    method _putpages [line 5399]

    @@ -19203,7 +19729,7 @@ $cidoffset = 0])
    -

    method _putresourcedict [line 6314]

    +

    method _putresourcedict [line 6587]

    @@ -19228,7 +19754,7 @@ $cidoffset = 0])
    -

    method _putresources [line 6355]

    +

    method _putresources [line 6628]

    @@ -19253,7 +19779,7 @@ $cidoffset = 0])
    -

    method _putshaders [line 10236]

    +

    method _putshaders [line 11273]

    @@ -19284,7 +19810,7 @@ $cidoffset = 0])
    -

    method _putsignature [line 9590]

    +

    method _putsignature [line 10627]

    @@ -19309,7 +19835,7 @@ $cidoffset = 0])
    -

    method _putspotcolors [line 6286]

    +

    method _putspotcolors [line 6559]

    @@ -19337,7 +19863,7 @@ $cidoffset = 0])
    -

    method _putstream [line 6841]

    +

    method _putstream [line 7140]

    @@ -19373,7 +19899,7 @@ $s)
    -

    method _puttrailer [line 6549]

    +

    method _puttrailer [line 6841]

    @@ -19398,7 +19924,7 @@ $s)
    -

    method _puttruetypeunicode [line 6083]

    +

    method _puttruetypeunicode [line 6356]

    diff --git a/examples/example_014.php b/examples/example_014.php index 717db6c..acedc0b 100755 --- a/examples/example_014.php +++ b/examples/example_014.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_014.php // Begin : 2008-03-04 -// Last Update : 2009-09-02 +// Last Update : 2009-09-07 // // Description : Example 014 for TCPDF class // Javascript Form and user rights (only works on Adobe Acrobat) @@ -69,126 +69,96 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- -// set font -$pdf->SetFont('helvetica', 'BI', 18); +// set font +$pdf->SetFont('helvetica', '', 10); // add a page $pdf->AddPage(); /* -Caution: the generated PDF works only with Adobe Acrobat -It is possible to create text fields, combo boxes, check boxes and buttons. Fields are created at the current position and are given a name. This name allows to manipulate them via JavaScript in order to perform some validation for instance. -Upon field creation, an associative array can be passed to set a number of properties, among which: - 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. -Colors can be chosen in the following list (case sensitive): black white red green blue cyan magenta yellow dkGray gray ltGray or be in the form #RRGGBB. +It is possible to create text fields, combo boxes, check boxes and buttons. +Fields are created at the current position and are given a name. +This name allows to manipulate them via JavaScript in order to perform some validation for instance. */ -// WARNING: only works on Adobe Acrobat -$pdf->Cell(0, 5, 'THIS EXAMPLE ONLY WORKS ON ADOBE ACROBAT!', 0, 1, 'C'); +// set default form properties +$pdf->setFormDefaultProp(array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 200), 'strokeColor'=>array(255, 128, 128))); + +$pdf->SetFont('helvetica', 'BI', 18); +$pdf->Cell(0, 5, 'Subscription form', 0, 1, 'C'); $pdf->Ln(10); -$pdf->Cell(0, 5, 'Subscription form', 0, 1, 'C'); -$pdf->Ln(10); -$pdf->SetFont('', '', 12); +$pdf->SetFont('helvetica', '', 12); -//First name +// First name $pdf->Cell(35, 5, 'First name:'); -$pdf->TextField('firstname', 50, 5, array('strokeColor'=>'ltGray')); +$pdf->TextField('firstname', 50, 5); $pdf->Ln(6); -//Last name +// Last name $pdf->Cell(35, 5, 'Last name:'); -$pdf->TextField('lastname', 50, 5, array('strokeColor'=>'ltGray')); +$pdf->TextField('lastname', 50, 5); $pdf->Ln(6); -//Gender +// Gender $pdf->Cell(35, 5, 'Gender:'); -$pdf->ComboBox('gender', 10, 5, array('', 'M', 'F'), array('strokeColor'=>'ltGray')); +//$pdf->ComboBox('gender', 10, 5, array('', 'M', 'F')); +$pdf->ComboBox('gender', 10, 5, array(array('', '-'), array('M', 'Male'), array('F', 'Female'))); $pdf->Ln(6); -//Drink +// Drink $pdf->Cell(35, 5, 'Drink:'); -$pdf->RadioButton('drink', 5, false); +$pdf->RadioButton('drink', 5, array(), array(), 'Water'); $pdf->Cell(35, 5, 'Water'); $pdf->Ln(6); $pdf->Cell(35, 5, ''); -$pdf->RadioButton('drink', 5, false); +$pdf->RadioButton('drink', 5, array(), array(), 'Beer'); $pdf->Cell(35, 5, 'Beer'); $pdf->Ln(6); $pdf->Cell(35, 5, ''); -$pdf->RadioButton('drink', 5, false); +$pdf->RadioButton('drink', 5, array(), array(), 'Wine'); $pdf->Cell(35, 5, 'Wine'); -// set export values -$pdf->IncludeJS('fdrink.exportValues=["Water", "Beer", "Wine"];'."\n"); -// check the second radiobutton -$pdf->IncludeJS("fdrink.checkThisBox(1,true);\n"); $pdf->Ln(10); -//Gender +// Listbox $pdf->Cell(35, 5, 'List:'); $pdf->ListBox('listbox', 60, 15, array('', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'), array('multipleSelection'=>'true')); $pdf->Ln(20); -//Adress +// Adress $pdf->Cell(35, 5, 'Address:'); -$pdf->TextField('address', 60, 18, array('multiline'=>true,'strokeColor'=>'ltGray')); +$pdf->TextField('address', 60, 18, array('multiline'=>true)); $pdf->Ln(19); -//E-mail +// E-mail $pdf->Cell(35, 5, 'E-mail:'); -$pdf->TextField('email', 50, 5, array('strokeColor'=>'ltGray')); +$pdf->TextField('email', 50, 5); $pdf->Ln(6); -//Newsletter -$pdf->Cell(35, 5, 'Receive our', 0, 1); -$pdf->Cell(35, 5, 'newsletter:'); -$pdf->CheckBox('newsletter', 5, true); +// Newsletter +$pdf->Cell(35, 5, 'Newsletter:'); +$pdf->CheckBox('newsletter', 5, true, array(), array(), 'OK'); +$pdf->Ln(10); + +// Date of the day +$pdf->Cell(35, 5, 'Date:'); +$pdf->TextField('date', 30, 5, array(), array('v'=>date('Y-m-d'), 'dv'=>date('Y-m-d'))); $pdf->Ln(10); + +$pdf->SetX(50); -//Date of the day (determined and formatted by JS) -$pdf->Write(5, 'Date: '); -$pdf->TextField('date', 30, 5); -$pdf->IncludeJS("getField('date').value=util.printd('dd/mm/yyyy',new Date());\n"); -$pdf->Ln(); -$pdf->Write(5, 'Signature:'); -$pdf->Ln(3); - -//Button to validate and print -$pdf->SetX(95); -$pdf->Button('print', 20, 8, 'Print', 'Print()', array('textColor'=>'yellow', 'fillColor'=>'#FF5050')); - -//Form validation functions -$pdf->IncludeJS(" +// Button to validate and print +$pdf->Button('print', 30, 10, 'Print', 'Print()', array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64))); + +// Reset Button +$pdf->Button('reset', 30, 10, 'Reset', array('S'=>'ResetForm'), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64))); + +// Submit Button +$pdf->Button('submit', 30, 10, 'Submit', array('S'=>'SubmitForm', 'F'=>'http://localhost/printvars.php', 'Flags'=>array('ExportFormat')), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64))); + + +// Form validation functions +$js = <<IncludeJS($js); // --------------------------------------------------------- //Close and output PDF document -$pdf->Output('example_014.pdf', 'I'); +$pdf->Output('example_014.pdf', 'I'); //============================================================+ // END OF FILE diff --git a/examples/example_036.php b/examples/example_036.php index 884555c..34e3f71 100755 --- a/examples/example_036.php +++ b/examples/example_036.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_036.php // Begin : 2008-08-08 -// Last Update : 2009-03-18 +// Last Update : 2009-09-05 // // Description : Example 036 for TCPDF class // Annotations @@ -79,7 +79,7 @@ $pdf->AddPage(); $pdf->Cell(0, 12, 'Example 036', 1, 1, 'C'); // text annotation -$pdf->Annotation(124, 18, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0))); +$pdf->Annotation(124, 30, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0))); // --------------------------------------------------------- diff --git a/examples/example_041.php b/examples/example_041.php index 74e40be..0e150f1 100755 --- a/examples/example_041.php +++ b/examples/example_041.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_041.php // Begin : 2008-12-07 -// Last Update : 2009-03-18 +// Last Update : 2009-09-05 // // Description : Example 041 for TCPDF class // Annotation - FileAttachment @@ -79,7 +79,7 @@ $pdf->AddPage(); $pdf->Cell(0, 12, 'File Attachment', 1, 1, 'C'); // attach an external file -$pdf->Annotation(124, 28, 4, 4, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => '../cache/utf8test.txt')); +$pdf->Annotation(78, 30, 4, 4, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => '../cache/utf8test.txt')); // --------------------------------------------------------- diff --git a/examples/example_053.php b/examples/example_053.php index 534216f..6c136e9 100644 --- a/examples/example_053.php +++ b/examples/example_053.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_053.php // Begin : 2009-09-02 -// Last Update : 2009-09-02 +// Last Update : 2009-09-07 // // Description : Example 053 for TCPDF class // Javascript example. diff --git a/htmlcolors.php b/htmlcolors.php index 82edae6..61ab5c5 100755 --- a/htmlcolors.php +++ b/htmlcolors.php @@ -2,8 +2,8 @@ //============================================================+ // File name : htmlcolors.php // Begin : 2002-04-09 -// Last Update : 2009-08-17 -// Version : 1.0.002 +// Last Update : 2009-09-06 +// Version : 1.0.003 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. @@ -77,6 +77,7 @@ $webcolor = array ( 'darkblue' => '00008b', 'darkcyan' => '008b8b', 'darkgoldenrod' => 'b8860b', +'dkgray' => 'a9a9a9', 'darkgray' => 'a9a9a9', 'darkgrey' => 'a9a9a9', 'darkgreen' => '006400', @@ -124,6 +125,7 @@ $webcolor = array ( 'lightcoral' => 'f08080', 'lightcyan' => 'e0ffff', 'lightgoldenrodyellow' => 'fafad2', +'ltgray' => 'd3d3d3', 'lightgray' => 'd3d3d3', 'lightgrey' => 'd3d3d3', 'lightgreen' => '90ee90', diff --git a/tcpdf.php b/tcpdf.php index 6d7757d..c34ee79 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2009-09-02 +// Last Update : 2009-09-07 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.7.003 +// Version : 4.8.000 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. @@ -40,9 +40,9 @@ // * supports UTF-8 Unicode and Right-To-Left languages; // * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; // * supports document encryption; -// * includes methods to publish some XHTML code; +// * includes methods to publish some XHTML code, including forms; // * includes graphic (geometric) and transformation methods; -// * includes Javascript and forms support; +// * includes Javascript and Forms support; // * includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS; // * includes methods to set Bookmarks and print a Table of Content; // * includes methods to move and delete pages; @@ -101,9 +101,9 @@ *
  • supports UTF-8 Unicode and Right-To-Left languages;
  • *
  • supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
  • *
  • supports document encryption;
  • -*
  • includes methods to publish some XHTML code;
  • +*
  • includes methods to publish some XHTML code, including forms;
  • *
  • includes graphic (geometric) and transformation methods;
  • -*
  • includes Javascript and forms support;
  • +*
  • includes Javascript and Forms support;
  • *
  • includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;
  • *
  • includes methods to set Bookmarks and print a Table of Content;
  • *
  • includes methods to move and delete pages;
  • @@ -128,7 +128,7 @@ * @copyright 2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 4.7.003 + * @version 4.8.000 */ /** @@ -152,14 +152,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 4.7.003 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 4.8.000 (http://www.tcpdf.org)'); /** * This is a PHP class for generating PDF documents without requiring external extensions.
    * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
    * @name TCPDF * @package com.tecnick.tcpdf - * @version 4.7.003 + * @version 4.8.000 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -1352,7 +1352,64 @@ if (!class_exists('TCPDF', false)) { * @since 4.7.000 (2009-08-29) */ protected $annot_obj_id = 200000; + + /** + * Array of form annotations IDs + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_obj_id = array(); + + /* + * Deafult Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. Annotation options can be directly specified using the 'aopt' entry. + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); + /** + * Javascript objects array + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $js_objects = array(); + + /** + * Start ID for javascript objects + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $js_start_obj_id = 300000; + + /** + * Current ID of javascript object + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $js_obj_id = 300000; + + /** + * Current form action (used during XHTML rendering) + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_action = ''; + + /** + * Current form encryption type (used during XHTML rendering) + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_enctype = 'application/x-www-form-urlencoded'; + + /** + * Current method to submit forms. + * @access protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_mode = 'post'; + + //------------------------------------------------------------ // METHODS //------------------------------------------------------------ @@ -1485,6 +1542,8 @@ if (!class_exists('TCPDF', false)) { $this->re_spaces = '/[\s]/'; } $this->annot_obj_id = $this->annots_start_obj_id; + $this->js_obj_id = $this->js_start_obj_id; + $this->default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); } /** @@ -3298,7 +3357,13 @@ if (!class_exists('TCPDF', false)) { * @access public * @since 4.0.018 (2008-08-06) */ - public function Annotation($x, $y, $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { + public function Annotation($x='', $y='', $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } // recalculate coordinates to account for graphic transformations if (isset($this->transfmatrix)) { $maxid = count($this->transfmatrix) - 1; @@ -3348,6 +3413,16 @@ if (!class_exists('TCPDF', false)) { if (($opt['Subtype'] == 'FileAttachment') AND (!$this->empty_string($opt['FS'])) AND file_exists($opt['FS']) AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) { $this->embeddedfiles[basename($opt['FS'])] = array('file' => $opt['FS'], 'n' => (count($this->embeddedfiles) + $this->embedded_start_obj_id)); } + // Add widgets annotation's icons + if (isset($opt['mk']['i']) AND file_exists($opt['mk']['i'])) { + $this->Image($opt['mk']['i'], '', '', 10, 10, '', '', '', false, 300, '', false, false, 0, false, true); + } + if (isset($opt['mk']['ri']) AND file_exists($opt['mk']['ri'])) { + $this->Image($opt['mk']['ri'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); + } + if (isset($opt['mk']['ix']) AND file_exists($opt['mk']['ix'])) { + $this->Image($opt['mk']['ix'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); + } } /** @@ -4492,11 +4567,12 @@ if (!class_exists('TCPDF', false)) { * @param mixed $imgmask image object returned by this function or false * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    * @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box. + * @param boolean $hidden if true do not display the image. * @return image information * @access public * @since 1.1 */ - public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false) { + public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false) { if ($x === '') { $x = $this->x; } @@ -4651,12 +4727,11 @@ if (!class_exists('TCPDF', false)) { $this->img_rb_x = $ximg + $w; } } - if ($ismask) { - // embed hidden, ouside the canvas - $xkimg = (10 * $this->pagedim[$this->page]['w']); - } else { - $xkimg = $ximg * $this->k; + if ($ismask OR $hidden) { + // image is not displayed + return $info['i']; } + $xkimg = $ximg * $this->k; $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', ($w * $this->k), ($h * $this->k), $xkimg, (($this->h - ($y + $h)) * $this->k), $info['i'])); if (!empty($border)) { $bx = $x; @@ -5484,7 +5559,7 @@ if (!class_exists('TCPDF', false)) { /** * Output annotations objects for all pages. * !!! THIS FUNCTION IS NOT YET COMPLETED !!! - * See section 8.4 of PDF reference. + * See section 12.5 of PDF 32000_2008 reference. * @access protected * @author Nicola Asuni * @since 4.0.018 (2008-08-06) @@ -5496,19 +5571,25 @@ if (!class_exists('TCPDF', false)) { if (isset($this->PageAnnots[$n])) { // set page annotations foreach ($this->PageAnnots[$n] as $key => $pl) { + $formfield = false; $pl['opt'] = array_change_key_case($pl['opt'], CASE_LOWER); $a = $pl['x'] * $this->k; - $b = $this->pagedim[$n]['h'] - ($pl['y'] * $this->k); + $b = $this->pagedim[$n]['h'] - (($pl['y'] + $pl['h']) * $this->k); $c = $pl['w'] * $this->k; $d = $pl['h'] * $this->k; - $rect = sprintf('%.2F %.2F %.2F %.2F', $a, $b, $a+$c, $b-$d); + $rect = sprintf('%.2F %.2F %.2F %.2F', $a, $b, $a+$c, $b+$d); // create new annotation object $annots = '<_textstring($pl['txt']); - //$annots .= ' /P '; - $annots .= ' /NM '.$this->_textstring(sprintf('%04u-%04u', $n, $key)); + $annots .= ' /P '.$this->page_obj_id[$n].' 0 R'; + $annots .= ' /NM '.$this->_datastring(sprintf('%04u-%04u', $n, $key)); $annots .= ' /M '.$this->_datestring(); if (isset($pl['opt']['f'])) { $val = 0; @@ -5560,31 +5641,35 @@ if (!class_exists('TCPDF', false)) { } } } + } else { + $val = intval($pl['opt']['f']); } $annots .= ' /F '.intval($val); } - //$annots .= ' /AP '; - //$annots .= ' /AS '; - $annots .= ' /Border ['; - if (isset($pl['opt']['border']) AND (count($pl['opt']['border']) >= 3)) { - $annots .= intval($pl['opt']['border'][0]).' '; - $annots .= intval($pl['opt']['border'][1]).' '; - $annots .= intval($pl['opt']['border'][2]); - if (isset($pl['opt']['border'][3]) AND is_array($pl['opt']['border'][3])) { - $annots .= ' ['; - foreach ($pl['opt']['border'][3] as $dash) { - $annots .= intval($dash).' '; - } - $annots .= ']'; - } - } else { - $annots .= '0 0 0'; + if (isset($pl['opt']['as']) AND is_string($pl['opt']['as'])) { + $annots .= ' /AS /'.$pl['opt']['as']; + } + if (isset($pl['opt']['ap']) AND is_string($pl['opt']['ap'])) { + $annots .= ' /AP << '.$pl['opt']['ap'].' >>'; + } elseif (isset($pl['opt']['ft']) AND in_array($pl['opt']['ft'], $ft)) { + $annots .= ' /AP <<'; + $annots .= ' /N <<'; + $annots .= ' /Type /XObject'; + $annots .= ' /Subtype /Form'; + $annots .= ' /FormType 1'; + $rect = sprintf('%.2F %.2F', $c, $d); + $annots .= ' /BBox [0 0 '.$rect.']'; + $annots .= ' /Matrix [1 0 0 1 0 0]'; + $annots .= ' /Resources << /ProcSet [/PDF] >>'; + $annots .= ' /Length 0'; + $annots .= ' >>'; + $annots .= ' >>'; } - $annots .= ']'; if (isset($pl['opt']['bs']) AND (is_array($pl['opt']['bs']))) { - $annots .= ' /BS <= 3)) { + $annots .= intval($pl['opt']['border'][0]).' '; + $annots .= intval($pl['opt']['border'][1]).' '; + $annots .= intval($pl['opt']['border'][2]); + if (isset($pl['opt']['border'][3]) AND is_array($pl['opt']['border'][3])) { + $annots .= ' ['; + foreach ($pl['opt']['border'][3] as $dash) { + $annots .= intval($dash).' '; + } + $annots .= ']'; + } + } else { + $annots .= '0 0 0'; + } + $annots .= ']'; } if (isset($pl['opt']['be']) AND (is_array($pl['opt']['be']))) { $annots .= ' /BE <<'; @@ -5613,15 +5714,15 @@ if (!class_exists('TCPDF', false)) { } $annots .= '>>'; } - $annots .= ' /C ['; - if (isset($pl['opt']['c']) AND (is_array($pl['opt']['c']))) { + if (isset($pl['opt']['c']) AND (is_array($pl['opt']['c'])) AND !empty($pl['opt']['c'])) { + $annots .= ' /C ['; foreach ($pl['opt']['c'] as $col) { $col = intval($col); $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); $annots .= sprintf(" %.4F", $color); } + $annots .= ']'; } - $annots .= ']'; //$annots .= ' /StructParent '; //$annots .= ' /OC '; $markups = array('text', 'freetext', 'line', 'square', 'circle', 'polygon', 'polyline', 'highlight', 'underline', 'squiggly', 'strikeout', 'stamp', 'caret', 'ink', 'fileattachment', 'sound'); @@ -5646,6 +5747,7 @@ if (!class_exists('TCPDF', false)) { //$annots .= ' /IT '; //$annots .= ' /ExData '; } + $lineendings = array('Square', 'Circle', 'Diamond', 'OpenArrow', 'ClosedArrow', 'None', 'Butt', 'ROpenArrow', 'RClosedArrow', 'Slash'); switch (strtolower($pl['opt']['subtype'])) { case 'text': { if (isset($pl['opt']['open'])) { @@ -5717,7 +5819,7 @@ if (!class_exists('TCPDF', false)) { } $annots .= ']'; } - $tfit = array('FreeTextCallout', 'FreeTextTypeWriter'); + $tfit = array('FreeText', 'FreeTextCallout', 'FreeTextTypeWriter'); if (isset($pl['opt']['it']) AND in_array($pl['opt']['it'], $tfit)) { $annots .= ' /IT '.$pl['opt']['it']; } @@ -5728,10 +5830,11 @@ if (!class_exists('TCPDF', false)) { $b = $pl['opt']['rd'][3] * $this->k; $annots .= ' /RD ['.sprintf('%.2F %.2F %.2F %.2F', $l, $r, $t, $b).']'; } - //$annots .= ' /LE '; + if (isset($pl['opt']['le']) AND in_array($pl['opt']['le'], $lineendings)) { + $annots .= ' /LE /'.$pl['opt']['le']; + } break; } - // ... to be completed ... case 'line': { break; } @@ -5793,7 +5896,10 @@ if (!class_exists('TCPDF', false)) { } $filename = basename($pl['opt']['sound']); if (isset($this->embeddedfiles[$filename]['n'])) { + $annots .= ' /Sound <_datastring($filename).' /EF <embeddedfiles[$filename]['n'].' 0 R>> >>'; $iconsapp = array('Speaker', 'Mic'); if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { $annots .= ' /Name /'.$pl['opt']['name']; @@ -5807,16 +5913,178 @@ if (!class_exists('TCPDF', false)) { break; } case 'widget': { - // PDF32000_2008.pdf page 408 (... TO BE COMPLETED ...) $hmode = array('N', 'I', 'O', 'P', 'T'); if (isset($pl['opt']['h']) AND in_array($pl['opt']['h'], $hmode)) { $annots .= ' /H /'.$pl['opt']['h']; } - if (isset($pl['opt']['mk']) AND (is_array($pl['opt']['mk']))) { + if (isset($pl['opt']['mk']) AND (is_array($pl['opt']['mk'])) AND !empty($pl['opt']['mk'])) { $annots .= ' /MK <<'; - // ... TO BE COMPLETED ... + if (isset($pl['opt']['mk']['r'])) { + $annots .= ' /R '.$pl['opt']['mk']['r']; + } + if (isset($pl['opt']['mk']['bc']) AND (is_array($pl['opt']['mk']['bc']))) { + $annots .= ' /BC ['; + foreach($pl['opt']['mk']['bc'] AS $col) { + $col = intval($col); + $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); + $annots .= ' '.$color; + } + $annots .= ']'; + } + if (isset($pl['opt']['mk']['bg']) AND (is_array($pl['opt']['mk']['bg']))) { + $annots .= ' /BG ['; + foreach($pl['opt']['mk']['bg'] AS $col) { + $col = intval($col); + $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); + $annots .= ' '.$color; + } + $annots .= ']'; + } + if (isset($pl['opt']['mk']['ca'])) { + $annots .= ' /CA '.$this->_textstring($pl['opt']['mk']['ca']); + } elseif (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /CA '.$this->_textstring($pl['opt']['t']); + } + if (isset($pl['opt']['mk']['rc'])) { + $annots .= ' /RC '.$this->_textstring($pl['opt']['mk']['rc']); + } elseif (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /RC '.$this->_textstring($pl['opt']['t']); + } + if (isset($pl['opt']['mk']['ac'])) { + $annots .= ' /AC '.$this->_textstring($pl['opt']['mk']['ac']); + } elseif (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /AC '.$this->_textstring($pl['opt']['t']); + } + if (isset($pl['opt']['mk']['i'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['i']); + if ($info !== false) { + $annots .= ' /I '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['ri'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['ri']); + if ($info !== false) { + $annots .= ' /RI '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['ix'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['ix']); + if ($info !== false) { + $annots .= ' /IX '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['if']) AND (is_array($pl['opt']['mk']['if'])) AND !empty($pl['opt']['mk']['if'])) { + $annots .= ' /IF <<'; + $if_sw = array('A', 'B', 'S', 'N'); + if (isset($pl['opt']['mk']['if']['sw']) AND in_array($pl['opt']['mk']['if']['sw'], $if_sw)) { + $annots .= ' /SW /'.$pl['opt']['mk']['if']['sw']; + } + $if_s = array('A', 'P'); + if (isset($pl['opt']['mk']['if']['s']) AND in_array($pl['opt']['mk']['if']['s'], $if_s)) { + $annots .= ' /S /'.$pl['opt']['mk']['if']['s']; + } + if (isset($pl['opt']['mk']['if']['a']) AND (is_array($pl['opt']['mk']['if']['a'])) AND !empty($pl['opt']['mk']['if']['a'])) { + $annots .= ' /A ['.$pl['opt']['mk']['if']['a'][0].' '.$pl['opt']['mk']['if']['a'][1].']'; + } + if (isset($pl['opt']['mk']['if']['fb']) AND ($pl['opt']['mk']['if']['fb'])) { + $annots .= ' /FB true'; + } + $annots .= '>>'; + } + if (isset($pl['opt']['mk']['tp']) AND ($pl['opt']['mk']['tp'] >= 0) AND ($pl['opt']['mk']['tp'] <= 6)) { + $annots .= ' /TP '.$pl['opt']['mk']['tp']; + } else { + $annots .= ' /TP 0'; + } $annots .= '>>'; - } + } // end MK + // --- Entries for field dictionaries --- + // /Parent + // /Kids + if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /T '.$this->_datastring($pl['opt']['t']); + } + if (isset($pl['opt']['tu']) AND is_string($pl['opt']['tu'])) { + $annots .= ' /TU '.$this->_datastring($pl['opt']['tu']); + } + if (isset($pl['opt']['tm']) AND is_string($pl['opt']['tm'])) { + $annots .= ' /TM '.$this->_datastring($pl['opt']['tm']); + } + if (isset($pl['opt']['ff'])) { + if (is_array($pl['opt']['ff'])) { + // array of bit settings + $flag = 0; + foreach($pl['opt']['ff'] as $val) { + $flag += 1 << ($val - 1); + } + } else { + $flag = intval($pl['opt']['ff']); + } + $annots .= ' /Ff '.$flag; + } + if (isset($pl['opt']['maxlen'])) { + $annots .= ' /MaxLen '.intval($pl['opt']['maxlen']); + } + if (isset($pl['opt']['v'])) { + $annots .= ' /V'; + if (is_array($pl['opt']['v'])) { + foreach ($pl['opt']['v'] AS $optval) { + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['v']); + } + } + if (isset($pl['opt']['dv']) AND is_string($pl['opt']['dv'])) { + $annots .= ' /DV'; + if (is_array($pl['opt']['dv'])) { + foreach ($pl['opt']['dv'] AS $optval) { + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['dv']); + } + } + if (isset($pl['opt']['rv']) AND is_string($pl['opt']['rv'])) { + $annots .= ' /RV'; + if (is_array($pl['opt']['rv'])) { + foreach ($pl['opt']['rv'] AS $optval) { + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['rv']); + } + } + if (isset($pl['opt']['a']) AND !empty($pl['opt']['a'])) { + $annots .= ' /A << '.$pl['opt']['a'].' >>'; + } + if (isset($pl['opt']['aa']) AND !empty($pl['opt']['aa'])) { + $annots .= ' /AA << '.$pl['opt']['aa'].' >>'; + } + if (isset($pl['opt']['q']) AND ($pl['opt']['q'] >= 0) AND ($pl['opt']['q'] <= 2)) { + $annots .= ' /Q '.intval($pl['opt']['q']); + } + if (isset($pl['opt']['opt']) AND (is_array($pl['opt']['opt'])) AND !empty($pl['opt']['opt'])) { + $annots .= ' /Opt ['; + foreach($pl['opt']['opt'] AS $copt) { + if (is_array($copt)) { + $annots .= ' ['.$this->_textstring($copt[0]).' '.$this->_textstring($copt[1]).']'; + } else { + $annots .= ' '.$this->_textstring($copt); + } + } + $annots .= ']'; + } + if (isset($pl['opt']['ti'])) { + $annots .= ' /TI '.intval($pl['opt']['ti']); + } + if (isset($pl['opt']['i']) AND (is_array($pl['opt']['i'])) AND !empty($pl['opt']['i'])) { + $annots .= ' /I ['; + foreach($pl['opt']['i'] AS $copt) { + $annots .= intval($copt).' '; + } + $annots .= ']'; + } break; } case 'screen': { @@ -5839,11 +6107,16 @@ if (!class_exists('TCPDF', false)) { } } $annots .= '>>'; + // create new annotation object ++$this->annot_obj_id; $this->offsets[$this->annot_obj_id] = $this->bufferlen; $this->_out($this->annot_obj_id.' 0 obj'); $this->_out($annots); $this->_out('endobj'); + if ($formfield) { + // store reference of form object + $this->form_obj_id[] = $this->annot_obj_id; + } } } } // end for each page @@ -6366,10 +6639,10 @@ if (!class_exists('TCPDF', false)) { $this->_putresourcedict(); $this->_out('>>'); $this->_out('endobj'); - $this->_putjavascript(); $this->_putbookmarks(); $this->_putEmbeddedFiles(); $this->_putannotsobjs(); + $this->_putjavascript(); // encryption if ($this->encrypted) { $this->_newobj(); @@ -6442,7 +6715,7 @@ if (!class_exists('TCPDF', false)) { $this->_out('/Lang /'.$this->l['a_meta_language']); } $this->_out('/Names <<'); - if (!$this->empty_string($this->javascript)) { + if ((!empty($this->javascript)) OR (!empty($this->js_objects))) { $this->_out('/JavaScript '.($this->n_js).' 0 R'); } $this->_out('>>'); @@ -6455,17 +6728,36 @@ if (!class_exists('TCPDF', false)) { $v = $this->n_ocg_view.' 0 R'; $as = '<> <>'; $this->_out('/OCProperties <>>>'); - // signatures - if ($this->sign AND isset($this->signature_data['cert_type'])) { + // AcroForm + if (!empty($this->form_obj_id) OR ($this->sign AND isset($this->signature_data['cert_type']))) { $this->_out('/AcroForm<<'); - $this->_out('/Fields ['.$this->sig_obj_id.' 0 R]'); - $this->_out('/NeedAppearances false'); - $this->_out('/SigFlags 3'); + $objrefs = ''; + if ($this->sign AND isset($this->signature_data['cert_type'])) { + $objrefs .= $this->sig_obj_id.' 0 R'; + } + if (!empty($this->form_obj_id)) { + foreach($this->form_obj_id as $objid) { + $objrefs .= ' '.$objid.' 0 R'; + } + } + $this->_out('/Fields ['.$objrefs.']'); + $this->_out('/NeedAppearances '.(empty($this->form_obj_id)?'false':'true')); + if ($this->sign AND isset($this->signature_data['cert_type'])) { + $this->_out('/SigFlags 3'); + } + //$this->_out('/CO '); + //$this->_out('/DR << >>'); + //$this->_out('/DA '); + $this->_out('/Q '.(($this->rtl)?'2':'0')); + //$this->_out('/XFA '); $this->_out('>>'); - if ($this->signature_data['cert_type'] > 0) { - $this->_out('/Perms<sig_obj_id + 1).' 0 R>>'); - } else { - $this->_out('/Perms<sig_obj_id + 1).' 0 R>>'); + // signatures + if ($this->sign AND isset($this->signature_data['cert_type'])) { + if ($this->signature_data['cert_type'] > 0) { + $this->_out('/Perms<sig_obj_id + 1).' 0 R>>'); + } else { + $this->_out('/Perms<sig_obj_id + 1).' 0 R>>'); + } } } } @@ -6643,6 +6935,13 @@ if (!class_exists('TCPDF', false)) { $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); } } + // Javascript Objects + if ($this->js_obj_id > $this->js_start_obj_id) { + $this->_out(($this->js_start_obj_id + 1).' '.($this->js_obj_id - $this->js_start_obj_id)); + for ($i = ($this->js_start_obj_id + 1); $i <= $this->js_obj_id; ++$i) { + $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); + } + } //Trailer $this->_out('trailer'); $this->_out('<<'); @@ -7211,6 +7510,10 @@ if (!class_exists('TCPDF', false)) { $returncolor = false; $color = preg_replace('/[\s]*/', '', $color); // remove extra spaces $color = strtolower($color); + if (($dotpos = strpos($color, '.')) !== false) { + // remove class parent (i.e.: color.red) + $color = substr($color, ($dotpos + 1)); + } if (strlen($color) == 0) { return false; } @@ -9358,10 +9661,11 @@ if (!class_exists('TCPDF', false)) { } - // --- JAVASCRIPT - FORMS ------------------------------ + // --- JAVASCRIPT ------------------------------------------------------ /* * Adds a javascript + * @param string $script Javascript code * @access public * @author Johannes Güntert, Nicola Asuni * @since 2.1.002 (2008-02-12) @@ -9369,7 +9673,22 @@ if (!class_exists('TCPDF', false)) { public function IncludeJS($script) { $this->javascript .= $script; } - + + /* + * Adds a javascript object and return object ID + * @param string $script Javascript code + * @param boolean $onload if true executes this object when opening the document + * @return int internal object ID + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function addJavascriptObject($script, $onload=false) { + ++$this->js_obj_id; + $this->js_objects[$this->js_obj_id] = array('js' => $script, 'onload' => $onload); + return $this->js_obj_id; + } + /* * Create a javascript PDF string. * @access protected @@ -9377,32 +9696,56 @@ if (!class_exists('TCPDF', false)) { * @since 2.1.002 (2008-02-12) */ protected function _putjavascript() { - if (empty($this->javascript)) { + if (empty($this->javascript) AND empty($this->js_objects)) { return; } - if (!$this->ur) { - // enable JavaScript - $this->setUserRights(); - } if (strpos($this->javascript, 'this.addField') > 0) { + if (!$this->ur) { + //$this->setUserRights(); + } // the following two lines are used to avoid form fields duplication after saving // The addField method only works on Acrobat Writer, unless the document is signed with Adobe private key (UR3) $jsa = sprintf("ftcpdfdocsaved=this.addField('%s','%s',%d,[%.2F,%.2F,%.2F,%.2F]);", 'tcpdfdocsaved', 'text', 0, 0, 1, 0, 1); $jsb = "getField('tcpdfdocsaved').value='saved';"; $this->javascript = $jsa."\n".$this->javascript."\n".$jsb; } - $this->_newobj(); - $this->n_js = $this->n; + $this->n_js = $this->_newobj(); $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('/Names ['); + if (!empty($this->javascript)) { + $this->_out('(EmbeddedJS) '.($this->n + 1).' 0 R'); + } + if (!empty($this->js_objects)) { + foreach ($this->js_objects as $key => $val) { + if ($val['onload']) { + $this->_out('(JS'.$key.') '.$key.' 0 R'); + } + } + } + $this->_out(']'); $this->_out('>>'); $this->_out('endobj'); + // default Javascript object + if (!empty($this->javascript)) { + $this->_newobj(); + $this->_out('<<'); + $this->_out('/S /JavaScript'); + $this->_out('/JS '.$this->_textstring($this->javascript)); + $this->_out('>>'); + $this->_out('endobj'); + } + // additional Javascript objects + if (!empty($this->js_objects)) { + foreach ($this->js_objects as $key => $val) { + $this->offsets[$key] = $this->bufferlen; + $this->_out($key.' 0 obj'); + $this->_out('<<'); + $this->_out('/S /JavaScript'); + $this->_out('/JS '.$this->_textstring($val['js'])); + $this->_out('>>'); + $this->_out('endobj'); + } + } } /* @@ -9431,7 +9774,7 @@ if (!class_exists('TCPDF', false)) { * @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.
    + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. * @access protected * @author Denis Van Nuffelen, Nicola Asuni * @since 2.1.002 (2008-02-12) @@ -9460,35 +9803,521 @@ if (!class_exists('TCPDF', false)) { } $this->javascript .= '}'; } + + // --- FORM FIELDS ----------------------------------------------------- + + /* + * Convert JavaScript form fields properties array to Annotation Properties array. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @return array of annotation properties + * @access protected + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ + protected function getAnnotOptFromJSProp($prop) { + if (isset($prop['aopt']) AND is_array($prop['aopt'])) { + // the annotation options area lready defined + return $prop['aopt']; + } + $opt = array(); // value to be returned + // alignment: Controls how the text is laid out within the text field. + if (isset($prop['alignment'])) { + switch ($prop['alignment']) { + case 'left': { + $opt['q'] = 0; + break; + } + case 'center': { + $opt['q'] = 1; + break; + } + case 'right': { + $opt['q'] = 2; + break; + } + default: { + $opt['q'] = ($this->rtl)?2:0; + break; + } + } + } + // lineWidth: Specifies the thickness of the border when stroking the perimeter of a field's rectangle. + if (isset($prop['lineWidth'])) { + $linewidth = intval($prop['lineWidth']); + } else { + $linewidth = 1; + } + // borderStyle: The border style for a field. + if (isset($prop['borderStyle'])) { + switch ($prop['borderStyle']) { + case 'border.d': + case 'dashed': { + $opt['border'] = array(0, 0, $linewidth, array(3, 2)); + $opt['bs'] = array('w'=>$linewidth, 's'=>'D', 'd'=>array(3, 2)); + break; + } + case 'border.b': + case 'beveled': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'B'); + break; + } + case 'border.i': + case 'inset': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'I'); + break; + } + case 'border.u': + case 'underline': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'U'); + break; + } + default: + case 'border.s': + case 'solid': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'S'); + break; + } + } + } + if (isset($prop['border']) AND is_array($prop['border'])) { + $opt['border'] = $prop['border']; + } + if (!isset($opt['mk'])) { + $opt['mk'] = array(); + } + if (!isset($opt['mk']['if'])) { + $opt['mk']['if'] = array(); + } + $opt['mk']['if']['a'] = array(0.5, 0.5); + // buttonAlignX: Controls how space is distributed from the left of the button face with respect to the icon. + if (isset($prop['buttonAlignX'])) { + $opt['mk']['if']['a'][0] = $prop['buttonAlignX']; + } + // buttonAlignY: Controls how unused space is distributed from the bottom of the button face with respect to the icon. + if (isset($prop['buttonAlignY'])) { + $opt['mk']['if']['a'][1] = $prop['buttonAlignY']; + } + // buttonFitBounds: If true, the extent to which the icon may be scaled is set to the bounds of the button field. + if (isset($prop['buttonFitBounds']) AND ($prop['buttonFitBounds'] == 'true')) { + $opt['mk']['if']['fb'] = true; + } + // buttonScaleHow: Controls how the icon is scaled (if necessary) to fit inside the button face. + if (isset($prop['buttonScaleHow'])) { + switch ($prop['buttonScaleHow']) { + case 'scaleHow.proportional': { + $opt['mk']['if']['s'] = 'P'; + break; + } + case 'scaleHow.anamorphic': { + $opt['mk']['if']['s'] = 'A'; + break; + } + } + } + // buttonScaleWhen: Controls when an icon is scaled to fit inside the button face. + if (isset($prop['buttonScaleWhen'])) { + switch ($prop['buttonScaleWhen']) { + case 'scaleWhen.always': { + $opt['mk']['if']['sw'] = 'A'; + break; + } + case 'scaleWhen.never': { + $opt['mk']['if']['sw'] = 'N'; + break; + } + case 'scaleWhen.tooBig': { + $opt['mk']['if']['sw'] = 'B'; + break; + } + case 'scaleWhen.tooSmall': { + $opt['mk']['if']['sw'] = 'S'; + break; + } + } + } + // buttonPosition: Controls how the text and the icon of the button are positioned with respect to each other within the button face. + if (isset($prop['buttonPosition'])) { + switch ($prop['buttonPosition']) { + case 0: + case 'position.textOnly': { + $opt['mk']['tp'] = 0; + break; + } + case 1: + case 'position.iconOnly': { + $opt['mk']['tp'] = 1; + break; + } + case 2: + case 'position.iconTextV': { + $opt['mk']['tp'] = 2; + break; + } + case 3: + case 'position.textIconV': { + $opt['mk']['tp'] = 3; + break; + } + case 4: + case 'position.iconTextH': { + $opt['mk']['tp'] = 4; + break; + } + case 5: + case 'position.textIconH': { + $opt['mk']['tp'] = 5; + break; + } + case 6: + case 'position.overlay': { + $opt['mk']['tp'] = 6; + break; + } + } + } + // fillColor: Specifies the background color for a field. + if (isset($prop['fillColor'])) { + if (is_array($prop['fillColor'])) { + $opt['mk']['bg'] = $prop['fillColor']; + } else { + $opt['mk']['bg'] = $this->convertHTMLColorToDec($prop['fillColor']); + } + } + // strokeColor: Specifies the stroke color for a field that is used to stroke the rectangle of the field with a line as large as the line width. + if (isset($prop['strokeColor'])) { + if (is_array($prop['strokeColor'])) { + $opt['mk']['bc'] = $prop['strokeColor']; + } else { + $opt['mk']['bc'] = $this->convertHTMLColorToDec($prop['strokeColor']); + } + } + // rotation: The rotation of a widget in counterclockwise increments. + if (isset($prop['rotation'])) { + $opt['mk']['r'] = $prop['rotation']; + } + // charLimit: Limits the number of characters that a user can type into a text field. + if (isset($prop['charLimit'])) { + $opt['maxlen'] = intval($prop['charLimit']); + } + if (!isset($ff)) { + $ff = 0; + } + // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. + if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { + $ff += 1 << 0; + } + // required: Specifies whether a field requires a value. + if (isset($prop['required']) AND ($prop['required'] == 'true')) { + $ff += 1 << 1; + } + // multiline: Controls how text is wrapped within the field. + if (isset($prop['multiline']) AND ($prop['multiline'] == 'true')) { + $ff += 1 << 12; + } + // password: Specifies whether the field should display asterisks when data is entered in the field. + if (isset($prop['password']) AND ($prop['password'] == 'true')) { + $ff += 1 << 13; + } + // NoToggleToOff: If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. + if (isset($prop['NoToggleToOff']) AND ($prop['NoToggleToOff'] == 'true')) { + $ff += 1 << 14; + } + // Radio: If set, the field is a set of radio buttons. + if (isset($prop['Radio']) AND ($prop['Radio'] == 'true')) { + $ff += 1 << 15; + } + // Pushbutton: If set, the field is a pushbutton that does not retain a permanent value. + if (isset($prop['Pushbutton']) AND ($prop['Pushbutton'] == 'true')) { + $ff += 1 << 16; + } + // Combo: If set, the field is a combo box; if clear, the field is a list box. + if (isset($prop['Combo']) AND ($prop['Combo'] == 'true')) { + $ff += 1 << 17; + } + // editable: Controls whether a combo box is editable. + if (isset($prop['editable']) AND ($prop['editable'] == 'true')) { + $ff += 1 << 18; + } + // Sort: If set, the field's option items shall be sorted alphabetically. + if (isset($prop['Sort']) AND ($prop['Sort'] == 'true')) { + $ff += 1 << 19; + } + // fileSelect: If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection). + if (isset($prop['fileSelect']) AND ($prop['fileSelect'] == 'true')) { + $ff += 1 << 20; + } + // multipleSelection: If true, indicates that a list box allows a multiple selection of items. + if (isset($prop['multipleSelection']) AND ($prop['multipleSelection'] == 'true')) { + $ff += 1 << 21; + } + // doNotSpellCheck: If true, spell checking is not performed on this editable text field. + if (isset($prop['doNotSpellCheck']) AND ($prop['doNotSpellCheck'] == 'true')) { + $ff += 1 << 22; + } + // doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. + if (isset($prop['doNotScroll']) AND ($prop['doNotScroll'] == 'true')) { + $ff += 1 << 23; + } + // comb: If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set. + if (isset($prop['comb']) AND ($prop['comb'] == 'true')) { + $ff += 1 << 24; + } + // radiosInUnison: If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons. + if (isset($prop['radiosInUnison']) AND ($prop['radiosInUnison'] == 'true')) { + $ff += 1 << 25; + } + // richText: If true, the field allows rich text formatting. + if (isset($prop['richText']) AND ($prop['richText'] == 'true')) { + $ff += 1 << 25; + } + // commitOnSelChange: Controls whether a field value is committed after a selection change. + if (isset($prop['commitOnSelChange']) AND ($prop['commitOnSelChange'] == 'true')) { + $ff += 1 << 26; + } + $opt['ff'] = $ff; + // defaultValue: The default value of a field - that is, the value that the field is set to when the form is reset. + if (isset($prop['defaultValue'])) { + $opt['dv'] = $prop['defaultValue']; + } + $f = 4; // default value for annotation flags + // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. + if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { + $f += 1 << 6; + } + // display: Controls whether the field is hidden or visible on screen and in print. + if (isset($prop['display'])) { + if ($prop['display'] == 'display.visible') { + // + } elseif ($prop['display'] == 'display.hidden') { + $f += 1 << 1; + } elseif ($prop['display'] == 'display.noPrint') { + $f -= 1 << 2; + } elseif ($prop['display'] == 'display.noView') { + $f += 1 << 5; + } + } + $opt['f'] = $f; + // currentValueIndices: Reads and writes single or multiple values of a list box or combo box. + if (isset($prop['currentValueIndices']) AND is_array($prop['currentValueIndices'])) { + $opt['i'] = $prop['currentValueIndices']; + } + // value: The value of the field data that the user has entered. + if (isset($prop['value'])) { + if (is_array($prop['value'])) { + $opt['opt'] = array(); + foreach ($prop['value'] AS $key => $optval) { + // exportValues: An array of strings representing the export values for the field. + if (isset($prop['exportValues'][$key])) { + $opt['opt'][$key] = array($prop['exportValues'][$key], $prop['value'][$key]); + } else { + $opt['opt'][$key] = $prop['value'][$key]; + } + } + } else { + $opt['v'] = $prop['value']; + } + } + // richValue: This property specifies the text contents and formatting of a rich text field. + if (isset($prop['richValue'])) { + $opt['rv'] = $prop['richValue']; + } + // submitName: If nonempty, used during form submission instead of name. Only applicable if submitting in HTML format (that is, URL-encoded). + if (isset($prop['submitName'])) { + $opt['tm'] = $prop['submitName']; + } + // name: Fully qualified field name. + if (isset($prop['name'])) { + $opt['t'] = $prop['name']; + } + // userName: The user name (short description string) of the field. + if (isset($prop['userName'])) { + $opt['tu'] = $prop['userName']; + } + // highlight: Defines how a button reacts when a user clicks it. + if (isset($prop['highlight'])) { + switch ($prop['highlight']) { + case 'none': + case 'highlight.n': { + $opt['h'] = 'N'; + break; + } + case 'invert': + case 'highlight.i': { + $opt['h'] = 'i'; + break; + } + case 'push': + case 'highlight.p': { + $opt['h'] = 'P'; + break; + } + case 'outline': + case 'highlight.o': { + $opt['h'] = 'O'; + break; + } + } + } + // Unsupported options: + // - calcOrderIndex: Changes the calculation order of fields in the document. + // - delay: Delays the redrawing of a field's appearance. + // - defaultStyle: This property defines the default style attributes for the form field. + // - style: Allows the user to set the glyph style of a check box or radio button. + // - textColor, textFont, textSize + return $opt; + } + + /* + * Set default properties for form fields. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ + public function setFormDefaultProp($prop=array()) { + $this->default_form_prop = $prop; + } + + /* + * Return the default properties for form fields. + * @return array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ + public function getFormDefaultProp() { + return $this->default_form_prop; + } /* * 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.
    + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) */ - public function TextField($name, $w, $h, $prop=array()) { - $this->_addfield('text', $name, $this->x, $this->y, $w, $h, $prop); + public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('text', $name, $x, $y, $w, $h, $prop); + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // remove some conflicting options + unset($opt['bs']); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Tx'; + $opt['t'] = $name; + /* + Additional annotation's parameters (check _putannotsobj() method): + //$opt['f'] + //$opt['ap'] + //$opt['as'] + //$opt['bs'] + //$opt['be'] + //$opt['c'] + //$opt['border'] + //$opt['h'] + //$opt['mk'] + //$opt['mk']['r'] + //$opt['mk']['bc'] + //$opt['mk']['bg'] + //$opt['mk']['ca'] + //$opt['mk']['rc'] + //$opt['mk']['ac'] + //$opt['mk']['i'] + //$opt['mk']['ri'] + //$opt['mk']['ix'] + //$opt['mk']['if'] + //$opt['mk']['if']['sw'] + //$opt['mk']['if']['s'] + //$opt['mk']['if']['a'] + //$opt['mk']['if']['fb'] + //$opt['mk']['tp'] + //$opt['tu'] + //$opt['tm'] + //$opt['ff'] + //$opt['v'] + //$opt['dv'] + //$opt['a'] + //$opt['aa'] + //$opt['q'] + */ + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } } - + /* * 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.
    + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public * @author Nicola Asuni - * @since 2.2.003 (2008-03-03) + * @since 4.8.000 (2009-09-07) */ - public function RadioButton($name, $w, $prop=array()) { - if (!isset($prop['strokeColor'])) { - $prop['strokeColor']='black'; + public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='', $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('radiobutton', $name, $x, $y, $w, $w, $prop); + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['NoToggleToOff'] = 'true'; + $prop['Radio'] = 'true'; + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + $opt['t'] = $name; + $opt['as'] = 'Off'; + $opt['ap'] = '/N << /'.$onvalue.' /null >>'; + $this->Annotation($x, $y, $w, $w, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; } - $this->_addfield('radiobutton', $name, $this->x, $this->y, $w, $w, $prop); } /* @@ -9497,21 +10326,48 @@ if (!class_exists('TCPDF', false)) { * @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.
    + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public * @author Nicola Asuni - * @since 2.2.003 (2008-03-03) + * @since 4.8.000 (2009-09-07) */ - public function ListBox($name, $w, $h, $values, $prop=array()) { - if (!isset($prop['strokeColor'])) { - $prop['strokeColor'] = 'ltGray'; + public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; } - $this->_addfield('listbox', $name, $this->x, $this->y, $w, $h, $prop); - $s = ''; - foreach ($values as $value) { - $s .= "'".addslashes($value)."',"; + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('listbox', $name, $x, $y, $w, $h, $prop); + $s = ''; + foreach ($values as $value) { + $s .= "'".addslashes($value)."',"; + } + $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Ch'; + $opt['t'] = $name; + $opt['opt'] = $values; + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; } - $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; } /* @@ -9520,18 +10376,49 @@ if (!class_exists('TCPDF', false)) { * @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.
    + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) */ - public 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)."',"; + public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('combobox', $name, $x, $y, $w, $h, $prop); + $s = ''; + foreach ($values as $value) { + $s .= "'".addslashes($value)."',"; + } + $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['Combo'] = true; + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Ch'; + $opt['t'] = $name; + $opt['opt'] = $values; + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; } - $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; } /* @@ -9539,17 +10426,52 @@ if (!class_exists('TCPDF', false)) { * @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.
    + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) */ - public function CheckBox($name, $w, $checked=false, $prop=array()) { - $prop['value'] = ($checked ? 'Yes' : 'Off'); - if (!isset($prop['strokeColor'])) { - $prop['strokeColor'] = 'black'; + public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('checkbox', $name, $x, $y, $w, $w, $prop); + return; + } + if (!isset($prop['value'])) { + $prop['value'] = array('Yes'); + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + $opt['t'] = $name; + $opt['opt'] = array($onvalue); + if ($checked) { + $opt['v'] = array('/0'); + } + $opt['as'] = '0'; + $opt['ap'] = '/N << /0 /On >>'; + $this->Annotation($x, $y, $w, $w, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; } - $this->_addfield('checkbox', $name, $this->x, $this->y, $w, $w, $prop); } /* @@ -9558,27 +10480,142 @@ if (!class_exists('TCPDF', false)) { * @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.
    + * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). * @access public - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) */ - public function Button($name, $w, $h, $caption, $action, $prop=array()) { - if (!isset($prop['strokeColor'])) { - $prop['strokeColor'] = 'black'; + public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x='', $y='', $js=false) { + if ($x === '') { + $x = $this->x; } - if (!isset($prop['borderStyle'])) { - $prop['borderStyle'] = 'beveled'; + if ($y === '') { + $y = $this->y; + } + if ($js) { + $this->_addfield('button', $name, $this->x, $this->y, $w, $h, $prop); + $this->javascript .= 'f'.$name.".buttonSetCaption('".addslashes($caption)."');\n"; + $this->javascript .= 'f'.$name.".setAction('MouseUp','".addslashes($action)."');\n"; + $this->javascript .= 'f'.$name.".highlight='push';\n"; + $this->javascript .= 'f'.$name.".print=false;\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['Pushbutton'] = 'true'; + $prop['highlight'] = 'push'; + $prop['display'] = 'display.noPrint'; + // get annotation data + $popt = $this->getAnnotOptFromJSProp($prop); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + $opt['t'] = $caption; + $opt['v'] = $name; + if (!empty($action)) { + if (is_array($action)) { + // form action options as on section 12.7.5 of PDF32000_2008. + $opt['aa'] = '/D <<'; + $bmode = array('SubmitForm', 'ResetForm', 'ImportData'); + foreach ($action AS $key => $val) { + if (($key == 'S') AND in_array($val, $bmode)) { + $opt['aa'] .= ' /S /'.$val; + } elseif (($key == 'F') AND (!empty($val))) { + $opt['aa'] .= ' /F '.$this->_datastring($val); + } elseif (($key == 'Fields') AND is_array($val) AND !empty($val)) { + $opt['aa'] .= ' /Fields ['; + foreach ($val AS $field) { + $opt['aa'] .= ' '.$this->_textstring($field); + } + $opt['aa'] .= ']'; + } elseif (($key == 'Flags')) { + $ff = 0; + if (is_array($val)) { + foreach ($val AS $flag) { + switch ($flag) { + case 'Include/Exclude': { + $ff += 1 << 0; + break; + } + case 'IncludeNoValueFields': { + $ff += 1 << 1; + break; + } + case 'ExportFormat': { + $ff += 1 << 2; + break; + } + case 'GetMethod': { + $ff += 1 << 3; + break; + } + case 'SubmitCoordinates': { + $ff += 1 << 4; + break; + } + case 'XFDF': { + $ff += 1 << 5; + break; + } + case 'IncludeAppendSaves': { + $ff += 1 << 6; + break; + } + case 'IncludeAnnotations': { + $ff += 1 << 7; + break; + } + case 'SubmitPDF': { + $ff += 1 << 8; + break; + } + case 'CanonicalFormat': { + $ff += 1 << 9; + break; + } + case 'ExclNonUserAnnots': { + $ff += 1 << 10; + break; + } + case 'ExclFKey': { + $ff += 1 << 11; + break; + } + case 'EmbedForm': { + $ff += 1 << 13; + break; + } + } + } + } else { + $ff = intval($val); + } + $opt['aa'] .= ' /Flags '.$ff; + } + } + $opt['aa'] .= ' >>'; + } else { + // Javascript action or raw action command + $js_obj_id = $this->addJavascriptObject($action); + $opt['aa'] = '/D '.$js_obj_id.' 0 R'; + } + } + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; } - $this->_addfield('button', $name, $this->x, $this->y, $w, $h, $prop); - $this->javascript .= 'f'.$name.".buttonSetCaption('".addslashes($caption)."');\n"; - $this->javascript .= 'f'.$name.".setAction('MouseUp','".addslashes($action)."');\n"; - $this->javascript .= 'f'.$name.".highlight='push';\n"; - $this->javascript .= 'f'.$name.".print=false;\n"; } - // END JAVASCRIPT - FORMS ------------------------------ + // --- END FORMS FIELDS ------------------------------------------------ /* * Add certification signature (DocMDP or UR3) @@ -9671,7 +10708,7 @@ if (!class_exists('TCPDF', false)) { $this->ur_signature = $signature; if (!$this->sign) { // This signature only works using the Adobe Private key that is unavailable! - //$this->setSignature('', '', '', '', 0, array()); + $this->setSignature('', '', '', '', 0, array()); } } @@ -9873,7 +10910,7 @@ if (!class_exists('TCPDF', false)) { $this->_out('/Usage <> /View <>>>>>'); $this->_out('endobj'); $this->_newobj(); - $this->n_ocg_view=$this->n; + $this->n_ocg_view = $this->n; $this->_out('<_textstring('view')); $this->_out('/Usage <> /View <>>>>>'); $this->_out('endobj'); @@ -11173,10 +12210,10 @@ if (!class_exists('TCPDF', false)) { */ protected function getHtmlDomArray($html) { // remove all unsupported tags (the line below lists all supported tags) - $html = strip_tags($html, '



  • diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index c3ea788..b97560e 100644 --- a/doc/li_com-tecnick-tcpdf.html +++ b/doc/li_com-tecnick-tcpdf.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

    - Documentation generated on Wed, 02 Sep 2009 15:28:41 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    @@ -19440,7 +19966,7 @@ $font)
    -

    method _putviewerpreferences [line 6479]

    +

    method _putviewerpreferences [line 6771]

    diff --git a/doc/index.html b/doc/index.html index c3ea788..b97560e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

    - Documentation generated on Wed, 02 Sep 2009 15:28:41 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/errors.html b/doc/errors.html index edc009d..2ce9814 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

    - Documentation generated on Wed, 02 Sep 2009 15:28:48 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:33 +0200 by phpDocumentor 1.4.1
    @@ -19471,7 +19997,7 @@ $font)
    -

    method _putxobjectdict [line 6303]

    +

    method _putxobjectdict [line 6576]

    diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index f4bf363..f263d3a 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -238,6 +238,8 @@
    in file tcpdf.php, method TCPDF::addHtmlLink()
        Output anchor link.
    addHTMLVertSpace
    in file tcpdf.php, method TCPDF::addHTMLVertSpace()
        Add vertical spaces if needed.
    +
    addJavascriptObject
    +
    in file tcpdf.php, method TCPDF::addJavascriptObject()
    AddLink
    in file tcpdf.php, method TCPDF::AddLink()
        Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
    The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().
    AddPage
    @@ -394,6 +396,8 @@

    d

    +
    $default_form_prop
    +
    in file tcpdf.php, variable TCPDF::$default_form_prop
    $default_monospaced_font
    in file tcpdf.php, variable TCPDF::$default_monospaced_font
        Default monospaced font
    $default_table_columns
    @@ -490,6 +494,14 @@
    in file tcpdf.php, variable TCPDF::$footer_font
    $footer_margin
    in file tcpdf.php, variable TCPDF::$footer_margin
    +
    $form_action
    +
    in file tcpdf.php, variable TCPDF::$form_action
        Current form action (used during XHTML rendering)
    +
    $form_enctype
    +
    in file tcpdf.php, variable TCPDF::$form_enctype
        Current form encryption type (used during XHTML rendering)
    +
    $form_mode
    +
    in file tcpdf.php, variable TCPDF::$form_mode
        Current method to submit forms.
    +
    $form_obj_id
    +
    in file tcpdf.php, variable TCPDF::$form_obj_id
        Array of form annotations IDs
    $fwPt
    in file tcpdf.php, variable TCPDF::$fwPt
    Footer
    @@ -514,6 +526,8 @@
    in file tcpdf.php, method TCPDF::getAliasNbPages()
        Returns the string alias used for the total number of pages.
    getAliasNumPage
    in file tcpdf.php, method TCPDF::getAliasNumPage()
        Returns the string alias used for the page number.
    +
    getAnnotOptFromJSProp
    +
    in file tcpdf.php, method TCPDF::getAnnotOptFromJSProp()
    GetArrStringWidth
    in file tcpdf.php, method TCPDF::GetArrStringWidth()
        Returns the string length of an array of chars in user unit. A font must be selected.
    getBarcode
    @@ -548,6 +562,8 @@
    in file tcpdf.php, method TCPDF::getFooterFont()
        Get Footer font.
    getFooterMargin
    in file tcpdf.php, method TCPDF::getFooterMargin()
        Returns footer margin in user units.
    +
    getFormDefaultProp
    +
    in file tcpdf.php, method TCPDF::getFormDefaultProp()
    getGDgamma
    in file tcpdf.php, method TCPDF::getGDgamma()
        Correct the gamma value to be used with GD library
    getGraphicVars
    @@ -567,7 +583,7 @@
    getHTMLUnitToUnits
    in file tcpdf.php, method TCPDF::getHTMLUnitToUnits()
        convert html string containing value and unit of measure to user's units or points.
    getImageBuffer
    -
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get page buffer content.
    +
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get image buffer content.
    getImageRBX
    in file tcpdf.php, method TCPDF::getImageRBX()
        Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image
    getImageRBY
    @@ -716,6 +732,12 @@
    in file tcpdf.php, variable TCPDF::$javascript
        javascript code
    $jpeg_quality
    in file tcpdf.php, variable TCPDF::$jpeg_quality
        Set the default JPEG compression quality (1-100)
    +
    $js_objects
    +
    in file tcpdf.php, variable TCPDF::$js_objects
        Javascript objects array
    +
    $js_obj_id
    +
    in file tcpdf.php, variable TCPDF::$js_obj_id
        Current ID of javascript object
    +
    $js_start_obj_id
    +
    in file tcpdf.php, variable TCPDF::$js_start_obj_id
        Start ID for javascript objects
    top
    @@ -1077,9 +1099,9 @@
    SetAutoPageBreak
    in file tcpdf.php, method TCPDF::SetAutoPageBreak()
        Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
    setBarcode
    -
    in file tcpdf.php, method TCPDF::setBarcode()
        Set document barcode.
    -
    setBarcode
    in file barcodes.php, method TCPDFBarcode::setBarcode()
        Set the barcode.
    +
    setBarcode
    +
    in file tcpdf.php, method TCPDF::setBarcode()
        Set document barcode.
    SetBooklet
    in file tcpdf.php, method TCPDF::SetBooklet()
        Set the booklet mode for double-sided pages.
    setBuffer
    @@ -1128,6 +1150,8 @@
    in file tcpdf.php, method TCPDF::setFooterFont()
        Set footer font.
    setFooterMargin
    in file tcpdf.php, method TCPDF::setFooterMargin()
        Set footer margin.
    +
    setFormDefaultProp
    +
    in file tcpdf.php, method TCPDF::setFormDefaultProp()
    setGraphicVars
    in file tcpdf.php, method TCPDF::setGraphicVars()
        Set graphic variables.
    setHeader
    @@ -1415,7 +1439,7 @@ top

    - Documentation generated on Wed, 02 Sep 2009 15:28:41 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/elementindex.html b/doc/elementindex.html index c65dc5e..e489471 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -85,6 +85,8 @@
    in file tcpdf.php, method TCPDF::addHtmlLink()
        Output anchor link.
    addHTMLVertSpace
    in file tcpdf.php, method TCPDF::addHTMLVertSpace()
        Add vertical spaces if needed.
    +
    addJavascriptObject
    +
    in file tcpdf.php, method TCPDF::addJavascriptObject()
    AddLink
    in file tcpdf.php, method TCPDF::AddLink()
        Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
    The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().
    AddPage
    @@ -241,6 +243,8 @@

    d

    +
    $default_form_prop
    +
    in file tcpdf.php, variable TCPDF::$default_form_prop
    $default_monospaced_font
    in file tcpdf.php, variable TCPDF::$default_monospaced_font
        Default monospaced font
    $default_table_columns
    @@ -337,6 +341,14 @@
    in file tcpdf.php, variable TCPDF::$footer_font
    $footer_margin
    in file tcpdf.php, variable TCPDF::$footer_margin
    +
    $form_action
    +
    in file tcpdf.php, variable TCPDF::$form_action
        Current form action (used during XHTML rendering)
    +
    $form_enctype
    +
    in file tcpdf.php, variable TCPDF::$form_enctype
        Current form encryption type (used during XHTML rendering)
    +
    $form_mode
    +
    in file tcpdf.php, variable TCPDF::$form_mode
        Current method to submit forms.
    +
    $form_obj_id
    +
    in file tcpdf.php, variable TCPDF::$form_obj_id
        Array of form annotations IDs
    $fwPt
    in file tcpdf.php, variable TCPDF::$fwPt
    Footer
    @@ -361,6 +373,8 @@
    in file tcpdf.php, method TCPDF::getAliasNbPages()
        Returns the string alias used for the total number of pages.
    getAliasNumPage
    in file tcpdf.php, method TCPDF::getAliasNumPage()
        Returns the string alias used for the page number.
    +
    getAnnotOptFromJSProp
    +
    in file tcpdf.php, method TCPDF::getAnnotOptFromJSProp()
    GetArrStringWidth
    in file tcpdf.php, method TCPDF::GetArrStringWidth()
        Returns the string length of an array of chars in user unit. A font must be selected.
    getBarcode
    @@ -395,6 +409,8 @@
    in file tcpdf.php, method TCPDF::getFooterFont()
        Get Footer font.
    getFooterMargin
    in file tcpdf.php, method TCPDF::getFooterMargin()
        Returns footer margin in user units.
    +
    getFormDefaultProp
    +
    in file tcpdf.php, method TCPDF::getFormDefaultProp()
    getGDgamma
    in file tcpdf.php, method TCPDF::getGDgamma()
        Correct the gamma value to be used with GD library
    getGraphicVars
    @@ -414,7 +430,7 @@
    getHTMLUnitToUnits
    in file tcpdf.php, method TCPDF::getHTMLUnitToUnits()
        convert html string containing value and unit of measure to user's units or points.
    getImageBuffer
    -
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get page buffer content.
    +
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get image buffer content.
    getImageRBX
    in file tcpdf.php, method TCPDF::getImageRBX()
        Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image
    getImageRBY
    @@ -563,6 +579,12 @@
    in file tcpdf.php, variable TCPDF::$javascript
        javascript code
    $jpeg_quality
    in file tcpdf.php, variable TCPDF::$jpeg_quality
        Set the default JPEG compression quality (1-100)
    +
    $js_objects
    +
    in file tcpdf.php, variable TCPDF::$js_objects
        Javascript objects array
    +
    $js_obj_id
    +
    in file tcpdf.php, variable TCPDF::$js_obj_id
        Current ID of javascript object
    +
    $js_start_obj_id
    +
    in file tcpdf.php, variable TCPDF::$js_start_obj_id
        Start ID for javascript objects
    top
    @@ -924,9 +946,9 @@
    SetAutoPageBreak
    in file tcpdf.php, method TCPDF::SetAutoPageBreak()
        Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
    setBarcode
    -
    in file tcpdf.php, method TCPDF::setBarcode()
        Set document barcode.
    -
    setBarcode
    in file barcodes.php, method TCPDFBarcode::setBarcode()
        Set the barcode.
    +
    setBarcode
    +
    in file tcpdf.php, method TCPDF::setBarcode()
        Set document barcode.
    SetBooklet
    in file tcpdf.php, method TCPDF::SetBooklet()
        Set the booklet mode for double-sided pages.
    setBuffer
    @@ -975,6 +997,8 @@
    in file tcpdf.php, method TCPDF::setFooterFont()
        Set footer font.
    setFooterMargin
    in file tcpdf.php, method TCPDF::setFooterMargin()
        Set footer margin.
    +
    setFormDefaultProp
    +
    in file tcpdf.php, method TCPDF::setFormDefaultProp()
    setGraphicVars
    in file tcpdf.php, method TCPDF::setGraphicVars()
        Set graphic variables.
    setHeader
    @@ -1392,7 +1416,7 @@ top

    - Documentation generated on Wed, 02 Sep 2009 15:28:41 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    @@ -19496,7 +20022,7 @@ $font)
    -

    method _RC4 [line 7314]

    +

    method _RC4 [line 7617]

    diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index 255bdaf..7dfcf8f 100644 --- a/doc/com-tecnick-tcpdf/_unicode_data.php.html +++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html @@ -237,7 +237,7 @@ Unicode Include file for TCPDF.




    - Documentation generated on Wed, 02 Sep 2009 15:28:48 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:33 +0200 by phpDocumentor 1.4.1
    @@ -19547,7 +20073,7 @@ $text)
    -

    method _textstring [line 6810]

    +

    method _textstring [line 7109]

    diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index a23269d..c5e892a 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -65,7 +65,7 @@ Source Location: /tcpdf.php



    Page Details:

    -This is a PHP class for generating PDF documents without requiring external extensions.


    TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
    <h3>TCPDF main features are:</h3>

    • no external libraries are required for the basic functions;
    • supports all ISO page formats;
    • supports custom page formats, margins and units of measure;
    • supports UTF-8 Unicode and Right-To-Left languages;
    • supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
    • supports document encryption;
    • includes methods to publish some XHTML code;
    • includes graphic (geometric) and transformation methods;
    • includes Javascript and forms support;
    • includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;
    • includes methods to set Bookmarks and print a Table of Content;
    • includes methods to move and delete pages;
    • includes methods for automatic page header and footer management;
    • supports automatic page break;
    • supports automatic page numbering and page groups;
    • supports automatic line break and text justification;
    • supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)
    • supports stroke and clipping mode for text;
    • supports clipping masks;
    • supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;
    • supports several annotations, including links, text and file attachments;
    • supports page compression (requires zlib extension);
    • supports text hyphenation.
    • supports transactions to UNDO commands.
    • supports signature certifications.
    Tools to encode your unicode fonts are on fonts/utils directory.</p>




    +This is a PHP class for generating PDF documents without requiring external extensions.


    TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
    <h3>TCPDF main features are:</h3>

    • no external libraries are required for the basic functions;
    • supports all ISO page formats;
    • supports custom page formats, margins and units of measure;
    • supports UTF-8 Unicode and Right-To-Left languages;
    • supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
    • supports document encryption;
    • includes methods to publish some XHTML code, including forms;
    • includes graphic (geometric) and transformation methods;
    • includes Javascript and Forms support;
    • includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;
    • includes methods to set Bookmarks and print a Table of Content;
    • includes methods to move and delete pages;
    • includes methods for automatic page header and footer management;
    • supports automatic page break;
    • supports automatic page numbering and page groups;
    • supports automatic line break and text justification;
    • supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)
    • supports stroke and clipping mode for text;
    • supports clipping masks;
    • supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;
    • supports several annotations, including links, text and file attachments;
    • supports page compression (requires zlib extension);
    • supports text hyphenation.
    • supports transactions to UNDO commands.
    • supports signature certifications.
    Tools to encode your unicode fonts are on fonts/utils directory.</p>




    Tags:

    diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index f0c63f7..dc68679 100644 --- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html +++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html @@ -88,7 +88,7 @@ Array of WEB safe colors.




    - Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:27 +0200 by phpDocumentor 1.4.1
    @@ -19586,7 +20112,7 @@ $s)
    -

    method _toJPEG [line 4733]

    +

    method _toJPEG [line 4808]

    diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index 18cab59..891cc80 100644 --- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html +++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html @@ -507,7 +507,7 @@ Configuration file for TCPDF.




    - Documentation generated on Wed, 02 Sep 2009 15:28:47 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:33 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html index ab290d0..654bf8c 100644 --- a/doc/com-tecnick-tcpdf/_barcodes.php.html +++ b/doc/com-tecnick-tcpdf/_barcodes.php.html @@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit

    - Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    @@ -19628,7 +20154,7 @@ $file)
    -

    method _Uvalue [line 7380]

    +

    method _Uvalue [line 7683]

    diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index 420f321..8369f47 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1368,7 +1368,7 @@ $type)

    - Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:26 +0200 by phpDocumentor 1.4.1
    @@ -19665,7 +20191,7 @@ $file)

    - Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:27 +0200 by phpDocumentor 1.4.1
    @@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte - + @@ -104,7 +104,7 @@ unicode data

    author:  Nicola Asuni
    version:  4.7.003version:  4.8.000
    copyright:  2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
    - PDF_PRODUCER = 'TCPDF 4.7.003 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 4.8.000 (http://www.tcpdf.org)'
    @@ -115,7 +115,7 @@ unicode data


    - Documentation generated on Wed, 02 Sep 2009 15:28:42 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 07 Sep 2009 23:53:27 +0200 by phpDocumentor 1.4.1
    ', $offset)) !== false) { + $html_a = substr($html, 0, $offset); + $html_b = substr($html, $offset, ($pos - $offset + 11)); + while (preg_match("']*)>(.*?)\n(.*?)'si", $html_b)) { + // preserve newlines on 'si", "\\2\\3", $html_b); + $html_b = preg_replace("']*)>(.*?)[\"](.*?)'si", "\\2''\\3", $html_b); + } + $html = $html_a.$html_b.substr($html, $pos + 11); + $offset = strlen($html_a.$html_b); + } + $html = preg_replace("'([\s]*)([\s]*)'si", "", $html); + $offset = 0; + while (($offset < strlen($html)) AND ($pos = strpos($html, '', $offset)) !== false) { + $html_a = substr($html, 0, $offset); + $html_b = substr($html, $offset, ($pos - $offset + 9)); + while (preg_match("']*)>(.*?)'si", $html_b)) { + $html_b = preg_replace("']*)>(.*?)'si", "\\2\t\\4\r", $html_b); + $html_b = preg_replace("']*)>(.*?)'si", "\\2\r", $html_b); + } + $html = $html_a.$html_b.substr($html, $pos + 9); + $offset = strlen($html_a.$html_b); + } + $html = preg_replace("']*)>'si", "'si", "\" />", $html); $html = str_replace("\n", ' ', $html); + // restore textarea newlines + $html = str_replace('', "\n", $html); // remove extra spaces from code $html = preg_replace('/[\s]+<\/(table|tr|td|th|ul|ol|li)>/', '', $html); $html = preg_replace('/[\s]+<(tr|td|th|ul|ol|li|br)/', '<\\1', $html); @@ -11201,6 +12267,8 @@ if (!class_exists('TCPDF', false)) { $html = preg_replace('/]*)>/xi', '', $html); $html = preg_replace('/]*)>/xi', '', $html); // trim string $html = preg_replace('/^[\s]+/', '', $html); $html = preg_replace('/[\s]+$/', '', $html); @@ -12726,6 +13794,213 @@ if (!class_exists('TCPDF', false)) { $this->addHTMLVertSpace(1, $cell, ($tag['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], false); break; } + // Form fields (since 4.8.000 - 2009-09-07) + case 'form': { + if (isset($tag['attribute']['action'])) { + $this->form_action = $tag['attribute']['action']; + } else { + $this->form_action = K_PATH_URL.$_SERVER['SCRIPT_NAME']; + } + if (isset($tag['attribute']['enctype'])) { + $this->form_enctype = $tag['attribute']['enctype']; + } else { + $this->form_enctype = 'application/x-www-form-urlencoded'; + } + if (isset($tag['attribute']['method'])) { + $this->form_mode = $tag['attribute']['method']; + } else { + $this->form_mode = 'post'; + } + break; + } + case 'input': { + if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) { + $value = $tag['attribute']['value']; + } + if (isset($tag['attribute']['maxlength']) AND !$this->empty_string($tag['attribute']['maxlength'])) { + $opt['maxlen'] = intval($tag['attribute']['value']); + } + $h = $this->FontSize * $this->cell_height_ratio; + if (isset($tag['attribute']['size']) AND !$this->empty_string($tag['attribute']['size'])) { + $w = intval($tag['attribute']['size']) * $this->GetStringWidth(chr(32)) * 2; + } else { + $w = $h; + } + if (isset($tag['attribute']['checked']) AND (($tag['attribute']['checked'] == 'checked') OR ($tag['attribute']['checked'] == 'true'))) { + $checked = true; + } else { + $checked = false; + } + switch ($tag['attribute']['type']) { + case 'text': { + if (isset($value)) { + $opt['v'] = $value; + } + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'password': { + if (isset($value)) { + $opt['v'] = $value; + } + $prop['password'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'checkbox': { + $this->CheckBox($name, $w, $checked, $prop, $opt, $value, '', '', false); + break; + } + case 'radio': { + $this->RadioButton($name, $w, $prop, $opt, $value, '', '', false); + break; + } + case 'submit': { + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $action = array(); + $action['S'] = 'SubmitForm'; + $action['F'] = $this->form_action; + if ($this->form_enctype != 'FDF') { + $action['Flags'] = array('ExportFormat'); + } + if ($this->form_mode == 'get') { + $action['Flags'] = array('GetMethod'); + } + $this->Button($name, $w, $h, $value, $action, $prop, $opt, '', '', false); + break; + } + case 'reset': { + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $this->Button($name, $w, $h, $value, array('S'=>'ResetForm'), $prop, $opt, '', '', false); + break; + } + case 'file': { + $prop['fileSelect'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + if (!isset($value)) { + $value = '*'; + } + $w = $this->GetStringWidth($value) * 2; + $h *= 1.2; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $jsaction = 'var f=this.getField(\''.$name.'\'); f.browseForFileToSubmit();'; + $this->Button('FB_'.$name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + case 'hidden': { + if (isset($value)) { + $opt['v'] = $value; + } + $opt['f'] = array('invisible', 'hidden'); + $this->TextField($name, 0, 0, $prop, $opt, '', '', false); + break; + } + case 'image': { + // THIS TYPE MUST BE FIXED + if (isset($tag['attribute']['src']) AND !$this->empty_string($tag['attribute']['src'])) { + $img = $tag['attribute']['src']; + } else { + break; + } + $value = 'img'; + //$opt['mk'] = array('i'=>$img, 'tp'=>1, 'if'=>array('sw'=>'A', 's'=>'A', 'fb'=>false)); + if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { + $jsaction = $tag['attribute']['onclick']; + } else { + $jsaction = ''; + } + $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + case 'button': { + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { + $jsaction = $tag['attribute']['onclick']; + } else { + $jsaction = ''; + } + $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + } + break; + } + case 'textarea': { + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) { + $opt['v'] = $tag['attribute']['value']; + } + if (isset($tag['attribute']['cols']) AND !$this->empty_string($tag['attribute']['cols'])) { + $w = intval($tag['attribute']['cols']) * $this->GetStringWidth(chr(32)) * 2; + } else { + $w = 40; + } + if (isset($tag['attribute']['rows']) AND !$this->empty_string($tag['attribute']['rows'])) { + $h = intval($tag['attribute']['rows']) * $this->FontSize * $this->cell_height_ratio; + } else { + $h = 10; + } + $prop['multiline'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'select': { + $h = $this->FontSize * $this->cell_height_ratio; + if (isset($tag['attribute']['size']) AND !$this->empty_string($tag['attribute']['size'])) { + $h *= ($tag['attribute']['size'] + 1); + } + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + $w = 0; + if (isset($tag['attribute']['opt']) AND !$this->empty_string($tag['attribute']['opt'])) { + $options = explode ("\r", $tag['attribute']['opt']); + $values = array(); + foreach ($options as $val) { + if (strpos($val, "\t") !== false) { + $opt = explode("\t", $val); + $values[] = $opt; + $w = max($w, $this->GetStringWidth($opt[1])); + } else { + $values[] = $val; + $w = max($w, $this->GetStringWidth($val)); + } + } + } else { + break; + } + $w *= 2; + if (isset($tag['attribute']['multiple']) AND ($tag['attribute']['multiple']='multiple')) { + $prop['multipleSelection'] = 'true'; + $this->ListBox($name, $w, $h, $values, $prop, $opt, '', '', false); + } else { + $this->ComboBox($name, $w, $h, $values, $prop, $opt, '', '', false); + } + break; + } case 'tcpdf': { // NOT HTML: used to call TCPDF methods if (isset($tag['attribute']['method'])) { @@ -13068,6 +14343,12 @@ if (!class_exists('TCPDF', false)) { $this->addHTMLVertSpace(1, $cell, ($parent['fontsize'] * 1.5) / $this->k, $firstorlast, $tag['value'], true); break; } + // Form fields (since 4.8.000 - 2009-09-07) + case 'form': { + $this->form_action = ''; + $this->form_enctype = 'application/x-www-form-urlencoded'; + break; + } default : { break; } @@ -13749,7 +15030,7 @@ if (!class_exists('TCPDF', false)) { } /** - * Get page buffer content. + * Get image buffer content. * @param string $image image key * @return string image buffer content or false in case of error * @access protected