From 4925c5bbe055f6ef956003ad45033c3e845d7b7e Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Thu, 16 Apr 2009 17:53:29 +0200 Subject: [PATCH] 4.6.000 --- CHANGELOG.TXT | 11 +- README.TXT | 4 +- doc/classtrees_com-tecnick-tcpdf.html | 2 +- doc/com-tecnick-tcpdf/TCPDF.html | 595 ++++++++++-------- doc/com-tecnick-tcpdf/TCPDFBarcode.html | 2 +- doc/com-tecnick-tcpdf/_barcodes.php.html | 2 +- .../_config---tcpdf_config.php.html | 2 +- doc/com-tecnick-tcpdf/_htmlcolors.php.html | 2 +- doc/com-tecnick-tcpdf/_tcpdf.php.html | 6 +- doc/com-tecnick-tcpdf/_unicode_data.php.html | 2 +- doc/elementindex.html | 4 +- doc/elementindex_com-tecnick-tcpdf.html | 4 +- doc/errors.html | 2 +- doc/index.html | 2 +- doc/li_com-tecnick-tcpdf.html | 2 +- examples/example_005.php | 14 +- examples/example_007.php | 6 +- examples/example_010.php | 4 +- examples/example_017.php | 6 +- examples/example_019.php | 4 +- examples/example_020.php | 4 +- examples/example_021.php | 2 +- examples/example_033.php | 8 +- examples/example_042.php | 4 +- examples/example_043.php | 4 +- tcpdf.php | 323 +++++----- 26 files changed, 559 insertions(+), 462 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index a37fd52..8c9b9c3 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,12 @@ +4.6.000 (2009-04-16) + - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods: + zero coordinates for $x and $y are now valid coordinates; + set $x and $y as empty strings to get the current value. + - Some error caused by 'empty' funtion were fixed. + - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false. + - HTML on footer bug was fixed. + - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43. + 4.5.043 (2009-04-15) - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27): C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9 @@ -24,7 +33,7 @@ PLANET : PLANET RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) KIX : KIX (Klant index - Customer index) - IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 + IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 (NOTE: requires BCMath PHP extension) CODABAR : CODABAR CODE11 : CODE 11 PHARMA : PHARMACODE diff --git a/README.TXT b/README.TXT index efb03a4..9a9d0a0 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 4.5.043 -Release date: 2009-04-15 +Version: 4.6.000 +Release date: 2009-04-16 Author: Nicola Asuni Copyright (c) 2001-2009: diff --git a/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index b973b64..77ba381 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -45,7 +45,7 @@

- Documentation generated on Wed, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index 2fe8c93..587d0dd 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -74,7 +74,7 @@ Source Location: /tcpdf.php

Version:

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

  • CoonsPatchMesh
  • Curve
  • Ellipse
  • +
  • empty_string
  • endPage
  • Error
  • Footer
  • @@ -580,7 +581,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  4.5.043 + version:  4.6.000 link:  http://www.tcpdf.org @@ -656,7 +657,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    [ Top ]

    -

    $author =

    +

    $author =  ''

    [line 484]



    Tags:

    @@ -1112,7 +1113,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    [ Top ]

    -

    $creator =

    +

    $creator =  ''

    [line 496]



    Tags:

    @@ -2849,7 +2850,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    [ Top ]

    -

    $keywords =

    +

    $keywords =  ''

    [line 490]



    Tags:

    @@ -4427,7 +4428,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    [ Top ]

    -

    $subject =

    +

    $subject =  ''

    [line 478]



    Tags:

    @@ -4586,7 +4587,7 @@ This is a PHP class for generating PDF documents without requiring external exte
    [ Top ]

    -

    $title =

    +

    $title =  ''

    [line 472]



    Tags:

    @@ -5203,7 +5204,7 @@ $diskcache = false])
    -

    method AcceptPageBreak [line 3252]

    +

    method AcceptPageBreak [line 3255]

    @@ -5234,7 +5235,7 @@ $diskcache = false])
    -

    method addExtGState [line 9344]

    +

    method addExtGState [line 9358]

    @@ -5270,7 +5271,7 @@ $parms)
    -

    method AddFont [line 2850]

    +

    method AddFont [line 2853]

    @@ -5327,7 +5328,7 @@ $fontfile = ''])
    -

    method addHtmlLink [line 6746]

    +

    method addHtmlLink [line 6762]

    @@ -5396,7 +5397,7 @@ $style = -1])
    -

    method addHTMLVertSpace [line 12453]

    +

    method addHTMLVertSpace [line 12477]

    @@ -5462,7 +5463,7 @@ $closing = false])
    -

    method AddLink [line 3072]

    +

    method AddLink [line 3075]

    @@ -5493,7 +5494,7 @@ $closing = false])
    -

    method AddPage [line 2093]

    +

    method AddPage [line 2096]

    @@ -5541,7 +5542,7 @@ $format = ''])
    -

    method AddSpotColor [line 2483]

    +

    method AddSpotColor [line 2486]

    @@ -5607,7 +5608,7 @@ $k)
    -

    method addTOC [line 13335]

    +

    method addTOC [line 13359]

    @@ -5661,7 +5662,7 @@ $filler = '.'])
    -

    method AliasNbPages [line 9152]

    +

    method AliasNbPages [line 9166]

    @@ -5703,7 +5704,7 @@ $alias = '{nb}'])
    -

    method AliasNumPage [line 9179]

    +

    method AliasNumPage [line 9193]

    @@ -5745,7 +5746,7 @@ $alias = '{pnb}'])
    -

    method Annotation [line 3128]

    +

    method Annotation [line 3131]

    @@ -5820,7 +5821,7 @@ $spaces = 0])
    -

    method arrUTF8ToUTF16BE [line 6648]

    +

    method arrUTF8ToUTF16BE [line 6664]

    @@ -5895,7 +5896,7 @@ $setbom = true])
    -

    method Bookmark [line 8755]

    +

    method Bookmark [line 8769]

    @@ -5949,7 +5950,7 @@ $page = ''])
    -

    method Button [line 9037]

    +

    method Button [line 9051]

    @@ -6015,7 +6016,7 @@ $prop = array()])
    -

    method Cell [line 3306]

    +

    method Cell [line 3309]

    @@ -6111,7 +6112,7 @@ $ignore_min_height = false])
    -

    method CheckBox [line 9017]

    +

    method CheckBox [line 9031]

    @@ -6165,7 +6166,7 @@ $prop = array()])
    -

    method checkPageBreak [line 3263]

    +

    method checkPageBreak [line 3266]

    @@ -6207,7 +6208,7 @@ $h)
    -

    method Circle [line 7861]

    +

    method Circle [line 7875]

    @@ -6306,7 +6307,7 @@ $afinish:)
    -

    method Clip [line 9607]

    +

    method Clip [line 9621]

    @@ -6397,7 +6398,7 @@ $h)
    -

    method closeHTMLTagHandler [line 12131]

    +

    method closeHTMLTagHandler [line 12153]

    @@ -6451,7 +6452,7 @@ $dom)
    -

    method ComboBox [line 8998]

    +

    method ComboBox [line 9012]

    @@ -6511,7 +6512,7 @@ $prop = array()])
    -

    method commitTransaction [line 13492]

    +

    method commitTransaction [line 13516]

    @@ -6539,13 +6540,13 @@ $prop = array()])
    -

    method convertHTMLColorToDec [line 6779]

    +

    method convertHTMLColorToDec [line 6795]

    array convertHTMLColorToDec( [string -$color = '#000000']) +$color = '#FFFFFF'])

    @@ -6553,6 +6554,9 @@ $color = '#000000'])

    Tags:

    + + + @@ -6575,7 +6579,7 @@ $color = '#000000'])
    -

    method CoonsPatchMesh [line 9527]

    +

    method CoonsPatchMesh [line 9541]

    return:  RGB color or false in case of error.
    access:  public
    @@ -6677,7 +6681,7 @@ $coords_max = 1])
    -

    method Curve [line 7636]

    +

    method Curve [line 7650]

    @@ -6779,7 +6783,7 @@ $fill_color = array()])
    -

    method Ellipse [line 7757]

    +

    method Ellipse [line 7771]

    @@ -6894,9 +6898,51 @@ $afinish:)
    [ Top ]
    +
    + +

    method empty_string [line 13562]

    +
    +
    +
    + boolean empty_string( +srting +$str) +
    +

    + + Determine whether a string is empty.



    +

    Tags:

    +
    + + + + + + + + + + +
    return:  true if string is empty
    since:  4.5.044 (2009-04-16)
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + +
    srting  $str  string to be checked
    +

    +
    [ Top ]
    +

    -

    method endPage [line 2112]

    +

    method endPage [line 2115]

    @@ -6966,7 +7012,7 @@ $msg)
    -

    method Footer [line 2333]

    +

    method Footer [line 2336]

    @@ -6991,7 +7037,7 @@ $msg)
    -

    method formatPageNumber [line 9256]

    +

    method formatPageNumber [line 9270]

    @@ -7030,7 +7076,7 @@ $num)
    -

    method formatTOCPageNumber [line 9268]

    +

    method formatTOCPageNumber [line 9282]

    @@ -7072,7 +7118,7 @@ $num)
    -

    method GetAbsX [line 4783]

    +

    method GetAbsX [line 4796]

    @@ -7103,7 +7149,7 @@ $num)
    -

    method getAliasNbPages [line 9164]

    +

    method getAliasNbPages [line 9178]

    @@ -7134,7 +7180,7 @@ $num)
    -

    method getAliasNumPage [line 9192]

    +

    method getAliasNumPage [line 9206]

    @@ -7165,7 +7211,7 @@ $num)
    -

    method GetArrStringWidth [line 2762]

    +

    method GetArrStringWidth [line 2765]

    @@ -7234,7 +7280,7 @@ $arr)
    -

    method getBarcode [line 10075]

    +

    method getBarcode [line 10089]

    @@ -7262,7 +7308,7 @@ $arr)
    -

    method getBorderMode [line 3749]

    +

    method getBorderMode [line 3754]

    @@ -7358,7 +7404,7 @@ $pagenum = ''])
    -

    method getBuffer [line 13018]

    +

    method getBuffer [line 13042]

    @@ -7389,7 +7435,7 @@ $pagenum = ''])
    -

    method getCellCode [line 3358]

    +

    method getCellCode [line 3361]

    @@ -7485,7 +7531,7 @@ $ignore_min_height = false])
    -

    method getCellHeightRatio [line 9430]

    +

    method getCellHeightRatio [line 9444]

    @@ -7510,7 +7556,7 @@ $ignore_min_height = false])
    -

    method GetCharWidth [line 2789]

    +

    method GetCharWidth [line 2792]

    @@ -7555,7 +7601,7 @@ $char)
    -

    method getFontBuffer [line 13178]

    +

    method getFontBuffer [line 13202]

    @@ -7597,7 +7643,7 @@ $font)
    -

    method getFontFamily [line 10551]

    +

    method getFontFamily [line 10565]

    @@ -7628,7 +7674,7 @@ $font)
    -

    method getFontSize [line 10531]

    +

    method getFontSize [line 10545]

    @@ -7659,7 +7705,7 @@ $font)
    -

    method getFontSizePt [line 10541]

    +

    method getFontSizePt [line 10555]

    @@ -7690,7 +7736,7 @@ $font)
    -

    method getFontsList [line 2828]

    +

    method getFontsList [line 2831]

    @@ -7718,7 +7764,7 @@ $font)
    -

    method getFontStyle [line 10561]

    +

    method getFontStyle [line 10575]

    @@ -7749,7 +7795,7 @@ $font)
    -

    method getFooterFont [line 6709]

    +

    method getFooterFont [line 6725]

    @@ -7777,7 +7823,7 @@ $font)
    -

    method getFooterMargin [line 2247]

    +

    method getFooterMargin [line 2250]

    @@ -7805,7 +7851,7 @@ $font)
    -

    method getGDgamma [line 4726]

    +

    method getGDgamma [line 4739]

    @@ -7844,7 +7890,7 @@ $v)
    -

    method getGraphicVars [line 12886]

    +

    method getGraphicVars [line 12910]

    @@ -7875,7 +7921,7 @@ $v)
    -

    method getGroupPageNo [line 9205]

    +

    method getGroupPageNo [line 9219]

    @@ -7900,7 +7946,7 @@ $v)
    -

    method getGroupPageNoFormatted [line 9215]

    +

    method getGroupPageNoFormatted [line 9229]

    @@ -7931,7 +7977,7 @@ $v)
    -

    method getHeaderData [line 2202]

    +

    method getHeaderData [line 2205]

    @@ -7959,7 +8005,7 @@ $v)
    -

    method getHeaderFont [line 6689]

    +

    method getHeaderFont [line 6705]

    @@ -7987,7 +8033,7 @@ $v)
    -

    method getHeaderMargin [line 2227]

    +

    method getHeaderMargin [line 2230]

    @@ -8015,7 +8061,7 @@ $v)
    -

    method getHtmlDomArray [line 10597]

    +

    method getHtmlDomArray [line 10611]

    @@ -8054,7 +8100,7 @@ $html)
    -

    method getHTMLUnitToUnits [line 12608]

    +

    method getHTMLUnitToUnits [line 12632]

    @@ -8120,7 +8166,7 @@ $point)
    -

    method getImageBuffer [line 13120]

    +

    method getImageBuffer [line 13144]

    @@ -8162,7 +8208,7 @@ $image)
    -

    method getImageRBX [line 2273]

    +

    method getImageRBX [line 2276]

    @@ -8187,7 +8233,7 @@ $image)
    -

    method getImageRBY [line 2282]

    +

    method getImageRBY [line 2285]

    @@ -8277,7 +8323,7 @@ $image)
    -

    method GetLineWidth [line 7353]

    +

    method GetLineWidth [line 7367]

    @@ -8311,7 +8357,7 @@ $image)
    -

    method getMargins [line 10494]

    +

    method getMargins [line 10508]

    @@ -8342,7 +8388,7 @@ $image)
    -

    method GetNumChars [line 2816]

    +

    method GetNumChars [line 2819]

    @@ -8384,7 +8430,7 @@ $s)
    -

    method getNumLines [line 3828]

    +

    method getNumLines [line 3833]

    @@ -8432,7 +8478,7 @@ $w = 0])
    -

    method getNumPages [line 2080]

    +

    method getNumPages [line 2083]

    @@ -8466,7 +8512,7 @@ $w = 0])
    -

    method getObjFilename [line 12950]

    +

    method getObjFilename [line 12974]

    @@ -8511,7 +8557,7 @@ $prefix)
    -

    method getOriginalMargins [line 10517]

    +

    method getOriginalMargins [line 10531]

    @@ -8542,7 +8588,7 @@ $prefix)
    -

    method getPage [line 2068]

    +

    method getPage [line 2071]

    @@ -8576,7 +8622,7 @@ $prefix)
    -

    method getPageBuffer [line 13061]

    +

    method getPageBuffer [line 13085]

    @@ -8663,7 +8709,7 @@ $pagenum = ''])
    -

    method getPageGroupAlias [line 9227]

    +

    method getPageGroupAlias [line 9241]

    @@ -8736,7 +8782,7 @@ $pagenum = ''])
    -

    method getPageNumGroupAlias [line 9242]

    +

    method getPageNumGroupAlias [line 9256]

    @@ -8809,7 +8855,7 @@ $pagenum = ''])
    -

    method getPDFData [line 6728]

    +

    method getPDFData [line 6744]

    @@ -8834,7 +8880,7 @@ $pagenum = ''])
    -

    method getRemainingWidth [line 4181]

    +

    method getRemainingWidth [line 4190]

    @@ -8924,7 +8970,7 @@ $pagenum = ''])
    -

    method GetStringWidth [line 2747]

    +

    method GetStringWidth [line 2750]

    @@ -8987,7 +9033,7 @@ $fontsize = 0])
    -

    method GetX [line 4767]

    +

    method GetX [line 4780]

    @@ -9018,7 +9064,7 @@ $fontsize = 0])
    -

    method GetY [line 4794]

    +

    method GetY [line 4807]

    @@ -9049,7 +9095,7 @@ $fontsize = 0])
    -

    method Gradient [line 9630]

    +

    method Gradient [line 9644]

    @@ -9109,7 +9155,7 @@ $coords)
    -

    method Header [line 2291]

    +

    method Header [line 2294]

    @@ -9134,7 +9180,7 @@ $coords)
    -

    method Image [line 4302]

    +

    method Image [line 4311]

    @@ -9254,7 +9300,7 @@ $border = 0])
    -

    method ImageEps [line 9802]

    +

    method ImageEps [line 9816]

    @@ -9350,7 +9396,7 @@ $border = 0])
    -

    method ImagePngAlpha [line 4682]

    +

    method ImagePngAlpha [line 4695]

    @@ -9455,7 +9501,7 @@ $palign = ''])
    -

    method IncludeJS [line 8847]

    +

    method IncludeJS [line 8861]

    @@ -9491,7 +9537,7 @@ $script)
    -

    method intToRoman [line 12679]

    +

    method intToRoman [line 12703]

    @@ -9533,7 +9579,7 @@ $number)
    -

    method lastPage [line 2057]

    +

    method lastPage [line 2060]

    @@ -9575,7 +9621,7 @@ $resetmargins = false])
    -

    method Line [line 7503]

    +

    method Line [line 7517]

    @@ -9641,7 +9687,7 @@ $style = array()])
    -

    method LinearGradient [line 9487]

    +

    method LinearGradient [line 9501]

    @@ -9719,7 +9765,7 @@ $coords = array(0,0,1,0)])
    -

    method Link [line 3111]

    +

    method Link [line 3114]

    @@ -9791,7 +9837,7 @@ $spaces = 0])
    -

    method ListBox [line 8975]

    +

    method ListBox [line 8989]

    @@ -9851,7 +9897,7 @@ $prop = array()])
    -

    method Ln [line 4739]

    +

    method Ln [line 4752]

    @@ -9899,7 +9945,7 @@ $cell = false])
    -

    method MirrorH [line 7127]

    +

    method MirrorH [line 7141]

    @@ -9941,7 +9987,7 @@ $x = ''])
    -

    method MirrorL [line 7163]

    +

    method MirrorL [line 7177]

    @@ -9995,7 +10041,7 @@ $y = ''])
    -

    method MirrorP [line 7150]

    +

    method MirrorP [line 7164]

    @@ -10043,7 +10089,7 @@ $y = ''])
    -

    method MirrorV [line 7138]

    +

    method MirrorV [line 7152]

    @@ -10085,7 +10131,7 @@ $y = ''])
    -

    method movePage [line 13196]

    +

    method movePage [line 13220]

    @@ -10133,7 +10179,7 @@ $topage)
    -

    method MultiCell [line 3593]

    +

    method MultiCell [line 3596]

    @@ -10259,7 +10305,7 @@ $maxh = 0])
    -

    method objclone [line 13527]

    +

    method objclone [line 13551]

    @@ -10332,7 +10378,7 @@ $object)
    -

    method openHTMLTagHandler [line 11815]

    +

    method openHTMLTagHandler [line 11835]

    @@ -10386,7 +10432,7 @@ $dom)
    -

    method Output [line 4886]

    +

    method Output [line 4899]

    @@ -10434,7 +10480,7 @@ $dest = 'I'])
    -

    method PageNo [line 2467]

    +

    method PageNo [line 2470]

    @@ -10468,7 +10514,7 @@ $dest = 'I'])
    -

    method PageNoFormatted [line 9278]

    +

    method PageNoFormatted [line 9292]

    @@ -10499,7 +10545,7 @@ $dest = 'I'])
    -

    method PieSector [line 9724]

    +

    method PieSector [line 9738]

    @@ -10601,7 +10647,7 @@ $o:)
    -

    method pixelsToUnits [line 6832]

    +

    method pixelsToUnits [line 6846]

    @@ -10640,7 +10686,7 @@ $px)
    -

    method Polycurve [line 7693]

    +

    method Polycurve [line 7707]

    @@ -10712,7 +10758,7 @@ $fill_color = array()])
    -

    method Polygon [line 7886]

    +

    method Polygon [line 7900]

    @@ -10769,7 +10815,7 @@ $fill_color = array()])
    -

    method putHtmlListBullet [line 12744]

    +

    method putHtmlListBullet [line 12768]

    @@ -10820,7 +10866,7 @@ $size = 10])
    -

    method RadialGradient [line 9505]

    +

    method RadialGradient [line 9519]

    @@ -10898,7 +10944,7 @@ $coords = array(0.5,0.5,0.5,0.5,1)])
    -

    method RadioButton [line 8957]

    +

    method RadioButton [line 8971]

    @@ -10946,7 +10992,7 @@ $prop = array()])
    -

    method readDiskCache [line 12990]

    +

    method readDiskCache [line 13014]

    @@ -10994,7 +11040,7 @@ $file)
    -

    method Rect [line 7538]

    +

    method Rect [line 7552]

    @@ -11072,7 +11118,7 @@ $fill_color = array()])
    -

    method RegularPolygon [line 7985]

    +

    method RegularPolygon [line 7999]

    @@ -11183,7 +11229,7 @@ $r:)
    -

    method removeSHY [line 3323]

    +

    method removeSHY [line 3326]

    @@ -11225,11 +11271,11 @@ $txt = ''])
    -

    method rfread [line 4655]

    +

    method rfread [line 4665]

    - void rfread( + Returns rfread( resource $handle, int $length) @@ -11240,6 +11286,9 @@ $length)

    Tags:

    + + + @@ -11273,7 +11322,7 @@ $length)
    -

    method rollbackTransaction [line 13505]

    +

    method rollbackTransaction [line 13529]

    return:  the read string or FALSE in case of error.
    author:  Nicola Asuni
    @@ -11312,7 +11361,7 @@ $action)
    -

    method Rotate [line 7222]

    +

    method Rotate [line 7236]

    @@ -11366,7 +11415,7 @@ $y = ''])
    -

    method RoundedRect [line 8089]

    +

    method RoundedRect [line 8103]

    @@ -11453,7 +11502,7 @@ $fill_color = array()])
    -

    method Scale [line 7092]

    +

    method Scale [line 7106]

    @@ -11513,7 +11562,7 @@ $y = ''])
    -

    method ScaleX [line 7052]

    +

    method ScaleX [line 7066]

    @@ -11567,7 +11616,7 @@ $y = ''])
    -

    method ScaleXY [line 7078]

    +

    method ScaleXY [line 7092]

    @@ -11621,7 +11670,7 @@ $y = ''])
    -

    method ScaleY [line 7065]

    +

    method ScaleY [line 7079]

    @@ -11675,7 +11724,7 @@ $y = ''])
    -

    method setAlpha [line 9387]

    +

    method setAlpha [line 9401]

    @@ -11807,7 +11856,7 @@ $margin = 0])
    -

    method setBarcode [line 10065]

    +

    method setBarcode [line 10079]

    @@ -11843,7 +11892,7 @@ $bc = ''])
    -

    method SetBooklet [line 12522]

    +

    method SetBooklet [line 12546]

    @@ -11894,7 +11943,7 @@ $outer = -1])
    -

    method setBuffer [line 13000]

    +

    method setBuffer [line 13024]

    @@ -11933,7 +11982,7 @@ $data)
    -

    method setCellHeightRatio [line 9421]

    +

    method setCellHeightRatio [line 9435]

    @@ -12092,7 +12141,7 @@ $creator)
    -

    method SetDefaultMonospacedFont [line 3061]

    +

    method SetDefaultMonospacedFont [line 3064]

    @@ -12131,7 +12180,7 @@ $font)
    -

    method setDefaultTableColumns [line 9411]

    +

    method setDefaultTableColumns [line 9425]

    @@ -12218,7 +12267,7 @@ $mode = 'UseNone'])
    -

    method SetDrawColor [line 2522]

    +

    method SetDrawColor [line 2525]

    @@ -12278,7 +12327,7 @@ $col4 = -1])
    -

    method SetDrawColorArray [line 2499]

    +

    method SetDrawColorArray [line 2502]

    @@ -12320,7 +12369,7 @@ $color)
    -

    method SetDrawSpotColor [line 2560]

    +

    method SetDrawSpotColor [line 2563]

    @@ -12368,7 +12417,7 @@ $tint = 100])
    -

    method setExtGState [line 9356]

    +

    method setExtGState [line 9370]

    @@ -12404,7 +12453,7 @@ $gs)
    -

    method SetFillColor [line 2602]

    +

    method SetFillColor [line 2605]

    @@ -12464,7 +12513,7 @@ $col4 = -1])
    -

    method SetFillColorArray [line 2579]

    +

    method SetFillColorArray [line 2582]

    @@ -12506,7 +12555,7 @@ $color)
    -

    method SetFillSpotColor [line 2644]

    +

    method SetFillSpotColor [line 2647]

    @@ -12554,7 +12603,7 @@ $tint = 100])
    -

    method SetFont [line 3016]

    +

    method SetFont [line 3019]

    @@ -12614,7 +12663,7 @@ $fontfile = ''])
    -

    method setFontBuffer [line 13136]

    +

    method setFontBuffer [line 13160]

    @@ -12659,7 +12708,7 @@ $data)
    -

    method SetFontSize [line 3036]

    +

    method SetFontSize [line 3039]

    @@ -12701,7 +12750,7 @@ $size)
    -

    method setFontSubBuffer [line 13158]

    +

    method setFontSubBuffer [line 13182]

    @@ -12752,7 +12801,7 @@ $data)
    -

    method setFooter [line 2399]

    +

    method setFooter [line 2402]

    @@ -12780,7 +12829,7 @@ $data)
    -

    method setFooterFont [line 6699]

    +

    method setFooterFont [line 6715]

    @@ -12819,7 +12868,7 @@ $font)
    -

    method setFooterMargin [line 2237]

    +

    method setFooterMargin [line 2240]

    @@ -12855,7 +12904,7 @@ $fm = 10])
    -

    method setGraphicVars [line 12917]

    +

    method setGraphicVars [line 12941]

    @@ -12894,7 +12943,7 @@ $gvars)
    -

    method setHeader [line 2368]

    +

    method setHeader [line 2371]

    @@ -12922,7 +12971,7 @@ $gvars)
    -

    method setHeaderData [line 2188]

    +

    method setHeaderData [line 2191]

    @@ -12976,7 +13025,7 @@ $hs = ''])
    -

    method setHeaderFont [line 6679]

    +

    method setHeaderFont [line 6695]

    @@ -13015,7 +13064,7 @@ $font)
    -

    method setHeaderMargin [line 2217]

    +

    method setHeaderMargin [line 2220]

    @@ -13051,7 +13100,7 @@ $hm = 10])
    -

    method setHtmlLinksStyle [line 12593]

    +

    method setHtmlLinksStyle [line 12617]

    @@ -13096,7 +13145,7 @@ $fontstyle = 'U'])
    -

    method setHtmlVSpace [line 12562]

    +

    method setHtmlVSpace [line 12586]

    @@ -13135,7 +13184,7 @@ $tagvs)
    -

    method setImageBuffer [line 13077]

    +

    method setImageBuffer [line 13101]

    @@ -13222,7 +13271,7 @@ $scale)
    -

    method setImageSubBuffer [line 13100]

    +

    method setImageSubBuffer [line 13124]

    @@ -13273,7 +13322,7 @@ $data)
    -

    method setJPEGQuality [line 9398]

    +

    method setJPEGQuality [line 9412]

    @@ -13351,7 +13400,7 @@ $keywords)
    -

    method setLanguageArray [line 6719]

    +

    method setLanguageArray [line 6735]

    @@ -13474,7 +13523,7 @@ $margin)
    -

    method SetLineStyle [line 7378]

    +

    method SetLineStyle [line 7392]

    @@ -13520,7 +13569,7 @@ $style)
    -

    method SetLineWidth [line 7339]

    +

    method SetLineWidth [line 7353]

    @@ -13562,7 +13611,7 @@ $width)
    -

    method SetLink [line 3088]

    +

    method SetLink [line 3091]

    @@ -13616,7 +13665,7 @@ $page = -1])
    -

    method setListIndentWidth [line 12572]

    +

    method setListIndentWidth [line 12596]

    @@ -13655,7 +13704,7 @@ $width)
    -

    method setLIsymbol [line 12482]

    +

    method setLIsymbol [line 12506]

    @@ -13748,7 +13797,7 @@ $right = -1])
    -

    method setOpenCell [line 12582]

    +

    method setOpenCell [line 12606]

    @@ -13835,7 +13884,7 @@ $resetmargins = false])
    -

    method setPageBuffer [line 13034]

    +

    method setPageBuffer [line 13058]

    @@ -13931,7 +13980,7 @@ $orientation = 'P'])
    -

    method setPageMark [line 2176]

    +

    method setPageMark [line 2179]

    @@ -14049,7 +14098,7 @@ $unit)
    -

    method setPDFVersion [line 9440]

    +

    method setPDFVersion [line 9454]

    @@ -14085,7 +14134,7 @@ $version = '1.7'])
    -

    method setPrintFooter [line 2264]

    +

    method setPrintFooter [line 2267]

    @@ -14127,7 +14176,7 @@ $value)
    -

    method setPrintHeader [line 2255]

    +

    method setPrintHeader [line 2258]

    @@ -14163,7 +14212,7 @@ $val = true])
    -

    method SetProtection [line 6995]

    +

    method SetProtection [line 7009]

    @@ -14340,7 +14389,7 @@ $subject)
    -

    method setTableHeader [line 2441]

    +

    method setTableHeader [line 2444]

    @@ -14407,7 +14456,7 @@ $mode)
    -

    method SetTextColor [line 2686]

    +

    method SetTextColor [line 2689]

    @@ -14467,7 +14516,7 @@ $col4 = -1])
    -

    method SetTextColorArray [line 2663]

    +

    method SetTextColorArray [line 2666]

    @@ -14509,7 +14558,7 @@ $color)
    -

    method SetTextSpotColor [line 2725]

    +

    method SetTextSpotColor [line 2728]

    @@ -14641,7 +14690,7 @@ $margin)
    -

    method setUserRights [line 9117]

    +

    method setUserRights [line 9131]

    @@ -14701,7 +14750,7 @@ $signature = '/Modify'])
    -

    method setViewerPreferences [line 9470]

    +

    method setViewerPreferences [line 9484]

    @@ -14737,7 +14786,7 @@ $preferences)
    -

    method setVisibility [line 9308]

    +

    method setVisibility [line 9322]

    @@ -14773,7 +14822,7 @@ $v)
    -

    method SetX [line 4807]

    +

    method SetX [line 4820]

    @@ -14815,7 +14864,7 @@ $x)
    -

    method SetXY [line 4870]

    +

    method SetXY [line 4883]

    @@ -14863,7 +14912,7 @@ $y)
    -

    method SetY [line 4839]

    +

    method SetY [line 4852]

    @@ -14911,7 +14960,7 @@ $resetx = true])
    -

    method Skew [line 7282]

    +

    method Skew [line 7296]

    @@ -14971,7 +15020,7 @@ $y = ''])
    -

    method SkewX [line 7255]

    +

    method SkewX [line 7269]

    @@ -15025,7 +15074,7 @@ $y = ''])
    -

    method SkewY [line 7268]

    +

    method SkewY [line 7282]

    @@ -15079,7 +15128,7 @@ $y = ''])
    -

    method StarPolygon [line 8040]

    +

    method StarPolygon [line 8054]

    @@ -15203,7 +15252,7 @@ $draw_circle:)
    -

    method startPage [line 2136]

    +

    method startPage [line 2139]

    @@ -15251,7 +15300,7 @@ $format = ''])
    -

    method startPageGroup [line 9137]

    +

    method startPageGroup [line 9151]

    @@ -15287,7 +15336,7 @@ $page = ''])
    -

    method startTransaction [line 13478]

    +

    method startTransaction [line 13502]

    @@ -15315,7 +15364,7 @@ $page = ''])
    -

    method StartTransform [line 7023]

    +

    method StartTransform [line 7037]

    @@ -15346,7 +15395,7 @@ $page = ''])
    -

    method StopTransform [line 7036]

    +

    method StopTransform [line 7050]

    @@ -15377,7 +15426,7 @@ $page = ''])
    -

    method swapMargins [line 12538]

    +

    method swapMargins [line 12562]

    @@ -15416,7 +15465,7 @@ $reverse = true])
    -

    method Text [line 3212]

    +

    method Text [line 3215]

    @@ -15485,7 +15534,7 @@ $clip = false])
    -

    method TextField [line 8944]

    +

    method TextField [line 8958]

    @@ -15539,7 +15588,7 @@ $prop = array()])
    -

    method Transform [line 7315]

    +

    method Transform [line 7329]

    @@ -15581,7 +15630,7 @@ $tm)
    -

    method Translate [line 7198]

    +

    method Translate [line 7212]

    @@ -15629,7 +15678,7 @@ $t_y)
    -

    method TranslateX [line 7175]

    +

    method TranslateX [line 7189]

    @@ -15671,7 +15720,7 @@ $t_x)
    -

    method TranslateY [line 7186]

    +

    method TranslateY [line 7200]

    @@ -15713,7 +15762,7 @@ $t_y)
    -

    method unhtmlentities [line 6843]

    +

    method unhtmlentities [line 6857]

    @@ -15752,7 +15801,7 @@ $text_to_convert)
    -

    method UniArrSubString [line 4220]

    +

    method UniArrSubString [line 4229]

    @@ -15806,7 +15855,7 @@ $end = ''])
    -

    method unichr [line 4253]

    +

    method unichr [line 4262]

    @@ -15851,7 +15900,7 @@ $c)
    -

    method UTF8ArrayToUniArray [line 4241]

    +

    method UTF8ArrayToUniArray [line 4250]

    @@ -15893,7 +15942,7 @@ $ta)
    -

    method UTF8ArrSubString [line 4197]

    +

    method UTF8ArrSubString [line 4206]

    @@ -15944,7 +15993,7 @@ $end = ''])
    -

    method utf8Bidi [line 8188]

    +

    method utf8Bidi [line 8202]

    @@ -15998,7 +16047,7 @@ $forcertl = false])
    -

    method UTF8StringToArray [line 6481]

    +

    method UTF8StringToArray [line 6497]

    @@ -16064,7 +16113,7 @@ $str)
    -

    method utf8StrRev [line 8174]

    +

    method utf8StrRev [line 8188]

    @@ -16118,7 +16167,7 @@ $forcertl = false])
    -

    method UTF8ToLatin1 [line 6588]

    +

    method UTF8ToLatin1 [line 6604]

    @@ -16160,7 +16209,7 @@ $str)
    -

    method UTF8ToUTF16BE [line 6572]

    +

    method UTF8ToUTF16BE [line 6588]

    @@ -16211,7 +16260,7 @@ $setbom = true])
    -

    method Write [line 3867]

    +

    method Write [line 3876]

    @@ -16307,7 +16356,7 @@ $maxh = 0])
    -

    method write1DBarcode [line 10094]

    +

    method write1DBarcode [line 10108]

    @@ -16397,7 +16446,7 @@ $align = ''])
    -

    method write2DBarcode [line 10347]

    +

    method write2DBarcode [line 10361]

    @@ -16481,7 +16530,7 @@ $align = ''])
    -

    method writeBarcode [line 10297]

    +

    method writeBarcode [line 10311]

    @@ -16571,7 +16620,7 @@ $code)
    -

    method writeDiskCache [line 12962]

    +

    method writeDiskCache [line 12986]

    @@ -16628,7 +16677,7 @@ $file)
    -

    method writeHTML [line 11002]

    +

    method writeHTML [line 11016]

    @@ -16694,7 +16743,7 @@ $align = ''])
    -

    method writeHTMLCell [line 10585]

    +

    method writeHTMLCell [line 10599]

    @@ -16796,7 +16845,7 @@ $autopadding = true])
    -

    method _addfield [line 8909]

    +

    method _addfield [line 8923]

    @@ -16868,7 +16917,7 @@ $prop)
    -

    method _beginpage [line 6264]

    +

    method _beginpage [line 6277]

    @@ -16910,7 +16959,7 @@ $format = ''])
    -

    method _datastring [line 6374]

    +

    method _datastring [line 6387]

    @@ -16949,7 +16998,7 @@ $s)
    -

    method _destroy [line 4980]

    +

    method _destroy [line 4993]

    @@ -16994,7 +17043,7 @@ $preserve_objcopy = false])
    -

    method _dochecks [line 4998]

    +

    method _dochecks [line 5011]

    @@ -17019,7 +17068,7 @@ $preserve_objcopy = false])
    -

    method _dolinethrough [line 6339]

    +

    method _dolinethrough [line 6352]

    @@ -17067,7 +17116,7 @@ $txt)
    -

    method _dounderline [line 6325]

    +

    method _dounderline [line 6338]

    @@ -17115,7 +17164,7 @@ $txt)
    -

    method _enddoc [line 6208]

    +

    method _enddoc [line 6221]

    @@ -17140,7 +17189,7 @@ $txt)
    -

    method _endpage [line 6303]

    +

    method _endpage [line 6316]

    @@ -17165,7 +17214,7 @@ $txt)
    -

    method _escape [line 6363]

    +

    method _escape [line 6376]

    @@ -17204,7 +17253,7 @@ $s)
    -

    method _escapetext [line 6401]

    +

    method _escapetext [line 6414]

    @@ -17243,7 +17292,7 @@ $s)
    -

    method _freadint [line 6352]

    +

    method _freadint [line 6365]

    @@ -17282,7 +17331,7 @@ $f)
    -

    method _generateencryptionkey [line 6963]

    +

    method _generateencryptionkey [line 6977]

    @@ -17336,7 +17385,7 @@ $protection)
    -

    method _getfontpath [line 5014]

    +

    method _getfontpath [line 5027]

    @@ -17361,7 +17410,7 @@ $protection)
    -

    method _JScolor [line 8885]

    +

    method _JScolor [line 8899]

    @@ -17397,7 +17446,7 @@ $color)
    -

    method _md5_16 [line 6924]

    +

    method _md5_16 [line 6938]

    @@ -17442,7 +17491,7 @@ $str)
    -

    method _newobj [line 6312]

    +

    method _newobj [line 6325]

    @@ -17467,7 +17516,7 @@ $str)
    -

    method _objectkey [line 6856]

    +

    method _objectkey [line 6870]

    @@ -17506,7 +17555,7 @@ $n)
    -

    method _out [line 6432]

    +

    method _out [line 6445]

    @@ -17542,7 +17591,7 @@ $s)
    -

    method _outarc [line 9704]

    +

    method _outarc [line 9718]

    @@ -17614,7 +17663,7 @@ $y3)
    -

    method _outCurve [line 7483]

    +

    method _outCurve [line 7497]

    @@ -17680,7 +17729,7 @@ $y3)
    -

    method _outLine [line 7447]

    +

    method _outLine [line 7461]

    @@ -17722,7 +17771,7 @@ $y)
    -

    method _outPoint [line 7433]

    +

    method _outPoint [line 7447]

    @@ -17764,7 +17813,7 @@ $y)
    -

    method _outRect [line 7464]

    +

    method _outRect [line 7478]

    @@ -17827,7 +17876,7 @@ $op)
    -

    method _Ovalue [line 6937]

    +

    method _Ovalue [line 6951]

    @@ -17878,7 +17927,7 @@ $owner_pass)
    -

    method _parsejpeg [line 4525]

    +

    method _parsejpeg [line 4534]

    @@ -17917,7 +17966,7 @@ $file)
    -

    method _parsepng [line 4551]

    +

    method _parsepng [line 4560]

    @@ -17956,7 +18005,7 @@ $file)
    -

    method _putannots [line 5170]

    +

    method _putannots [line 5183]

    @@ -17998,7 +18047,7 @@ $n)
    -

    method _putbookmarks [line 8783]

    +

    method _putbookmarks [line 8797]

    @@ -18023,7 +18072,7 @@ $n)
    -

    method _putcatalog [line 6072]

    +

    method _putcatalog [line 6085]

    @@ -18048,7 +18097,7 @@ $n)
    -

    method _putcidfont0 [line 5828]

    +

    method _putcidfont0 [line 5841]

    @@ -18090,7 +18139,7 @@ $font)
    -

    method _putEmbeddedFiles [line 3181]

    +

    method _putEmbeddedFiles [line 3184]

    @@ -18121,7 +18170,7 @@ $font)
    -

    method _putencryption [line 6865]

    +

    method _putencryption [line 6879]

    @@ -18149,7 +18198,7 @@ $font)
    -

    method _putextgstates [line 9366]

    +

    method _putextgstates [line 9380]

    @@ -18174,7 +18223,7 @@ $font)
    -

    method _putfonts [line 5518]

    +

    method _putfonts [line 5531]

    @@ -18199,7 +18248,7 @@ $font)
    -

    method _putfontwidths [line 5645]

    +

    method _putfontwidths [line 5658]

    @@ -18247,7 +18296,7 @@ $cidoffset = 0])
    -

    method _putheader [line 6200]

    +

    method _putheader [line 6213]

    @@ -18272,7 +18321,7 @@ $cidoffset = 0])
    -

    method _putimages [line 5888]

    +

    method _putimages [line 5901]

    @@ -18297,7 +18346,7 @@ $cidoffset = 0])
    -

    method _putinfo [line 6045]

    +

    method _putinfo [line 6058]

    @@ -18322,7 +18371,7 @@ $cidoffset = 0])
    -

    method _putjavascript [line 8857]

    +

    method _putjavascript [line 8871]

    @@ -18347,7 +18396,7 @@ $cidoffset = 0])
    -

    method _putocg [line 9287]

    +

    method _putocg [line 9301]

    @@ -18372,7 +18421,7 @@ $cidoffset = 0])
    -

    method _putpages [line 5025]

    +

    method _putpages [line 5038]

    @@ -18397,7 +18446,7 @@ $cidoffset = 0])
    -

    method _putresourcedict [line 5971]

    +

    method _putresourcedict [line 5984]

    @@ -18422,7 +18471,7 @@ $cidoffset = 0])
    -

    method _putresources [line 6012]

    +

    method _putresources [line 6025]

    @@ -18447,7 +18496,7 @@ $cidoffset = 0])
    -

    method _putshaders [line 9654]

    +

    method _putshaders [line 9668]

    @@ -18478,7 +18527,7 @@ $cidoffset = 0])
    -

    method _putspotcolors [line 5943]

    +

    method _putspotcolors [line 5956]

    @@ -18506,7 +18555,7 @@ $cidoffset = 0])
    -

    method _putstream [line 6418]

    +

    method _putstream [line 6431]

    @@ -18542,7 +18591,7 @@ $s)
    -

    method _puttrailer [line 6186]

    +

    method _puttrailer [line 6199]

    @@ -18567,7 +18616,7 @@ $s)
    -

    method _puttruetypeunicode [line 5743]

    +

    method _puttruetypeunicode [line 5756]

    @@ -18609,7 +18658,7 @@ $font)
    -

    method _putuserrights [line 9061]

    +

    method _putuserrights [line 9075]

    diff --git a/examples/example_005.php b/examples/example_005.php index efe5cda..dc3a5f9 100755 --- a/examples/example_005.php +++ b/examples/example_005.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_005.php // Begin : 2008-03-04 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 005 for TCPDF class // Multicell @@ -79,15 +79,15 @@ $pdf->AddPage(); $pdf->SetFillColor(255, 255, 0); // Multicell test -$pdf->MultiCell(40, 5, 'A test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 1, 0, 0 ,0, true); -$pdf->MultiCell(40, 5, 'B test multicell line 1 test multicell line 2 test multicell line 3', 1, 'R', 0, 1, 0 ,0, true); -$pdf->MultiCell(40, 5, 'C test multicell line 1 test multicell line 2 test multicell line 3', 1, 'C', 0, 0, 0 ,0, true); -$pdf->MultiCell(40, 5, 'D test multicell line 1 test multicell line 2 test multicell line 3'."\n", 1, 'J', 1, 2, 0 ,0, true); -$pdf->MultiCell(40, 5, 'E test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 0, 1, 0 ,0, true); +$pdf->MultiCell(40, 5, 'A test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 1, 0, '', '', true); +$pdf->MultiCell(40, 5, 'B test multicell line 1 test multicell line 2 test multicell line 3', 1, 'R', 0, 1, '', '', true); +$pdf->MultiCell(40, 5, 'C test multicell line 1 test multicell line 2 test multicell line 3', 1, 'C', 0, 0, '', '', true); +$pdf->MultiCell(40, 5, 'D test multicell line 1 test multicell line 2 test multicell line 3'."\n", 1, 'J', 1, 2, '' ,'', true); +$pdf->MultiCell(40, 5, 'E test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 0, 1, '', '', true); $pdf->SetFillColor(255, 200, 200); -$pdf->MultiCell(40, 5, 'F test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line'."\n", 1, 'J', 1, 1, 0 ,0, true); +$pdf->MultiCell(40, 5, 'F test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line'."\n", 1, 'J', 1, 1, '' ,'', true); // reset pointer to the last page $pdf->lastPage(); diff --git a/examples/example_007.php b/examples/example_007.php index 8383dd3..dbb30b9 100755 --- a/examples/example_007.php +++ b/examples/example_007.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_007.php // Begin : 2008-03-04 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 007 for TCPDF class // Two independent columns with WriteHTMLCell @@ -88,10 +88,10 @@ $second_column_width = 80; $current_y_position = $pdf->getY(); // write the first column -$pdf->writeHTMLCell($first_column_width, 0, 0, $current_y_position, $left_column, 1, 0, 0, true); +$pdf->writeHTMLCell($first_column_width, '', '', $current_y_position, $left_column, 1, 0, 0, true); // write the second column -$pdf->writeHTMLCell($second_column_width, 0, 0, 0, $right_column, 1, 1, 0, true); +$pdf->writeHTMLCell($second_column_width, '', '', '', $right_column, 1, 1, 0, true); // reset pointer to the last page $pdf->lastPage(); diff --git a/examples/example_010.php b/examples/example_010.php index c50d32a..8b9caaf 100755 --- a/examples/example_010.php +++ b/examples/example_010.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_010.php // Begin : 2008-03-04 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 010 for TCPDF class // Text on multiple columns @@ -110,7 +110,7 @@ class MYPDF extends TCPDF { // Font $this->SetFont('times', '', 9); // Output text in a column - $this->MultiCell($this->colwidth, 5, $txt, 0, 'J', 0, 1, 0, 0, true, 0, false); + $this->MultiCell($this->colwidth, 5, $txt, 0, 'J', 0, 1, '', '', true, 0, false); $this->Ln(); // Go back to first column $this->SetCol(0); diff --git a/examples/example_017.php b/examples/example_017.php index c193ea5..86569a8 100755 --- a/examples/example_017.php +++ b/examples/example_017.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_017.php // Begin : 2008-03-04 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 017 for TCPDF class // Two independent columns with MultiCell @@ -88,10 +88,10 @@ $second_column_width = 80; $current_y_position = $pdf->getY(); // write the first column -$pdf->MultiCell($first_column_width, 0, $left_column, 1, 'J', 0, 0, 0, 0, true, 0); +$pdf->MultiCell($first_column_width, 0, $left_column, 1, 'J', 0, 0, '', '', true, 0); // write the second column -$pdf->MultiCell($second_column_width, 0, $right_column, 1, 'J', 0, 1, 0, 0, true, 0); +$pdf->MultiCell($second_column_width, 0, $right_column, 1, 'J', 0, 1, '', '', true, 0); // reset pointer to the last page $pdf->lastPage(); diff --git a/examples/example_019.php b/examples/example_019.php index e24624b..bd5d0aa 100755 --- a/examples/example_019.php +++ b/examples/example_019.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_019.php // Begin : 2008-03-07 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 019 for TCPDF class // Non unicode with alternative config file @@ -93,7 +93,7 @@ $pdf->Cell(0, 10, 'Example 019', 1, 1, 'C'); $pdf->Ln(); $pdf->SetFont('times', '', 10); -$pdf->MultiCell(80, 0, 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.'."\n", 1, 'J', 0, 1, 0, 0, true, 0); +$pdf->MultiCell(80, 0, 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.'."\n", 1, 'J', 0, 1, '', '', true, 0); // --------------------------------------------------------- diff --git a/examples/example_020.php b/examples/example_020.php index 9450298..3efb31c 100755 --- a/examples/example_020.php +++ b/examples/example_020.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_020.php // Begin : 2008-03-04 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 020 for TCPDF class // Two columns composed by MultiCell of different @@ -43,7 +43,7 @@ class MYPDF extends TCPDF { $y_start = $this->GetY(); // write the left cell - $this->MultiCell(40, 0, $left, 1, 'R', 0, 2, 0 ,0, true, 0); + $this->MultiCell(40, 0, $left, 1, 'R', 0, 2, '', '', true, 0); $page_end_1 = $this->getPage(); $y_end_1 = $this->GetY(); diff --git a/examples/example_021.php b/examples/example_021.php index abc5641..d86cac6 100755 --- a/examples/example_021.php +++ b/examples/example_021.php @@ -70,7 +70,7 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('dejavusans', '', 9); +$pdf->SetFont('helvetica', '', 9); // add a page $pdf->AddPage(); diff --git a/examples/example_033.php b/examples/example_033.php index fb9eb45..dad07c5 100755 --- a/examples/example_033.php +++ b/examples/example_033.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_033.php // Begin : 2008-06-24 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 033 for TCPDF class // Mixed font types @@ -73,17 +73,17 @@ $pdf->setLanguageArray($l); $pdf->AddPage(); $pdf->SetFont('dejavusans', '', 10); -$pdf->MultiCell(80, 0, "[True Type Unicode font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, 0, 0, true, 0); +$pdf->MultiCell(80, 0, "[True Type Unicode font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); $pdf->Ln(2); $pdf->SetFont('times', '', 10); -$pdf->MultiCell(80, 0, "[Core font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, 0, 0, true, 0); +$pdf->MultiCell(80, 0, "[Core font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); $pdf->Ln(2); $pdf->SetFont('arialunicid0', '', 9); -$pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, 0, 0, true, 0); +$pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); // --------------------------------------------------------- diff --git a/examples/example_042.php b/examples/example_042.php index 3cfec5f..2d87acb 100755 --- a/examples/example_042.php +++ b/examples/example_042.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_042.php // Begin : 2008-12-23 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 042 for TCPDF class // Test Image with alpha channel @@ -79,7 +79,7 @@ $pdf->AddPage(); // create background text $background_text = str_repeat('TCPDF test PNG Alpha Channel ', 50); -$pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, 0 , 0, true, 0, false); +$pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, '', '', true, 0, false); // [A] The Image() method recognizes the alpha channel embedded on the image: diff --git a/examples/example_043.php b/examples/example_043.php index e3a34c1..689e930 100755 --- a/examples/example_043.php +++ b/examples/example_043.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_043.php // Begin : 2009-01-02 -// Last Update : 2009-03-18 +// Last Update : 2009-04-16 // // Description : Example 043 for TCPDF class // Disk caching @@ -76,7 +76,7 @@ $pdf->SetFont('times', '', 10); $pdf->AddPage(); // Multicell test -$pdf->MultiCell(0, 0, "DISK CACHING TEST: check the parameters on class constructor.", 1, 'L', 0, 0, 0 ,0, true); +$pdf->MultiCell(0, 0, "DISK CACHING TEST: check the parameters on class constructor.", 1, 'L', 0, 0, '', '', true); // --------------------------------------------------------- diff --git a/tcpdf.php b/tcpdf.php index abb58a8..f32d297 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2009-04-15 +// Last Update : 2009-04-16 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.5.043 +// Version : 4.6.000 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. @@ -122,7 +122,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.5.043 + * @version 4.6.000 */ /** @@ -146,14 +146,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 4.5.043 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 4.6.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.5.043 + * @version 4.6.000 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -469,31 +469,31 @@ if (!class_exists('TCPDF', false)) { * @var title * @access protected */ - protected $title; + protected $title = ''; /** * @var subject * @access protected */ - protected $subject; + protected $subject = ''; /** * @var author * @access protected */ - protected $author; + protected $author = ''; /** * @var keywords * @access protected */ - protected $keywords; + protected $keywords = ''; /** * @var creator * @access protected */ - protected $creator; + protected $creator = ''; /** * @var alias for total number of pages @@ -1533,14 +1533,14 @@ if (!class_exists('TCPDF', false)) { } $this->w = $this->wPt / $this->k; $this->h = $this->hPt / $this->k; - if (empty($autopagebreak)) { + if ($this->empty_string($autopagebreak)) { if (isset($this->AutoPageBreak)) { $autopagebreak = $this->AutoPageBreak; } else { $autopagebreak = true; } } - if (empty($bottommargin)) { + if ($this->empty_string($bottommargin)) { if (isset($this->bMargin)) { $bottommargin = $this->bMargin; } else { @@ -2011,10 +2011,13 @@ if (!class_exists('TCPDF', false)) { * @see getPage(), lastpage(), getNumPages() */ public function setPage($pnum, $resetmargins=false) { + if ($pnum == $this->page) { + return; + } if (($pnum > 0) AND ($pnum <= $this->numpages)) { $this->state = 2; // save current graphic settings - $gvars = $this->getGraphicVars(); + //$gvars = $this->getGraphicVars(); $oldpage = $this->page; $this->page = $pnum; $this->wPt = $this->pagedim[$this->page]['w']; @@ -2029,7 +2032,7 @@ if (!class_exists('TCPDF', false)) { $this->CurOrientation = $this->pagedim[$this->page]['or']; $this->SetAutoPageBreak($this->AutoPageBreak, $this->bMargin); // restore graphic settings - $this->setGraphicVars($gvars); + //$this->setGraphicVars($gvars); if ($resetmargins) { $this->lMargin = $this->pagedim[$this->page]['olm']; $this->rMargin = $this->pagedim[$this->page]['orm']; @@ -2430,7 +2433,7 @@ if (!class_exists('TCPDF', false)) { // restore graphic settings $this->setGraphicVars($gvars); // calculate footer lenght - $this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page]; + $this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page] + 1; } /** @@ -2439,17 +2442,17 @@ if (!class_exists('TCPDF', false)) { * @since 4.5.030 (2009-03-25) */ protected function setTableHeader() { - if (!empty($this->theadMargin)) { + if (!$this->empty_string($this->theadMargin)) { // restore the original top-margin $this->tMargin = $this->theadMargin; $this->pagedim[$this->page]['tm'] = $this->theadMargin; $this->y = $this->theadMargin; } - if (!empty($this->thead)) { + if (!$this->empty_string($this->thead)) { // print table header $this->writeHTML($this->thead, false, false, false, false, ''); // set new top margin to skip the table headers - if (!isset($this->theadMargin) OR (empty($this->theadMargin))) { + if (!isset($this->theadMargin) OR ($this->empty_string($this->theadMargin))) { $this->theadMargin = $this->tMargin; } $this->tMargin = $this->y; @@ -2761,7 +2764,7 @@ if (!class_exists('TCPDF', false)) { */ public function GetArrStringWidth($sa, $fontname='', $fontstyle='', $fontsize=0) { // store current values - if (!empty($fontname)) { + if (!$this->empty_string($fontname)) { $prev_FontFamily = $this->FontFamily; $prev_FontStyle = $this->FontStyle; $prev_FontSizePt = $this->FontSizePt; @@ -2772,7 +2775,7 @@ if (!class_exists('TCPDF', false)) { $w += $this->GetCharWidth($char); } // restore previous values - if (!empty($fontname)) { + if (!$this->empty_string($fontname)) { $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt); } return $w; @@ -2848,8 +2851,8 @@ if (!class_exists('TCPDF', false)) { * @see SetFont() */ public function AddFont($family, $style='', $fontfile='') { - if (empty($family)) { - if (!empty($this->FontFamily)) { + if ($this->empty_string($family)) { + if (!$this->empty_string($this->FontFamily)) { $family = $this->FontFamily; } else { $this->Error('Empty font family'); @@ -2900,16 +2903,16 @@ if (!class_exists('TCPDF', false)) { } // get specified font directory (if any) $fontdir = ''; - if (!empty($fontfile)) { + if (!$this->empty_string($fontfile)) { $fontdir = dirname($fontfile); - if (empty($fontdir) OR ($fontdir == '.')) { + if ($this->empty_string($fontdir) OR ($fontdir == '.')) { $fontdir = ''; } else { $fontdir .= '/'; } } // search and include font file - if (empty($fontfile) OR (!file_exists($fontfile))) { + if ($this->empty_string($fontfile) OR (!file_exists($fontfile))) { // build a standard filenames for specified font $fontfile1 = str_replace(' ', '', $family).strtolower($style).'.php'; $fontfile2 = str_replace(' ', '', $family).'.php'; @@ -2944,7 +2947,7 @@ if (!class_exists('TCPDF', false)) { if (!isset($enc)) { $enc = ''; } - if (!isset($dw) OR empty($dw)) { + if (!isset($dw) OR $this->empty_string($dw)) { // set default width if (isset($desc['MissingWidth']) AND ($desc['MissingWidth'] > 0)) { $dw = $desc['MissingWidth']; @@ -2989,7 +2992,7 @@ if (!class_exists('TCPDF', false)) { } $this->setFontSubBuffer($fontkey, 'diff', $d); } - if (!empty($file)) { + if (!$this->empty_string($file)) { if ((strcasecmp($type,'TrueType') == 0) OR (strcasecmp($type, 'TrueTypeUnicode') == 0)) { $this->FontFiles[$file] = array('length1' => $originalsize, 'fontdir' => $fontdir); } elseif ($type != 'core') { @@ -3167,7 +3170,7 @@ if (!class_exists('TCPDF', false)) { } } $this->PageAnnots[$this->page][] = array('x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces); - if (($opt['Subtype'] == 'FileAttachment') AND (!empty($opt['FS'])) AND file_exists($opt['FS']) AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) { + 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' => ($this->n + count($this->embeddedfiles) + 10000)); } } @@ -3365,7 +3368,7 @@ if (!class_exists('TCPDF', false)) { } } $k = $this->k; - if (empty($w) OR ($w <= 0)) { + if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $this->x - $this->lMargin; } else { @@ -3591,11 +3594,11 @@ if (!class_exists('TCPDF', false)) { * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() */ public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) { - if (empty($this->lasth) OR $reseth) { + if ($this->empty_string($this->lasth) OR $reseth) { //set row height $this->lasth = $this->FontSize * $this->cell_height_ratio; } - if (!empty($y)) { + if (!$this->empty_string($y)) { $this->SetY($y); } else { $y = $this->GetY(); @@ -3605,12 +3608,12 @@ if (!class_exists('TCPDF', false)) { $y = $this->GetY(); // get current page number $startpage = $this->page; - if (!empty($x)) { + if (!$this->empty_string($x)) { $this->SetX($x); } else { $x = $this->GetX(); } - if (empty($w) OR ($w <= 0)) { + if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $this->x - $this->lMargin; } else { @@ -3689,9 +3692,10 @@ if (!class_exists('TCPDF', false)) { } $this->SetX($nx); $ccode = $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, false); - if ($cborder OR $fill) { - $pstart = substr($this->getPageBuffer($this->page), 0, $this->intmrk[$this->page]); - $pend = substr($this->getPageBuffer($this->page), $this->intmrk[$this->page]); + if ($cborder OR $fill) { + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $this->intmrk[$this->page]); + $pend = substr($pagebuff, $this->intmrk[$this->page]); $this->setPageBuffer($this->page, $pstart.$ccode."\n".$pend); $this->intmrk[$this->page] += strlen($ccode."\n"); } @@ -3711,9 +3715,10 @@ if (!class_exists('TCPDF', false)) { $pagemark = &$this->footerpos[$this->page]; } else { $pagemark = &$this->intmrk[$this->page]; - } - $pstart = substr($this->getPageBuffer($this->page), 0, $pagemark); - $pend = substr($this->getPageBuffer($this->page), $pagemark); + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); $this->setPageBuffer($this->page, $pstart.$ccode."\n".$pend); $pagemark += strlen($ccode."\n"); } @@ -3827,7 +3832,7 @@ if (!class_exists('TCPDF', false)) { */ public function getNumLines($txt, $w=0) { $lines = 0; - if (empty($w) OR ($w <= 0)) { + if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $this->x - $this->lMargin; } else { @@ -3838,12 +3843,16 @@ if (!class_exists('TCPDF', false)) { $wmax = $w - (2 * $this->cMargin); // remove carriage returns $txt = str_replace("\r", '', $txt); + // remove last newline (if any) + if (substr($txt,-1) == "\n") { + $txt = substr($txt, 0, -1); + } // divide text in blocks $txtblocks = explode("\n", $txt); // for each block; foreach ($txtblocks as $block) { // estimate the number of lines - $lines += empty($block) ? 1 : (ceil($this->GetStringWidth($block) / $wmax)); + $lines += $this->empty_string($block) ? 1 : (ceil($this->GetStringWidth($block) / $wmax)); } return $lines; } @@ -4340,7 +4349,7 @@ if (!class_exists('TCPDF', false)) { //First use of image, get info if ($type == '') { $fileinfo = pathinfo($file); - if (isset($fileinfo['extension']) AND (!empty($fileinfo['extension']))) { + if (isset($fileinfo['extension']) AND (!$this->empty_string($fileinfo['extension']))) { $type = $fileinfo['extension']; } else { $this->Error('Image file has no extension and no type was specified: '.$file); @@ -4550,7 +4559,7 @@ if (!class_exists('TCPDF', false)) { */ protected function _parsepng($file) { $f = fopen($file, 'rb'); - if (empty($f)) { + if ($f === false) { $this->Error('Can\'t open image file: '.$file); } //Check signature @@ -4648,12 +4657,16 @@ if (!class_exists('TCPDF', false)) { * Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached. * @param resource $handle * @param int $length + * @return Returns the read string or FALSE in case of error. * @author Nicola Asuni * @access protected * @since 4.5.027 (2009-03-16) */ protected function rfread($handle, $length) { $data = fread($handle, $length); + if ($data === false) { + return false; + } $rest = $length - strlen($data); if ($rest > 0) { $data .= $this->rfread($handle, $rest); @@ -4978,7 +4991,7 @@ if (!class_exists('TCPDF', false)) { * @since 4.5.016 (2009-02-24) */ public function _destroy($destroyall=false, $preserve_objcopy=false) { - if ($destroyall AND isset($this->diskcache) AND $this->diskcache AND (!$preserve_objcopy) AND (!empty($this->buffer))) { + if ($destroyall AND isset($this->diskcache) AND $this->diskcache AND (!$preserve_objcopy) AND (!$this->empty_string($this->buffer))) { // remove buffer file from cache unlink($this->buffer); } @@ -5538,7 +5551,7 @@ if (!class_exists('TCPDF', false)) { } elseif (file_exists($file)) { $fontfile = $file; } - if (!empty($fontfile)) { + if (!$this->empty_string($fontfile)) { $font = file_get_contents($fontfile); $compressed = (substr($file, -2) == '.z'); if ((!$compressed) AND (isset($info['length2']))) { @@ -5618,7 +5631,7 @@ if (!class_exists('TCPDF', false)) { foreach ($font['desc'] as $k => $v) { $s .= ' /'.$k.' '.$v.''; } - if (!empty($font['file'])) { + if (!$this->empty_string($font['file'])) { $s .= ' /FontFile'.($type == 'Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R'; } $this->_out($s.'>>'); @@ -5778,7 +5791,7 @@ if (!class_exists('TCPDF', false)) { $this->_out('/'.$key.' '.$value); } $fontdir = ''; - if (!empty($font['file'])) { + if (!$this->empty_string($font['file'])) { // A stream containing a TrueType font $this->_out('/FontFile2 '.$this->FontFiles[$font['file']]['n'].' 0 R'); $fontdir = $this->FontFiles[$font['file']]['fontdir']; @@ -5786,7 +5799,7 @@ if (!class_exists('TCPDF', false)) { $this->_out('>>'); $this->_out('endobj'); $this->_newobj(); - if (isset($font['ctg']) AND (!empty($font['ctg']))) { + if (isset($font['ctg']) AND (!$this->empty_string($font['ctg']))) { // Embed CIDToGIDMap // A specification of the mapping from CIDs to glyph indices // search and get CTG font file to embedd @@ -5801,7 +5814,7 @@ if (!class_exists('TCPDF', false)) { } elseif (file_exists($ctgfile)) { $fontfile = $ctgfile; } - if (empty($fontfile)) { + if ($this->empty_string($fontfile)) { $this->Error('Font file not found: '.$ctgfile); } $size = filesize($fontfile); @@ -6043,19 +6056,19 @@ if (!class_exists('TCPDF', false)) { * @access protected */ protected function _putinfo() { - if (!empty($this->title)) { + if (!$this->empty_string($this->title)) { $this->_out('/Title '.$this->_textstring($this->title)); } - if (!empty($this->author)) { + if (!$this->empty_string($this->author)) { $this->_out('/Author '.$this->_textstring($this->author)); } - if (!empty($this->subject)) { + if (!$this->empty_string($this->subject)) { $this->_out('/Subject '.$this->_textstring($this->subject)); } - if (!empty($this->keywords)) { + if (!$this->empty_string($this->keywords)) { $this->_out('/Keywords '.$this->_textstring($this->keywords)); } - if (!empty($this->creator)) { + if (!$this->empty_string($this->creator)) { $this->_out('/Creator '.$this->_textstring($this->creator)); } if (defined('PDF_PRODUCER')) { @@ -6081,17 +6094,17 @@ if (!class_exists('TCPDF', false)) { } elseif (!is_string($this->ZoomMode)) { $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode / 100).']'); } - if (isset($this->LayoutMode) AND (!empty($this->LayoutMode))) { + if (isset($this->LayoutMode) AND (!$this->empty_string($this->LayoutMode))) { $this->_out('/PageLayout /'.$this->LayoutMode.''); } - if (isset($this->PageMode) AND (!empty($this->PageMode))) { + if (isset($this->PageMode) AND (!$this->empty_string($this->PageMode))) { $this->_out('/PageMode /'.$this->PageMode); } if (isset($this->l['a_meta_language'])) { $this->_out('/Lang /'.$this->l['a_meta_language']); } $this->_out('/Names <<'); - if (!empty($this->javascript)) { + if (!$this->empty_string($this->javascript)) { $this->_out('/JavaScript '.($this->n_js).' 0 R'); } $this->_out('>>'); @@ -6156,7 +6169,7 @@ if (!class_exists('TCPDF', false)) { if (isset($this->viewer_preferences['PrintScaling'])) { $this->_out('/PrintScaling /'.$this->viewer_preferences['PrintScaling']); } - if (isset($this->viewer_preferences['Duplex']) AND (!empty($this->viewer_preferences['Duplex']))) { + if (isset($this->viewer_preferences['Duplex']) AND (!$this->empty_string($this->viewer_preferences['Duplex']))) { $this->_out('/Duplex /'.$this->viewer_preferences['Duplex']); } if (isset($this->viewer_preferences['PickTrayByPDFSize'])) { @@ -6267,17 +6280,17 @@ if (!class_exists('TCPDF', false)) { // initialize array for graphics tranformation positions inside a page buffer $this->transfmrk[$this->page] = array(); $this->state = 2; - if (empty($orientation)) { + if ($this->empty_string($orientation)) { if (isset($this->CurOrientation)) { $orientation = $this->CurOrientation; } else { $orientation = 'P'; } } - if (!empty($format)) { - $this->setPageFormat($format, $orientation); - } else { + if ($this->empty_string($format)) { $this->setPageOrientation($orientation); + } else { + $this->setPageFormat($format, $orientation); } if ($this->rtl) { $this->x = $this->w - $this->rMargin; @@ -6429,13 +6442,16 @@ if (!class_exists('TCPDF', false)) { * @param string $s string to output. * @access protected */ - protected function _out($s) { + protected function _out($s) { if ($this->state == 2) { if ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { - // puts data before page footer - $page = substr($this->getPageBuffer($this->page), 0, -$this->footerlen[$this->page]); - $footer = substr($this->getPageBuffer($this->page), -$this->footerlen[$this->page]); - $this->setPageBuffer($this->page, $page.$s."\n".$footer); + // puts data before page footer + $pagebuff = $this->getPageBuffer($this->page); + $page = substr($pagebuff, 0, -$this->footerlen[$this->page]); + $footer = substr($pagebuff, -$this->footerlen[$this->page]); + $this->setPageBuffer($this->page, $page.$s."\n".$footer); + // update footer position + $this->footerpos[$this->page] += strlen($s."\n"); } else { $this->setPageBuffer($this->page, $s."\n", true); } @@ -6744,7 +6760,7 @@ if (!class_exists('TCPDF', false)) { * @access public */ public function addHtmlLink($url, $name, $fill=0, $firstline=false, $color='', $style=-1) { - if (!empty($url) AND ($url{0} == '#')) { + if (!$this->empty_string($url) AND ($url{0} == '#')) { // convert url to internal link $page = intval(substr($url, 1)); $url = $this->AddLink(); @@ -6773,17 +6789,15 @@ if (!class_exists('TCPDF', false)) { /** * Returns an associative array (keys: R,G,B) from an html color name or a six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or #7FF). * @param string $color html color - * @return array + * @return array RGB color or false in case of error. * @access public */ - public function convertHTMLColorToDec($color='#000000') { + public function convertHTMLColorToDec($color='#FFFFFF') { global $webcolor; $color = preg_replace('/[\s]*/', '', $color); // remove extra spaces - $color = strtolower($color); - // set default color to be returned in case of error - $returncolor = array ('R' => 0, 'G' => 0, 'B' => 0); - if (empty($color)) { - return $returncolor; + $color = strtolower($color); + if (strlen($color) == 0) { + return false; } if (substr($color, 0, 3) == 'rgb') { $codes = substr($color, 4); @@ -6796,7 +6810,7 @@ if (!class_exists('TCPDF', false)) { if (isset($webcolor[$color])) { $color_code = $webcolor[$color]; } else { - return $returncolor; + return false; } } else { $color_code = substr($color, 1); @@ -8191,7 +8205,7 @@ if (!class_exists('TCPDF', false)) { $pel = 0; // max level $maxlevel = 0; - if (empty($str)) { + if ($this->empty_string($str)) { // create string from array $str = $this->UTF8ArrSubString($ta); } @@ -9082,16 +9096,16 @@ if (!class_exists('TCPDF', false)) { $this->_out('<<'); $this->_out('/Type/TransformParams'); $this->_out('/V/2.2'); - if (!empty($this->ur_document)) { + if (!$this->empty_string($this->ur_document)) { $this->_out('/Document['.$this->ur_document.']'); } - if (!empty($this->ur_annots)) { + if (!$this->empty_string($this->ur_annots)) { $this->_out('/Annots['.$this->ur_annots.']'); } - if (!empty($this->ur_form)) { + if (!$this->empty_string($this->ur_form)) { $this->_out('/Form['.$this->ur_form.']'); } - if (!empty($this->ur_signature)) { + if (!$this->empty_string($this->ur_signature)) { $this->_out('/Signature['.$this->ur_signature.']'); } $this->_out('>>'); @@ -10092,7 +10106,7 @@ if (!class_exists('TCPDF', false)) { * @access public */ public function write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres=0.4, $style='', $align='') { - if (empty($code)) { + if ($this->empty_string($code)) { return; } require_once(dirname(__FILE__).'/barcodes.php'); @@ -10142,28 +10156,28 @@ if (!class_exists('TCPDF', false)) { // set foreground color $this->SetDrawColorArray($style['fgcolor']); $this->SetTextColorArray($style['fgcolor']); - if (empty($w) OR ($w <= 0)) { + if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $this->x - $this->lMargin; } else { $w = $this->w - $this->rMargin - $this->x; } } - if (empty($x)) { + if ($this->empty_string($x)) { $x = $this->GetX(); } if ($this->rtl) { $x = $this->w - $x; } - if (empty($y)) { + if ($this->empty_string($y)) { $y = $this->GetY(); } - if (empty($xres)) { + if ($this->empty_string($xres)) { $xres = 0.4; } $fbw = ($arrcode['maxw'] * $xres) + (2 * $style['padding']); $extraspace = ($this->cell_height_ratio * $fontsize / $this->k) + (2 * $style['padding']); - if (empty($h)) { + if ($this->empty_string($h) OR ($h <= 0)) { $h = 10 + $extraspace; } if ($this->checkPageBreak($h)) { @@ -10345,7 +10359,7 @@ if (!class_exists('TCPDF', false)) { * @access public */ public function write2DBarcode($code, $type, $x='', $y='', $w='', $h='', $style='', $align='') { - if (empty($code)) { + if ($this->empty_string($code)) { return; } require_once(dirname(__FILE__).'/2dbarcodes.php'); @@ -10372,23 +10386,23 @@ if (!class_exists('TCPDF', false)) { } // set foreground color $this->SetDrawColorArray($style['fgcolor']); - if (empty($x)) { + if ($this->empty_string($x)) { $x = $this->GetX(); } if ($this->rtl) { $x = $this->w - $x; } - if (empty($y)) { + if ($this->empty_string($y)) { $y = $this->GetY(); } - if (empty($w) OR ($w <= 0)) { + if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $x - $this->lMargin; } else { $w = $this->w - $this->rMargin - $x; } } - if (empty($h) OR ($h <= 0)) { + if ($this->empty_string($h) OR ($h <= 0)) { // 2d barcodes are square by default $h = $w; } @@ -10707,14 +10721,14 @@ if (!class_exists('TCPDF', false)) { } // store header rows on a new table if (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['thead'] == true)) { - if (empty($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) { + if ($this->empty_string($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) { $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] = $a[$dom[($dom[($dom[$key]['parent'])]['parent'])]['elkey']]; } for ($i = $dom[$key]['parent']; $i <= $key; ++$i) { $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] .= $a[$dom[$i]['elkey']]; } } - if (($dom[$key]['value'] == 'table') AND (!empty($dom[($dom[$key]['parent'])]['thead']))) { + if (($dom[$key]['value'] == 'table') AND (!$this->empty_string($dom[($dom[$key]['parent'])]['thead']))) { $dom[($dom[$key]['parent'])]['thead'] .= '
    diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index f7a86d9..d8393f2 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, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    @@ -18634,7 +18683,7 @@ $font)
    -

    method _putviewerpreferences [line 6116]

    +

    method _putviewerpreferences [line 6129]

    diff --git a/doc/index.html b/doc/index.html index f7a86d9..d8393f2 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, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/errors.html b/doc/errors.html index c57d0d9..3bf022c 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

    - Documentation generated on Wed, 15 Apr 2009 19:08:30 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:22 +0200 by phpDocumentor 1.4.1
    @@ -18665,7 +18714,7 @@ $font)
    -

    method _putxobjectdict [line 5960]

    +

    method _putxobjectdict [line 5973]

    diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index a69278c..7014d54 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -420,6 +420,8 @@
    in file tcpdf.php, variable TCPDF::$extgstates
        Array of transparency objects and parameters.
    Ellipse
    in file tcpdf.php, method TCPDF::Ellipse()
        Draws an ellipse.
    +
    empty_string
    +
    in file tcpdf.php, method TCPDF::empty_string()
        Determine whether a string is empty.
    encode_code39_ext
    in file barcodes.php, method TCPDFBarcode::encode_code39_ext()
        Encode a string to be used for CODE 39 Extended mode.
    endPage
    @@ -1371,7 +1373,7 @@ top

    - Documentation generated on Wed, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    diff --git a/doc/elementindex.html b/doc/elementindex.html index 72f30d6..53f0706 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -271,6 +271,8 @@
    in file tcpdf.php, variable TCPDF::$extgstates
        Array of transparency objects and parameters.
    Ellipse
    in file tcpdf.php, method TCPDF::Ellipse()
        Draws an ellipse.
    +
    empty_string
    +
    in file tcpdf.php, method TCPDF::empty_string()
        Determine whether a string is empty.
    encode_code39_ext
    in file barcodes.php, method TCPDFBarcode::encode_code39_ext()
        Encode a string to be used for CODE 39 Extended mode.
    endPage
    @@ -1348,7 +1350,7 @@ top

    - Documentation generated on Wed, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    @@ -18690,7 +18739,7 @@ $font)
    -

    method _RC4 [line 6884]

    +

    method _RC4 [line 6898]

    diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index fdb4822..9b50925 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, 15 Apr 2009 19:08:30 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:22 +0200 by phpDocumentor 1.4.1
    @@ -18741,7 +18790,7 @@ $text)
    -

    method _textstring [line 6387]

    +

    method _textstring [line 6400]

    diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index 5fa53f7..c025d5b 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte - + @@ -104,7 +104,7 @@ unicode data

    diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index 46ec6aa..cff9397 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, 15 Apr 2009 19:08:25 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    @@ -18780,7 +18829,7 @@ $s)
    -

    method _toJPEG [line 4509]

    +

    method _toJPEG [line 4518]

    diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index d208206..4655d60 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, 15 Apr 2009 19:08:30 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:22 +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 bbc27c8..b4aeef1 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, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    @@ -18822,7 +18871,7 @@ $file)
    -

    method _Uvalue [line 6950]

    +

    method _Uvalue [line 6964]

    diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index 686c199..db55514 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1368,7 +1368,7 @@ $type)

    - Documentation generated on Wed, 15 Apr 2009 19:08:24 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:16 +0200 by phpDocumentor 1.4.1
    @@ -18859,7 +18908,7 @@ $file)

    - Documentation generated on Wed, 15 Apr 2009 19:08:25 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:17 +0200 by phpDocumentor 1.4.1
    author:  Nicola Asuni
    version:  4.5.043version:  4.6.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.5.043 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 4.6.000 (http://www.tcpdf.org)'
    @@ -115,7 +115,7 @@ unicode data


    - Documentation generated on Wed, 15 Apr 2009 19:08:25 +0200 by phpDocumentor 1.4.1 + Documentation generated on Thu, 16 Apr 2009 17:53:17 +0200 by phpDocumentor 1.4.1
    '; } } else { @@ -10830,11 +10844,11 @@ if (!class_exists('TCPDF', false)) { $dom[$key]['fontstyle'] .= '"I'; } // font color - if (isset($dom[$key]['style']['color']) AND (!empty($dom[$key]['style']['color']))) { + if (isset($dom[$key]['style']['color']) AND (!$this->empty_string($dom[$key]['style']['color']))) { $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['style']['color']); } // background color - if (isset($dom[$key]['style']['background-color']) AND (!empty($dom[$key]['style']['background-color']))) { + if (isset($dom[$key]['style']['background-color']) AND (!$this->empty_string($dom[$key]['style']['background-color']))) { $dom[$key]['bgcolor'] = $this->convertHTMLColorToDec($dom[$key]['style']['background-color']); } // text-decoration @@ -10842,7 +10856,7 @@ if (!class_exists('TCPDF', false)) { $decors = explode(' ', strtolower($dom[$key]['style']['text-decoration'])); foreach ($decors as $dec) { $dec = trim($dec); - if (!empty($dec)) { + if (!$this->empty_string($dec)) { if ($dec{0} == 'u') { $dom[$key]['fontstyle'] .= 'U'; } elseif ($dec{0} == 'l') { @@ -10898,7 +10912,7 @@ if (!class_exists('TCPDF', false)) { } // force natural alignment for lists if ((($dom[$key]['value'] == 'ul') OR ($dom[$key]['value'] == 'ol') OR ($dom[$key]['value'] == 'dl')) - AND (!isset($dom[$key]['align']) OR empty($dom[$key]['align']) OR ($dom[$key]['align'] != 'J'))) { + AND (!isset($dom[$key]['align']) OR $this->empty_string($dom[$key]['align']) OR ($dom[$key]['align'] != 'J'))) { if ($this->rtl) { $dom[$key]['align'] = 'R'; } else { @@ -10955,11 +10969,11 @@ if (!class_exists('TCPDF', false)) { $dom[($dom[$key]['parent'])]['cols'] += $colspan; } // set foreground color attribute - if (isset($dom[$key]['attribute']['color']) AND (!empty($dom[$key]['attribute']['color']))) { + if (isset($dom[$key]['attribute']['color']) AND (!$this->empty_string($dom[$key]['attribute']['color']))) { $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['color']); } // set background color attribute - if (isset($dom[$key]['attribute']['bgcolor']) AND (!empty($dom[$key]['attribute']['bgcolor']))) { + if (isset($dom[$key]['attribute']['bgcolor']) AND (!$this->empty_string($dom[$key]['attribute']['bgcolor']))) { $dom[$key]['bgcolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['bgcolor']); } // check for width attribute @@ -10971,7 +10985,7 @@ if (!class_exists('TCPDF', false)) { $dom[$key]['height'] = $dom[$key]['attribute']['height']; } // check for text alignment - if (isset($dom[$key]['attribute']['align']) AND (!empty($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { + if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align']{0}); } } // end opening tag @@ -11049,7 +11063,7 @@ if (!class_exists('TCPDF', false)) { $this->listindent = $this->GetStringWidth('0000'); } $this->listnum = 0; - if ((empty($this->lasth))OR ($reseth)) { + if (($this->empty_string($this->lasth)) OR ($reseth)) { //set row height $this->lasth = $this->FontSize * $this->cell_height_ratio; } @@ -11076,13 +11090,15 @@ if (!class_exists('TCPDF', false)) { $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; } // line to be moved one page forward - $linebeg = substr($this->getPageBuffer($startlinepage), $startlinepos, ($curpos - $startlinepos)); - $tstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); + $pagebuff = $this->getPageBuffer($startlinepage); + $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); + $tstart = substr($pagebuff, 0, $startlinepos); $tend = substr($this->getPageBuffer($startlinepage), $curpos); // remove line start from previous page $this->setPageBuffer($startlinepage, $tstart.''.$tend); - $tstart = substr($this->getPageBuffer($this->page), 0, $this->intmrk[$this->page]); - $tend = substr($this->getPageBuffer($this->page), $this->intmrk[$this->page]); + $pagebuff = $this->getPageBuffer($this->page); + $tstart = substr($pagebuff, 0, $this->intmrk[$this->page]); + $tend = substr($pagebuff, $this->intmrk[$this->page]); // add line start to current page $yshift = $minstartliney - $this->y; $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); @@ -11123,13 +11139,15 @@ if (!class_exists('TCPDF', false)) { $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; } // line to be moved one page forward - $linebeg = substr($this->getPageBuffer($startlinepage), $startlinepos, ($curpos - $startlinepos)); - $tstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); + $pagebuff = $this->getPageBuffer($startlinepage); + $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); + $tstart = substr($pagebuff, 0, $startlinepos); $tend = substr($this->getPageBuffer($startlinepage), $curpos); // remove line start from previous page $this->setPageBuffer($startlinepage, $tstart.''.$tend); - $tstart = substr($this->getPageBuffer($this->page), 0, $this->intmrk[$this->page]); - $tend = substr($this->getPageBuffer($this->page), $this->intmrk[$this->page]); + $pagebuff = $this->getPageBuffer($this->page); + $tstart = substr($pagebuff, 0, $this->intmrk[$this->page]); + $tend = substr($pagebuff, $this->intmrk[$this->page]); // add line start to current page $yshift = $minstartliney - $this->y; $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); @@ -11171,7 +11189,7 @@ if (!class_exists('TCPDF', false)) { if (isset($dom[$key]['align'])) { $lalign = $dom[$key]['align']; } - if (empty($lalign)) { + if ($this->empty_string($lalign)) { $lalign = $align; } } @@ -11628,11 +11646,13 @@ if (!class_exists('TCPDF', false)) { $this->x += ($cellspacingx / 2); } else { // opening tag (or self-closing tag) - if (!isset($opentagpos)) { - if (isset($this->footerlen[$this->page])) { - $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; - } else { - $this->footerpos[$this->page] = $this->pagelen[$this->page]; + if (!isset($opentagpos)) { + if (!$this->InFooter) { + if (isset($this->footerlen[$this->page])) { + $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; + } else { + $this->footerpos[$this->page] = $this->pagelen[$this->page]; + } } $opentagpos = $this->footerpos[$this->page]; } @@ -11644,7 +11664,7 @@ if (!class_exists('TCPDF', false)) { } } elseif (strlen($dom[$key]['value']) > 0) { // print list-item - if (!empty($this->lispacer)) { + if (!$this->empty_string($this->lispacer)) { $this->SetFont($pfontname, $pfontstyle, $pfontsize); $this->lasth = $this->FontSize * $this->cell_height_ratio; $minstartliney = $this->y; @@ -11828,7 +11848,7 @@ if (!class_exists('TCPDF', false)) { $cp = 0; $cs = 0; $dom[$key]['rowspans'] = array(); - if (!empty($dom[$key]['thead'])) { + if (!$this->empty_string($dom[$key]['thead'])) { // set table header $this->thead = $dom[$key]['thead']; } @@ -11887,7 +11907,7 @@ if (!class_exists('TCPDF', false)) { $decors = explode(' ', strtolower($astyle['text-decoration'])); foreach ($decors as $dec) { $dec = trim($dec); - if (!empty($dec)) { + if (!$this->empty_string($dec)) { if ($dec{0} == 'u') { $this->HREF['style'] .= 'U'; } elseif ($dec{0} == 'l') { @@ -11937,7 +11957,7 @@ if (!class_exists('TCPDF', false)) { } } $fileinfo = pathinfo($tag['attribute']['src']); - if (isset($fileinfo['extension']) AND (!empty($fileinfo['extension']))) { + if (isset($fileinfo['extension']) AND (!$this->empty_string($fileinfo['extension']))) { $type = strtolower($fileinfo['extension']); } $prevy = $this->y; @@ -11950,7 +11970,7 @@ if (!class_exists('TCPDF', false)) { } } $imglink = ''; - if (isset($this->HREF['url']) AND !empty($this->HREF['url'])) { + if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) { $imglink = $this->HREF['url']; if ($imglink{0} == '#') { // convert url to internal link @@ -12023,18 +12043,20 @@ if (!class_exists('TCPDF', false)) { $this->rMargin += $this->listindent; } else { $this->lMargin += $this->listindent; - } + } + $this->addHTMLVertSpace(0, $cell, '', $firstorlast, $tag['value'], false); + $this->htmlvspace = 0; break; } case 'li': { $this->addHTMLVertSpace(1, $cell, '', $firstorlast, $tag['value'], false); if ($this->listordered[$this->listnum]) { // ordered item - if (!empty($parent['attribute']['type'])) { + if (isset($parent['attribute']['type']) AND !$this->empty_string($parent['attribute']['type'])) { $this->lispacer = $parent['attribute']['type']; - } elseif (!empty($parent['listtype'])) { + } elseif (isset($parent['listtype']) AND !$this->empty_string($parent['listtype'])) { $this->lispacer = $parent['listtype']; - } elseif (!empty($this->lisymbol)) { + } elseif (isset($this->lisymbol) AND !$this->empty_string($this->lisymbol)) { $this->lispacer = $this->lisymbol; } else { $this->lispacer = '#'; @@ -12045,11 +12067,11 @@ if (!class_exists('TCPDF', false)) { } } else { // unordered item - if (!empty($parent['attribute']['type'])) { + if (isset($parent['attribute']['type']) AND !$this->empty_string($parent['attribute']['type'])) { $this->lispacer = $parent['attribute']['type']; - } elseif (!empty($parent['listtype'])) { + } elseif (isset($parent['listtype']) AND !$this->empty_string($parent['listtype'])) { $this->lispacer = $parent['listtype']; - } elseif (!empty($this->lisymbol)) { + } elseif (isset($this->lisymbol) AND !$this->empty_string($this->lisymbol)) { $this->lispacer = $this->lisymbol; } else { $this->lispacer = '!'; @@ -12281,9 +12303,10 @@ if (!class_exists('TCPDF', false)) { } // design a cell around the text $ccode = $this->FillColor."\n".$this->getCellCode($cw, $ch, '', $cborder, 1, '', $fill, '', 0, true); - if ($cborder OR $fill) { - $pstart = substr($this->getPageBuffer($this->page), 0, $this->intmrk[$this->page]); - $pend = substr($this->getPageBuffer($this->page), $this->intmrk[$this->page]); + if ($cborder OR $fill) { + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $this->intmrk[$this->page]); + $pend = substr($pagebuff, $this->intmrk[$this->page]); $this->setPageBuffer($this->page, $pstart.$ccode."\n".$pend); $this->intmrk[$this->page] += strlen($ccode."\n"); } @@ -12310,9 +12333,10 @@ if (!class_exists('TCPDF', false)) { $pagemark = &$this->footerpos[$this->page]; } else { $pagemark = &$this->intmrk[$this->page]; - } - $pstart = substr($this->getPageBuffer($this->page), 0, $pagemark); - $pend = substr($this->getPageBuffer($this->page), $pagemark); + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); $this->setPageBuffer($this->page, $pstart.$ccode."\n".$pend); $pagemark += strlen($ccode."\n"); } @@ -12336,7 +12360,7 @@ if (!class_exists('TCPDF', false)) { $this->cMargin = $this->oldcMargin; } $this->lasth = $this->FontSize * $this->cell_height_ratio; - if (!empty($table_el['thead']) AND !empty($this->theadMargin)) { + if (!$this->empty_string($table_el['thead']) AND !$this->empty_string($this->theadMargin)) { // reset table header $this->thead = ''; // restore top margin @@ -12858,7 +12882,7 @@ if (!class_exists('TCPDF', false)) { $textitem = $this->listcount[$this->listnum]; } } - if (!empty($textitem)) { + if (!$this->empty_string($textitem)) { // print ordered item if ($this->rtl) { $textitem = '.'.$textitem; @@ -12935,7 +12959,7 @@ if (!class_exists('TCPDF', false)) { $this->htmlvspace = $gvars['htmlvspace']; //$this->lasth = $gvars['lasth']; $this->_out(''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor.''); - if (!empty($this->FontFamily)) { + if (!$this->empty_string($this->FontFamily)) { $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); } } @@ -13000,7 +13024,7 @@ if (!class_exists('TCPDF', false)) { protected function setBuffer($data) { $this->bufferlen += strlen($data); if ($this->diskcache) { - if (!isset($this->buffer) OR empty($this->buffer)) { + if (!isset($this->buffer) OR $this->empty_string($this->buffer)) { $this->buffer = $this->getObjFilename('buffer'); } $this->writeDiskCache($this->buffer, $data, true); @@ -13342,13 +13366,13 @@ if (!class_exists('TCPDF', false)) { $lmargin = $this->lMargin; $rmargin = $this->rMargin; $x_start = $this->GetX(); - if (empty($numbersfont)) { + if ($this->empty_string($numbersfont)) { $numbersfont = $this->default_monospaced_font; } - if (empty($filler)) { + if ($this->empty_string($filler)) { $filler = ' '; } - if (empty($page)) { + if ($this->empty_string($page)) { $gap = ' '; } else { $gap = ''; @@ -13379,7 +13403,7 @@ if (!class_exists('TCPDF', false)) { // write the text $this->Write(0, $outline['t'], $link, 0, $aligntext, false, 0, false, false, 0); $this->SetFont($numbersfont, $fontstyle, $fontsize); - if (empty($page)) { + if ($this->empty_string($page)) { $pagenum = $outline['p']; } else { // placemark to be replaced with the correct number @@ -13415,7 +13439,7 @@ if (!class_exists('TCPDF', false)) { } $page_last = $this->getPage(); $numpages = $page_last - $page_first + 1; - if (!empty($page)) { + if (!$this->empty_string($page)) { for($p = $page_first; $p <= $page_last; ++$p) { // get page data $temppage = $this->getPageBuffer($p); @@ -13521,12 +13545,23 @@ if (!class_exists('TCPDF', false)) { * Creates a copy of a class object * @param object $object class object to be cloned * @return cloned object - * @access protected + * @access public * @since 4.5.029 (2009-03-19) */ public function objclone($object) { return @clone($object); } + + /** + * Determine whether a string is empty. + * @param srting $str string to be checked + * @return boolean true if string is empty + * @access public + * @since 4.5.044 (2009-04-16) + */ + public function empty_string($str) { + return (is_null($str) OR (is_string($str) AND (strlen($str) == 0))); + } } // END OF TCPDF CLASS }