From 0f5adf20410611f15ed51bc00efe27de1d2f1725 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Mon, 12 Apr 2010 17:23:15 +0200 Subject: [PATCH] 4.9.012 --- CHANGELOG.TXT | 109 +- README.TXT | 4 +- doc/classtrees_com-tecnick-tcpdf.html | 2 +- doc/com-tecnick-tcpdf/QRcode.html | 2 +- doc/com-tecnick-tcpdf/TCPDF.html | 216 +- doc/com-tecnick-tcpdf/TCPDF2DBarcode.html | 2 +- doc/com-tecnick-tcpdf/TCPDFBarcode.html | 2 +- doc/com-tecnick-tcpdf/_2dbarcodes.php.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/_qrcode.php.html | 2 +- doc/com-tecnick-tcpdf/_tcpdf.php.html | 6 +- doc/com-tecnick-tcpdf/_unicode_data.php.html | 2 +- doc/elementindex.html | 8 +- doc/elementindex_com-tecnick-tcpdf.html | 8 +- doc/errors.html | 2 +- doc/index.html | 2 +- doc/li_com-tecnick-tcpdf.html | 2 +- examples/example_046.php | 37 +- tcpdf.php | 4788 +++++++++-------- 21 files changed, 2803 insertions(+), 2399 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 276d9ef..0258d25 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,87 +1,90 @@ +4.9.012 (2010-04-12) + - The hyphenateText() method was added to automatically hyphenate text (see example n. 46). + 4.9.011 (2010-04-07) - - Vertical alignments for Cell() method were improved (see example n. 57). + - Vertical alignments for Cell() method were improved (see example n. 57). 4.9.010 (2010-04-06) - - Signature of Cell() method now includes a new parameters for vertical alignment (see example n. 57). - - Text() method was extended to include all Cell() parameters. - - HTML line alignment procedure was changed to fix some bugs. + - Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57). + - Text() method was extended to include all Cell() parameters. + - HTML line alignment procedure was changed to fix some bugs. 4.9.009 (2010-04-05) - - Text() method was fixed for backward compatibility. + - Text() method was fixed for backward compatibility. 4.9.008 (2010-04-03) - - Additional line space after table header was removed. - - Support for HTML lists in multicolumn mode was added. - - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26). - - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill. + - Additional line space after table header was removed. + - Support for HTML lists in multicolumn mode was added. + - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26). + - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill. 4.9.007 (2010-04-03) - - Font Descent computation was fixed (patch #2981441). + - Font Descent computation was fixed (patch #2981441). 4.9.006 (2010-04-02) - - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML. - - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information. + - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML. + - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information. 4.9.005 (2010-04-01) - - Bug# 2980354 "Wrong File attachment description with security" was fixed. - - Several problems with HTML line alignment were fixed. - - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language. - - A problem with font name directory was fixed. - - A bug on _destroy() method was fixed. + - Bug# 2980354 "Wrong File attachment description with security" was fixed. + - Several problems with HTML line alignment were fixed. + - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language. + - A problem with font name directory was fixed. + - A bug on _destroy() method was fixed. 4.9.004 (2010-03-31) - - Patch #979681 "GetCharWidth - default character width" was applied (bugfix). + - Patch #979681 "GetCharWidth - default character width" was applied (bugfix). 4.9.003 (2010-03-30) - - Problem of first
on multiple columns was fixed. - - HTML line alignment was fixed. - - A QR-code bug was fixed. + - Problem of first
on multiple columns was fixed. + - HTML line alignment was fixed. + - A QR-code bug was fixed. 4.9.002 (2010-03-29) - - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied. - - Bug #2978607 "2D Barcodes are wrong" was fixed. - - A problem with HTML block tags was fixed. - - Artificial italic for CID-0 fonts was added. - - Several multicolumn bugs were fixed. - - Support for HTML tables on multicolumn was added. + - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied. + - Bug #2978607 "2D Barcodes are wrong" was fixed. + - A problem with HTML block tags was fixed. + - Artificial italic for CID-0 fonts was added. + - Several multicolumn bugs were fixed. + - Support for HTML tables on multicolumn was added. 4.9.001 (2010-03-28) - - QR Code minor bug was fixed. - - Multicolumn mode was added (see the new example n. 10). - - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn(). - - Thai diacritics support were changed (note that this is incompatible with html justification). + - QR Code minor bug was fixed. + - Multicolumn mode was added (see the new example n. 10). + - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn(). + - Thai diacritics support were changed (note that this is incompatible with html justification). 4.9.000 (2010-03-27) - - QR Code (2D barcode) support was added (see example n. 50). - - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark(). - - Limited support for CSS line-height property was added. - - Gradient method now supports Gray, RGB and CMYK space color. - - Example n. 51 was updated. - - Vertical alignment of font inside cell was fixed. - - Support for multiple Thai diacritics was added. - - Bug item #2974929 "Duplicate case values" was fixed. - - Bug item #2976729 "File attachment not working with security" was fixed. + - QR Code (2D barcode) support was added (see example n. 50). + - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark(). + - Limited support for CSS line-height property was added. + - Gradient method now supports Gray, RGB and CMYK space color. + - Example n. 51 was updated. + - Vertical alignment of font inside cell was fixed. + - Support for multiple Thai diacritics was added. + - Bug item #2974929 "Duplicate case values" was fixed. + - Bug item #2976729 "File attachment not working with security" was fixed. -------------------------------------------------------------------------------- 4.8.039 (2010-03-20) - - Problems related to custom locale settings were fixed. - - Problems related to HTML on Header and Footer were fixed. + - Problems related to custom locale settings were fixed. + - Problems related to HTML on Header and Footer were fixed. 4.8.038 (2010-03-13) - - Various bugs related to page-break in HTML mode were fixed. - - Bug item #2968974 "Another pagebreak problem" was fixed. - - Bug item #2969276 "justification problem" was fixed. - - Bug item #2969289 "bug when using justified text and custom headers" was fixed. - - Images are now automatically resized to be contained on the page. - - Some HTML line alignments were fixed. - - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins. + - Various bugs related to page-break in HTML mode were fixed. + - Bug item #2968974 "Another pagebreak problem" was fixed. + - Bug item #2969276 "justification problem" was fixed. + - Bug item #2969289 "bug when using justified text and custom headers" was fixed. + - Images are now automatically resized to be contained on the page. + - Some HTML line alignments were fixed. + - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins. 4.8.037 (2010-03-03) - - Bug item #2962068 was fixed. - - Bug item #2967017 "Problems with and pagebreaks" was fixed. - - Bug item #2967023 "table header lost with pagebreak" was fixed. - - Bug item #2967032 "Header lost with nested tables" was fixed. + - Bug item #2962068 was fixed. + - Bug item #2967017 "Problems with and pagebreaks" was fixed. + - Bug item #2967023 "table header lost with pagebreak" was fixed. + - Bug item #2967032 "Header lost with nested tables" was fixed. 4.8.036 (2010-02-24) - Automatic page break for HTML images was improved. diff --git a/README.TXT b/README.TXT index 0c17bf7..6274a18 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 4.9.011 -Release date: 2010-04-07 +Version: 4.9.012 +Release date: 2010-04-12 Author: Nicola Asuni Copyright (c) 2001-2010: diff --git a/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index 3407cd3..83f3e67 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -55,7 +55,7 @@

- Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
diff --git a/doc/com-tecnick-tcpdf/QRcode.html b/doc/com-tecnick-tcpdf/QRcode.html index 96b7210..2ff2d80 100644 --- a/doc/com-tecnick-tcpdf/QRcode.html +++ b/doc/com-tecnick-tcpdf/QRcode.html @@ -5548,7 +5548,7 @@ $frame)

- Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by phpDocumentor 1.4.3
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index b11c5c8..e11c1d9 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -80,7 +80,7 @@ Source Location: /tcpdf.php

Version:

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

  • getHeaderMargin
  • getHtmlDomArray
  • getHTMLUnitToUnits
  • +
  • getHyphenPatternsFromTEX
  • getImageBuffer
  • getImageFileType
  • getImageRBX
  • @@ -405,6 +406,8 @@ Source Location: /tcpdf.php

  • get_mqr
  • Gradient
  • Header
  • +
  • hyphenateText
  • +
  • hyphenateWord
  • Image
  • ImageEps
  • ImagePngAlpha
  • @@ -662,7 +665,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  4.9.011 + version:  4.9.012 link:  http://www.tcpdf.org @@ -10013,6 +10016,51 @@ $point)
    [ Top ]
    +
    + +

    method getHyphenPatternsFromTEX [line 17545]

    +
    +
    +
    + array getHyphenPatternsFromTEX( +string +$file) +
    +

    + + Returns an array of hyphenation patterns.



    +

    Tags:

    +
    + + + + + + + + + + + + + +
    return:  of hyphenation patterns
    author:  Nicola Asuni
    since:  4.9.012 (2010-04-12)
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + +
    string  $file  TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
    +

    +
    [ Top ]
    +

    method getImageBuffer [line 16711]

    @@ -11154,6 +11202,168 @@ $coords)
    [ Top ]
    +
    + +

    method hyphenateText [line 17584]

    +
    +
    +
    + array hyphenateText( +string +$text, mixed +$patterns, [array +$dictionary = array()], [int +$leftmin = 1], [int +$rightmin = 2], [int +$charmin = 1], [int +$charmax = 8]) +
    +

    + + Returns text with soft hyphens.



    +

    Tags:

    +
    + + + + + + + + + + + + + +
    return:  text with soft hyphens
    author:  Nicola Asuni
    since:  4.9.012 (2010-04-12)
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    string  $text  text to process
    mixed  $patterns  Array of hypenation patterns or a TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
    array  $dictionary  Array of words to be returned without applying the hyphenation algoritm.
    int  $leftmin  Minimum number of character to leave on the left of the word without applying the hyphens.
    int  $rightmin  Minimum number of character to leave on the right of the word without applying the hyphens.
    int  $charmin  Minimum word lenght to apply the hyphenation algoritm.
    int  $charmax  Maximum lenght of broken piece of word.
    +

    +
    [ Top ]
    +
    +
    + +

    method hyphenateWord [line 17475]

    +
    +
    +
    + array hyphenateWord( +array +$word, array +$patterns, [array +$dictionary = array()], [int +$leftmin = 1], [int +$rightmin = 2], [int +$charmin = 1], [int +$charmax = 8]) +
    +

    + + Returns an array of chars containing soft hyphens.



    +

    Tags:

    +
    + + + + + + + + + + + + + +
    return:  text with soft hyphens
    author:  Nicola Asuni
    since:  4.9.012 (2010-04-12)
    access:  protected
    +
    +

    + + +

    Parameters:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    array  $word  array of chars
    array  $patterns  Array of hypenation patterns.
    array  $dictionary  Array of words to be returned without applying the hyphenation algoritm.
    int  $leftmin  Minimum number of character to leave on the left of the word without applying the hyphens.
    int  $rightmin  Minimum number of character to leave on the right of the word without applying the hyphens.
    int  $charmin  Minimum word lenght to apply the hyphenation algoritm.
    int  $charmax  Maximum lenght of broken piece of word.
    +

    +
    [ Top ]
    +

    method Image [line 5065]

    @@ -22281,7 +22491,7 @@ $file)

    - Documentation generated on Wed, 07 Apr 2010 10:00:56 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html b/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html index 2bc81c5..2ba8aa6 100644 --- a/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html @@ -296,7 +296,7 @@ $type)

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index efcb12a..d096f3e 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1374,7 +1374,7 @@ $type)

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_2dbarcodes.php.html b/doc/com-tecnick-tcpdf/_2dbarcodes.php.html index 0c918d2..bcb9b83 100644 --- a/doc/com-tecnick-tcpdf/_2dbarcodes.php.html +++ b/doc/com-tecnick-tcpdf/_2dbarcodes.php.html @@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html index 1a4a207..5f3031d 100644 --- a/doc/com-tecnick-tcpdf/_barcodes.php.html +++ b/doc/com-tecnick-tcpdf/_barcodes.php.html @@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index 985ed87..a932215 100644 --- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html +++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html @@ -539,7 +539,7 @@ Configuration file for TCPDF.




    - Documentation generated on Wed, 07 Apr 2010 10:00:58 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index f388af6..2869ddd 100644 --- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html +++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html @@ -94,7 +94,7 @@ Array of WEB safe colors.




    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_qrcode.php.html b/doc/com-tecnick-tcpdf/_qrcode.php.html index 63d56cf..6f66cec 100644 --- a/doc/com-tecnick-tcpdf/_qrcode.php.html +++ b/doc/com-tecnick-tcpdf/_qrcode.php.html @@ -477,7 +477,7 @@ string $string, [int $split_length = 1])

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index 4cfb95c..63226d1 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -79,7 +79,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - version:  4.9.011 + version:  4.9.012 copyright:  2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com @@ -110,7 +110,7 @@ unicode data

    - PDF_PRODUCER = 'TCPDF 4.9.011 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 4.9.012 (http://www.tcpdf.org)'
    @@ -121,7 +121,7 @@ unicode data


    - Documentation generated on Wed, 07 Apr 2010 10:00:56 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:01 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index 04096ac..a772781 100644 --- a/doc/com-tecnick-tcpdf/_unicode_data.php.html +++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html @@ -243,7 +243,7 @@ Unicode Include file for TCPDF.




    - Documentation generated on Wed, 07 Apr 2010 10:00:58 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/elementindex.html b/doc/elementindex.html index 3a8da7d..9100bfb 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -603,6 +603,8 @@
    in file tcpdf.php, method TCPDF::getHtmlDomArray()
        Returns the HTML DOM array.
    getHTMLUnitToUnits
    in file tcpdf.php, method TCPDF::getHTMLUnitToUnits()
        Convert HTML string containing value and unit of measure to user's units or points.
    +
    getHyphenPatternsFromTEX
    +
    in file tcpdf.php, method TCPDF::getHyphenPatternsFromTEX()
        Returns an array of hyphenation patterns.
    getImageBuffer
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get image buffer content.
    getImageFileType
    @@ -715,6 +717,10 @@
    in file barcodes.php, method TCPDFBarcode::hex_to_dec()
        Convert large hexadecimal number to decimal representation (string).
    htmlcolors.php
    procedural page htmlcolors.php
    +
    hyphenateText
    +
    in file tcpdf.php, method TCPDF::hyphenateText()
        Returns text with soft hyphens.
    +
    hyphenateWord
    +
    in file tcpdf.php, method TCPDF::hyphenateWord()
        Returns an array of chars containing soft hyphens.
    top
    @@ -1854,7 +1860,7 @@ top

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index 0dfa97f..8e63756 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -766,6 +766,8 @@
    in file tcpdf.php, method TCPDF::getHtmlDomArray()
        Returns the HTML DOM array.
    getHTMLUnitToUnits
    in file tcpdf.php, method TCPDF::getHTMLUnitToUnits()
        Convert HTML string containing value and unit of measure to user's units or points.
    +
    getHyphenPatternsFromTEX
    +
    in file tcpdf.php, method TCPDF::getHyphenPatternsFromTEX()
        Returns an array of hyphenation patterns.
    getImageBuffer
    in file tcpdf.php, method TCPDF::getImageBuffer()
        Get image buffer content.
    getImageFileType
    @@ -878,6 +880,10 @@
    in file barcodes.php, method TCPDFBarcode::hex_to_dec()
        Convert large hexadecimal number to decimal representation (string).
    htmlcolors.php
    procedural page htmlcolors.php
    +
    hyphenateText
    +
    in file tcpdf.php, method TCPDF::hyphenateText()
        Returns text with soft hyphens.
    +
    hyphenateWord
    +
    in file tcpdf.php, method TCPDF::hyphenateWord()
        Returns an array of chars containing soft hyphens.
    top
    @@ -1883,7 +1889,7 @@ top

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/errors.html b/doc/errors.html index a3d8616..08edbd4 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

    - Documentation generated on Wed, 07 Apr 2010 10:00:58 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:04 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/index.html b/doc/index.html index 1f848fb..fd585e8 100644 --- a/doc/index.html +++ b/doc/index.html @@ -64,7 +64,7 @@ This documentation was generated by phpDocumentor v1.4.3

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index 1f848fb..fd585e8 100644 --- a/doc/li_com-tecnick-tcpdf.html +++ b/doc/li_com-tecnick-tcpdf.html @@ -64,7 +64,7 @@ This documentation was generated by phpDocumentor v1.4.3

    - Documentation generated on Wed, 07 Apr 2010 10:00:55 +0200 by phpDocumentor 1.4.3 + Documentation generated on Mon, 12 Apr 2010 17:23:00 +0200 by phpDocumentor 1.4.3
    diff --git a/examples/example_046.php b/examples/example_046.php index 7864fa7..ebd470f 100755 --- a/examples/example_046.php +++ b/examples/example_046.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_046.php // Begin : 2009-02-28 -// Last Update : 2009-09-30 -// +// Last Update : 2010-04-12 +// // Description : Example 046 for TCPDF class // Text Hyphenation -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -76,8 +76,6 @@ $pdf->SetFont('times', '', 10); $pdf->AddPage(); /* -You can use an external class to automatically hyphens the text by adding the SHY characters; - Unicode Data for SHY: Name : SOFT HYPHEN, commonly abbreviated as SHY HTML Entity (decimal): ­ @@ -87,7 +85,24 @@ Unicode Data for SHY: UTF-8 (hex): 0xC2 0xAD (c2ad) */ -// html text with soft hyphens (­) +/* +// You can autmatically add SOFT HYPHENS to your text using +// the hyphenateText() method, but this requires either an +// hyphenation pattern array of a hyphenation pattern TEX file. +// You can download hyphenation TEX patterns from: +// http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + +// EXAMPLE: + +$html = 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.'; + +$hyphen_patterns = $pdf->getHyphenPatternsFromTEX('../hyphens/hyph-en-gb.tex'); + +$html = $pdf->hyphenateText($html, $hyphen_patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8); +*/ + + +// HTML text with soft hyphens (­) $html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures pains to avoid worse pains.'; // print a cell @@ -99,6 +114,6 @@ $pdf->writeHTMLCell(50, 0, '', '', $html, 1, 1, 0, true, 'J'); $pdf->Output('example_046.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/tcpdf.php b/tcpdf.php index 3c176bc..121e96e 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2010-04-07 +// Last Update : 2010-04-12 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.9.011 +// Version : 4.9.012 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. @@ -121,7 +121,7 @@ * @copyright 2002-2010 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.9.011 + * @version 4.9.012 */ /** @@ -145,14 +145,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 4.9.011 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 4.9.012 (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.9.011 + * @version 4.9.012 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -162,387 +162,387 @@ if (!class_exists('TCPDF', false)) { // protected or Protected properties /** - * @var current page number - * @access protected - */ + * @var current page number + * @access protected + */ protected $page; /** - * @var current object number - * @access protected - */ + * @var current object number + * @access protected + */ protected $n; /** - * @var array of object offsets - * @access protected - */ + * @var array of object offsets + * @access protected + */ protected $offsets; /** - * @var buffer holding in-memory PDF - * @access protected - */ + * @var buffer holding in-memory PDF + * @access protected + */ protected $buffer; /** - * @var array containing pages - * @access protected - */ + * @var array containing pages + * @access protected + */ protected $pages = array(); /** - * @var current document state - * @access protected - */ + * @var current document state + * @access protected + */ protected $state; /** - * @var compression flag - * @access protected - */ + * @var compression flag + * @access protected + */ protected $compress; /** - * @var current page orientation (P = Portrait, L = Landscape) - * @access protected - */ + * @var current page orientation (P = Portrait, L = Landscape) + * @access protected + */ protected $CurOrientation; /** - * @var array that stores page dimensions and graphic status. - * @access protected - */ + * @var array that stores page dimensions and graphic status. + * @access protected + */ protected $pagedim = array(); /** - * @var scale factor (number of points in user unit) - * @access protected - */ + * @var scale factor (number of points in user unit) + * @access protected + */ protected $k; /** - * @var width of page format in points - * @access protected - */ + * @var width of page format in points + * @access protected + */ protected $fwPt; /** - * @var height of page format in points - * @access protected - */ + * @var height of page format in points + * @access protected + */ protected $fhPt; /** - * @var current width of page in points - * @access protected - */ + * @var current width of page in points + * @access protected + */ protected $wPt; /** - * @var current height of page in points - * @access protected - */ + * @var current height of page in points + * @access protected + */ protected $hPt; /** - * @var current width of page in user unit - * @access protected - */ + * @var current width of page in user unit + * @access protected + */ protected $w; /** - * @var current height of page in user unit - * @access protected - */ + * @var current height of page in user unit + * @access protected + */ protected $h; /** - * @var left margin - * @access protected - */ + * @var left margin + * @access protected + */ protected $lMargin; /** - * @var top margin - * @access protected - */ + * @var top margin + * @access protected + */ protected $tMargin; /** - * @var right margin - * @access protected - */ + * @var right margin + * @access protected + */ protected $rMargin; /** - * @var page break margin - * @access protected - */ + * @var page break margin + * @access protected + */ protected $bMargin; /** - * @var cell internal padding - * @access protected - */ + * @var cell internal padding + * @access protected + */ //protected public $cMargin; /** - * @var cell internal padding (previous value) - * @access protected - */ + * @var cell internal padding (previous value) + * @access protected + */ protected $oldcMargin; /** - * @var current horizontal position in user unit for cell positioning - * @access protected - */ + * @var current horizontal position in user unit for cell positioning + * @access protected + */ protected $x; /** - * @var current vertical position in user unit for cell positioning - * @access protected - */ + * @var current vertical position in user unit for cell positioning + * @access protected + */ protected $y; /** - * @var height of last cell printed - * @access protected - */ + * @var height of last cell printed + * @access protected + */ protected $lasth; /** - * @var line width in user unit - * @access protected - */ + * @var line width in user unit + * @access protected + */ protected $LineWidth; /** - * @var array of standard font names - * @access protected - */ + * @var array of standard font names + * @access protected + */ protected $CoreFonts; /** - * @var array of used fonts - * @access protected - */ + * @var array of used fonts + * @access protected + */ protected $fonts = array(); /** - * @var array of font files - * @access protected - */ + * @var array of font files + * @access protected + */ protected $FontFiles = array(); /** - * @var array of encoding differences - * @access protected - */ + * @var array of encoding differences + * @access protected + */ protected $diffs = array(); /** - * @var array of used images - * @access protected - */ + * @var array of used images + * @access protected + */ protected $images = array(); /** - * @var array of Annotations in pages - * @access protected - */ + * @var array of Annotations in pages + * @access protected + */ protected $PageAnnots = array(); /** - * @var array of internal links - * @access protected - */ + * @var array of internal links + * @access protected + */ protected $links = array(); /** - * @var current font family - * @access protected - */ + * @var current font family + * @access protected + */ protected $FontFamily; /** - * @var current font style - * @access protected - */ + * @var current font style + * @access protected + */ protected $FontStyle; /** - * @var current font ascent (distance between font top and baseline) - * @access protected - * @since 2.8.000 (2007-03-29) - */ + * @var current font ascent (distance between font top and baseline) + * @access protected + * @since 2.8.000 (2007-03-29) + */ protected $FontAscent; /** - * @var current font descent (distance between font bottom and baseline) - * @access protected - * @since 2.8.000 (2007-03-29) - */ + * @var current font descent (distance between font bottom and baseline) + * @access protected + * @since 2.8.000 (2007-03-29) + */ protected $FontDescent; /** - * @var underlining flag - * @access protected - */ + * @var underlining flag + * @access protected + */ protected $underline; /** - * @var current font info - * @access protected - */ + * @var current font info + * @access protected + */ protected $CurrentFont; /** - * @var current font size in points - * @access protected - */ + * @var current font size in points + * @access protected + */ protected $FontSizePt; /** - * @var current font size in user unit - * @access protected - */ + * @var current font size in user unit + * @access protected + */ protected $FontSize; /** - * @var commands for drawing color - * @access protected - */ + * @var commands for drawing color + * @access protected + */ protected $DrawColor; /** - * @var commands for filling color - * @access protected - */ + * @var commands for filling color + * @access protected + */ protected $FillColor; /** - * @var commands for text color - * @access protected - */ + * @var commands for text color + * @access protected + */ protected $TextColor; /** - * @var indicates whether fill and text colors are different - * @access protected - */ + * @var indicates whether fill and text colors are different + * @access protected + */ protected $ColorFlag; /** - * @var automatic page breaking - * @access protected - */ + * @var automatic page breaking + * @access protected + */ protected $AutoPageBreak; /** - * @var threshold used to trigger page breaks - * @access protected - */ + * @var threshold used to trigger page breaks + * @access protected + */ protected $PageBreakTrigger; /** - * @var flag set when processing footer - * @access protected - */ + * @var flag set when processing footer + * @access protected + */ protected $InFooter = false; /** - * @var zoom display mode - * @access protected - */ + * @var zoom display mode + * @access protected + */ protected $ZoomMode; /** - * @var layout display mode - * @access protected - */ + * @var layout display mode + * @access protected + */ protected $LayoutMode; /** - * @var title - * @access protected - */ + * @var title + * @access protected + */ protected $title = ''; /** - * @var subject - * @access protected - */ + * @var subject + * @access protected + */ protected $subject = ''; /** - * @var author - * @access protected - */ + * @var author + * @access protected + */ protected $author = ''; /** - * @var keywords - * @access protected - */ + * @var keywords + * @access protected + */ protected $keywords = ''; /** - * @var creator - * @access protected - */ + * @var creator + * @access protected + */ protected $creator = ''; /** - * @var alias for total number of pages - * @access protected - */ + * @var alias for total number of pages + * @access protected + */ protected $AliasNbPages = '{nb}'; /** - * @var alias for page number - * @access protected - */ + * @var alias for page number + * @access protected + */ protected $AliasNumPage = '{pnb}'; /** - * @var right-bottom corner X coordinate of inserted image - * @since 2002-07-31 - * @author Nicola Asuni - * @access protected - */ + * @var right-bottom corner X coordinate of inserted image + * @since 2002-07-31 + * @author Nicola Asuni + * @access protected + */ protected $img_rb_x; /** - * @var right-bottom corner Y coordinate of inserted image - * @since 2002-07-31 - * @author Nicola Asuni - * @access protected - */ + * @var right-bottom corner Y coordinate of inserted image + * @since 2002-07-31 + * @author Nicola Asuni + * @access protected + */ protected $img_rb_y; /** - * @var adjusting factor to convert pixels to user units. - * @since 2004-06-14 - * @author Nicola Asuni - * @access protected - */ + * @var adjusting factor to convert pixels to user units. + * @since 2004-06-14 + * @author Nicola Asuni + * @access protected + */ protected $imgscale = 1; /** - * @var boolean set to true when the input text is unicode (require unicode fonts) - * @since 2005-01-02 - * @author Nicola Asuni - * @access protected - */ + * @var boolean set to true when the input text is unicode (require unicode fonts) + * @since 2005-01-02 + * @author Nicola Asuni + * @access protected + */ protected $isunicode = false; /** - * @var PDF version - * @since 1.5.3 - * @access protected - */ + * @var PDF version + * @since 1.5.3 + * @access protected + */ protected $PDFVersion = '1.7'; @@ -1737,12 +1737,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the page format - * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). - * @param string $orientation page orientation. Possible values are (case insensitive): - * @access public - * @since 3.0.015 (2008-06-06) - */ + * Set the page format + * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). + * @param string $orientation page orientation. Possible values are (case insensitive): + * @access public + * @since 3.0.015 (2008-06-06) + */ public function setPageFormat($format, $orientation='P') { //Page format if (is_string($format)) { @@ -1809,13 +1809,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set page orientation. - * @param string $orientation page orientation. Possible values are (case insensitive): - * @param boolean $autopagebreak Boolean indicating if auto-page-break mode should be on or off. - * @param float $bottommargin bottom margin of the page. - * @access public - * @since 3.0.015 (2008-06-06) - */ + * Set page orientation. + * @param string $orientation page orientation. Possible values are (case insensitive): + * @param boolean $autopagebreak Boolean indicating if auto-page-break mode should be on or off. + * @param float $bottommargin bottom margin of the page. + * @access public + * @since 3.0.015 (2008-06-06) + */ public function setPageOrientation($orientation, $autopagebreak='', $bottommargin='') { $orientation = strtoupper($orientation); if (($orientation == 'P') OR ($orientation == 'PORTRAIT')) { @@ -1870,7 +1870,7 @@ if (!class_exists('TCPDF', false)) { * @param Boolean $enable if true enable Right-To-Left language mode. * @param Boolean $resetx if true reset the X position on direction change. * @access public - * @since 2.0.000 (2008-01-03) + * @since 2.0.000 (2008-01-03) */ public function setRTL($enable, $resetx=true) { $enable = $enable ? true : false; @@ -1893,11 +1893,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Force temporary RTL language direction - * @param mixed $mode can be false, 'L' for LTR or 'R' for RTL - * @access public - * @since 2.1.000 (2008-01-09) - */ + * Force temporary RTL language direction + * @param mixed $mode can be false, 'L' for LTR or 'R' for RTL + * @access public + * @since 2.1.000 (2008-01-09) + */ public function setTempRTL($mode) { $newmode = false; switch ($mode) { @@ -1937,57 +1937,57 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the last cell height. - * @param float $h cell height. - * @author Nicola Asuni - * @access public - * @since 1.53.0.TC034 - */ + * Set the last cell height. + * @param float $h cell height. + * @author Nicola Asuni + * @access public + * @since 1.53.0.TC034 + */ public function setLastH($h) { $this->lasth = $h; } /** - * Get the last cell height. - * @return last cell height - * @access public - * @since 4.0.017 (2008-08-05) - */ + * Get the last cell height. + * @return last cell height + * @access public + * @since 4.0.017 (2008-08-05) + */ public function getLastH() { return $this->lasth; } /** - * Set the adjusting factor to convert pixels to user units. - * @param float $scale adjusting factor to convert pixels to user units. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ + * Set the adjusting factor to convert pixels to user units. + * @param float $scale adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + */ public function setImageScale($scale) { $this->imgscale = $scale; } /** - * Returns the adjusting factor to convert pixels to user units. - * @return float adjusting factor to convert pixels to user units. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ + * Returns the adjusting factor to convert pixels to user units. + * @return float adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + */ public function getImageScale() { return $this->imgscale; } /** - * Returns an array of page dimensions: - * - * @param int $pagenum page number (empty = current page) - * @return array of page dimensions. - * @author Nicola Asuni - * @access public - * @since 4.5.027 (2009-03-16) - */ + * Returns an array of page dimensions: + * + * @param int $pagenum page number (empty = current page) + * @return array of page dimensions. + * @author Nicola Asuni + * @access public + * @since 4.5.027 (2009-03-16) + */ public function getPageDimensions($pagenum='') { if (empty($pagenum)) { $pagenum = $this->page; @@ -1996,14 +1996,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the page width in units. - * @param int $pagenum page number (empty = current page) - * @return int page width. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ + * Returns the page width in units. + * @param int $pagenum page number (empty = current page) + * @return int page width. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + * @see getPageDimensions() + */ public function getPageWidth($pagenum='') { if (empty($pagenum)) { return $this->w; @@ -2012,14 +2012,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the page height in units. - * @param int $pagenum page number (empty = current page) - * @return int page height. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ + * Returns the page height in units. + * @param int $pagenum page number (empty = current page) + * @return int page height. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + * @see getPageDimensions() + */ public function getPageHeight($pagenum='') { if (empty($pagenum)) { return $this->h; @@ -2028,14 +2028,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the page break margin. - * @param int $pagenum page number (empty = current page) - * @return int page break margin. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ + * Returns the page break margin. + * @param int $pagenum page number (empty = current page) + * @return int page break margin. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + * @see getPageDimensions() + */ public function getBreakMargin($pagenum='') { if (empty($pagenum)) { return $this->bMargin; @@ -2044,26 +2044,26 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the scale factor (number of points in user unit). - * @return int scale factor. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ + * Returns the scale factor (number of points in user unit). + * @return int scale factor. + * @author Nicola Asuni + * @access public + * @since 1.5.2 + */ public function getScaleFactor() { return $this->k; } /** - * Defines the left, top and right margins. - * @param float $left Left margin. - * @param float $top Top margin. - * @param float $right Right margin. Default value is the left one. - * @param boolean $keepmargins if true overwrites the default page margins - * @access public - * @since 1.0 - * @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak() - */ + * Defines the left, top and right margins. + * @param float $left Left margin. + * @param float $top Top margin. + * @param float $right Right margin. Default value is the left one. + * @param boolean $keepmargins if true overwrites the default page margins + * @access public + * @since 1.0 + * @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak() + */ public function SetMargins($left, $top, $right=-1, $keepmargins=false) { //Set left, top and right margins $this->lMargin = $left; @@ -2080,12 +2080,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. - * @param float $margin The margin. - * @access public - * @since 1.4 - * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() - */ + * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. + * @param float $margin The margin. + * @access public + * @since 1.4 + * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() + */ public function SetLeftMargin($margin) { //Set left margin $this->lMargin=$margin; @@ -2095,12 +2095,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the top margin. The method can be called before creating the first page. - * @param float $margin The margin. - * @access public - * @since 1.5 - * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() - */ + * Defines the top margin. The method can be called before creating the first page. + * @param float $margin The margin. + * @access public + * @since 1.5 + * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() + */ public function SetTopMargin($margin) { //Set top margin $this->tMargin=$margin; @@ -2110,12 +2110,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the right margin. The method can be called before creating the first page. - * @param float $margin The margin. - * @access public - * @since 1.5 - * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() - */ + * Defines the right margin. The method can be called before creating the first page. + * @param float $margin The margin. + * @access public + * @since 1.5 + * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() + */ public function SetRightMargin($margin) { $this->rMargin=$margin; if (($this->page > 0) AND ($this->x > ($this->w - $margin))) { @@ -2124,24 +2124,24 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the internal Cell padding. - * @param float $pad internal padding. - * @access public - * @since 2.1.000 (2008-01-09) - * @see Cell(), SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() - */ + * Set the internal Cell padding. + * @param float $pad internal padding. + * @access public + * @since 2.1.000 (2008-01-09) + * @see Cell(), SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() + */ public function SetCellPadding($pad) { $this->cMargin = $pad; } /** - * Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm. - * @param boolean $auto Boolean indicating if mode should be on or off. - * @param float $margin Distance from the bottom of the page. - * @access public - * @since 1.0 - * @see Cell(), MultiCell(), AcceptPageBreak() - */ + * Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm. + * @param boolean $auto Boolean indicating if mode should be on or off. + * @param float $margin Distance from the bottom of the page. + * @access public + * @since 1.0 + * @see Cell(), MultiCell(), AcceptPageBreak() + */ public function SetAutoPageBreak($auto, $margin=0) { //Set auto page break mode and triggering margin $this->AutoPageBreak = $auto; @@ -2150,13 +2150,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the way the document is to be displayed by the viewer. - * @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. - * @param string $layout The page layout. Possible values are: - * @param string $mode A name object specifying how the document should be displayed when opened: - * @access public - * @since 1.2 - */ + * Defines the way the document is to be displayed by the viewer. + * @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. + * @param string $layout The page layout. Possible values are: + * @param string $mode A name object specifying how the document should be displayed when opened: + * @access public + * @since 1.2 + */ public function SetDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') { //Set display mode in viewer if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) { @@ -2229,12 +2229,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default. - * Note: the Zlib extension is required for this feature. If not present, compression will be turned off. - * @param boolean $compress Boolean indicating if compression must be enabled. - * @access public - * @since 1.4 - */ + * Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default. + * Note: the Zlib extension is required for this feature. If not present, compression will be turned off. + * @param boolean $compress Boolean indicating if compression must be enabled. + * @access public + * @since 1.4 + */ public function SetCompression($compress) { //Set page compression if (function_exists('gzcompress')) { @@ -2245,72 +2245,72 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the title of the document. - * @param string $title The title. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject() - */ + * Defines the title of the document. + * @param string $title The title. + * @access public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject() + */ public function SetTitle($title) { //Title of document $this->title = $title; } /** - * Defines the subject of the document. - * @param string $subject The subject. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle() - */ + * Defines the subject of the document. + * @param string $subject The subject. + * @access public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle() + */ public function SetSubject($subject) { //Subject of document $this->subject = $subject; } /** - * Defines the author of the document. - * @param string $author The name of the author. - * @access public - * @since 1.2 - * @see SetCreator(), SetKeywords(), SetSubject(), SetTitle() - */ + * Defines the author of the document. + * @param string $author The name of the author. + * @access public + * @since 1.2 + * @see SetCreator(), SetKeywords(), SetSubject(), SetTitle() + */ public function SetAuthor($author) { //Author of document $this->author = $author; } /** - * Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. - * @param string $keywords The list of keywords. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetSubject(), SetTitle() - */ + * Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. + * @param string $keywords The list of keywords. + * @access public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetSubject(), SetTitle() + */ public function SetKeywords($keywords) { //Keywords of document $this->keywords = $keywords; } /** - * Defines the creator of the document. This is typically the name of the application that generates the PDF. - * @param string $creator The name of the creator. - * @access public - * @since 1.2 - * @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle() - */ + * Defines the creator of the document. This is typically the name of the application that generates the PDF. + * @param string $creator The name of the creator. + * @access public + * @since 1.2 + * @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle() + */ public function SetCreator($creator) { //Creator of document $this->creator = $creator; } /** - * This method is automatically called in case of fatal error; it simply outputs the message and halts the execution. An inherited class may override it to customize the error handling but should always halt the script, or the resulting document would probably be invalid. - * 2004-06-11 :: Nicola Asuni : changed bold tag with strong - * @param string $msg The error message - * @access public - * @since 1.0 - */ + * This method is automatically called in case of fatal error; it simply outputs the message and halts the execution. An inherited class may override it to customize the error handling but should always halt the script, or the resulting document would probably be invalid. + * 2004-06-11 :: Nicola Asuni : changed bold tag with strong + * @param string $msg The error message + * @access public + * @since 1.0 + */ public function Error($msg) { // unset all class variables $this->_destroy(true); @@ -2319,26 +2319,26 @@ if (!class_exists('TCPDF', false)) { } /** - * This method begins the generation of the PDF document. - * It is not necessary to call it explicitly because AddPage() does it automatically. - * Note: no page is created by this method - * @access public - * @since 1.0 - * @see AddPage(), Close() - */ + * This method begins the generation of the PDF document. + * It is not necessary to call it explicitly because AddPage() does it automatically. + * Note: no page is created by this method + * @access public + * @since 1.0 + * @see AddPage(), Close() + */ public function Open() { //Begin document $this->state = 1; } /** - * Terminates the PDF document. - * It is not necessary to call this method explicitly because Output() does it automatically. - * If the document contains no page, AddPage() is called to prevent from getting an invalid document. - * @access public - * @since 1.0 - * @see Open(), Output() - */ + * Terminates the PDF document. + * It is not necessary to call this method explicitly because Output() does it automatically. + * If the document contains no page, AddPage() is called to prevent from getting an invalid document. + * @access public + * @since 1.0 + * @see Open(), Output() + */ public function Close() { if ($this->state == 3) { return; @@ -2355,13 +2355,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Move pointer at the specified document page and update page dimensions. - * @param int $pnum page number - * @param boolean $resetmargins if true reset left, right, top margins and Y position. - * @access public - * @since 2.1.000 (2008-01-07) - * @see getPage(), lastpage(), getNumPages() - */ + * Move pointer at the specified document page and update page dimensions. + * @param int $pnum page number + * @param boolean $resetmargins if true reset left, right, top margins and Y position. + * @access public + * @since 2.1.000 (2008-01-07) + * @see getPage(), lastpage(), getNumPages() + */ public function setPage($pnum, $resetmargins=false) { if ($pnum == $this->page) { return; @@ -2403,49 +2403,49 @@ if (!class_exists('TCPDF', false)) { } /** - * Reset pointer to the last document page. - * @param boolean $resetmargins if true reset left, right, top margins and Y position. - * @access public - * @since 2.0.000 (2008-01-04) - * @see setPage(), getPage(), getNumPages() - */ + * Reset pointer to the last document page. + * @param boolean $resetmargins if true reset left, right, top margins and Y position. + * @access public + * @since 2.0.000 (2008-01-04) + * @see setPage(), getPage(), getNumPages() + */ public function lastPage($resetmargins=false) { $this->setPage($this->getNumPages(), $resetmargins); } /** - * Get current document page number. - * @return int page number - * @access public - * @since 2.1.000 (2008-01-07) - * @see setPage(), lastpage(), getNumPages() - */ + * Get current document page number. + * @return int page number + * @access public + * @since 2.1.000 (2008-01-07) + * @see setPage(), lastpage(), getNumPages() + */ public function getPage() { return $this->page; } /** - * Get the total number of insered pages. - * @return int number of pages - * @access public - * @since 2.1.000 (2008-01-07) - * @see setPage(), getPage(), lastpage() - */ + * Get the total number of insered pages. + * @return int number of pages + * @access public + * @since 2.1.000 (2008-01-07) + * @see setPage(), getPage(), lastpage() + */ public function getNumPages() { return $this->numpages; } /** - * Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled). - * The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards. - * @param string $orientation page orientation. Possible values are (case insensitive): - * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). - * @param boolean $keepmargins if true overwrites the default page margins with the current margins - * @access public - * @since 1.0 - * @see startPage(), endPage() - */ + * Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled). + * The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards. + * @param string $orientation page orientation. Possible values are (case insensitive): + * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). + * @param boolean $keepmargins if true overwrites the default page margins with the current margins + * @access public + * @since 1.0 + * @see startPage(), endPage() + */ public function AddPage($orientation='', $format='', $keepmargins=false) { if (!isset($this->original_lMargin) OR $keepmargins) { $this->original_lMargin = $this->lMargin; @@ -2460,11 +2460,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Terminate the current page - * @access protected - * @since 4.2.010 (2008-11-14) - * @see startPage(), AddPage() - */ + * Terminate the current page + * @access protected + * @since 4.2.010 (2008-11-14) + * @see startPage(), AddPage() + */ protected function endPage() { // check if page is already closed if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) { @@ -2481,14 +2481,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Starts a new page to the document. The page must be closed using the endPage() function. - * The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards. - * @param string $orientation page orientation. Possible values are (case insensitive): - * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). - * @access protected - * @since 4.2.010 (2008-11-14) - * @see endPage(), AddPage() - */ + * Starts a new page to the document. The page must be closed using the endPage() function. + * The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards. + * @param string $orientation page orientation. Possible values are (case insensitive): + * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). + * @access protected + * @since 4.2.010 (2008-11-14) + * @see endPage(), AddPage() + */ protected function startPage($orientation='', $format='') { if ($this->numpages > $this->page) { // this page has been already added @@ -2856,28 +2856,28 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the current page number. - * @return int page number - * @access public - * @since 1.0 - * @see AliasNbPages(), getAliasNbPages() - */ + * Returns the current page number. + * @return int page number + * @access public + * @since 1.0 + * @see AliasNbPages(), getAliasNbPages() + */ public function PageNo() { return $this->page; } /** - * Defines a new spot color. - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param int $c Cyan color for CMYK. Value between 0 and 255 - * @param int $m Magenta color for CMYK. Value between 0 and 255 - * @param int $y Yellow color for CMYK. Value between 0 and 255 - * @param int $k Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 4.0.024 (2008-09-12) - * @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor() - */ + * Defines a new spot color. + * It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param int $c Cyan color for CMYK. Value between 0 and 255 + * @param int $m Magenta color for CMYK. Value between 0 and 255 + * @param int $y Yellow color for CMYK. Value between 0 and 255 + * @param int $k Key (Black) color for CMYK. Value between 0 and 255 + * @access public + * @since 4.0.024 (2008-09-12) + * @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor() + */ public function AddSpotColor($name, $c, $m, $y, $k) { if (!isset($this->spot_colors[$name])) { $i = 1 + count($this->spot_colors); @@ -2886,14 +2886,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for all drawing operations (lines, rectangles and cell borders). - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @access public - * @since 3.1.000 (2008-06-11) - * @see SetDrawColor() - */ + * Defines the color used for all drawing operations (lines, rectangles and cell borders). + * It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color array of colors + * @access public + * @since 3.1.000 (2008-06-11) + * @see SetDrawColor() + */ public function SetDrawColorArray($color) { if (isset($color)) { $color = array_values($color); @@ -2908,15 +2908,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 1.3 - * @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell() - */ + * Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 + * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 + * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 + * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 + * @access public + * @since 1.3 + * @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell() + */ public function SetDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1) { // set default values if (!is_numeric($col1)) { @@ -2951,13 +2951,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the spot color used for all drawing operations (lines, rectangles and cell borders). - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor() - */ + * Defines the spot color used for all drawing operations (lines, rectangles and cell borders). + * @param string $name name of the spot color + * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @access public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor() + */ public function SetDrawSpotColor($name, $tint=100) { if (!isset($this->spot_colors[$name])) { $this->Error('Undefined spot color: '.$name); @@ -2969,14 +2969,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for all filling operations (filled rectangles and cell backgrounds). - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @access public - * @since 3.1.000 (2008-6-11) - * @see SetFillColor() - */ + * Defines the color used for all filling operations (filled rectangles and cell backgrounds). + * It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color array of colors + * @access public + * @since 3.1.000 (2008-6-11) + * @see SetFillColor() + */ public function SetFillColorArray($color) { if (isset($color)) { $color = array_values($color); @@ -2991,15 +2991,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 1.3 - * @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell() - */ + * Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 + * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 + * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 + * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 + * @access public + * @since 1.3 + * @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell() + */ public function SetFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1) { // set default values if (!is_numeric($col1)) { @@ -3035,13 +3035,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the spot color used for all filling operations (filled rectangles and cell backgrounds). - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor() - */ + * Defines the spot color used for all filling operations (filled rectangles and cell backgrounds). + * @param string $name name of the spot color + * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @access public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor() + */ public function SetFillSpotColor($name, $tint=100) { if (!isset($this->spot_colors[$name])) { $this->Error('Undefined spot color: '.$name); @@ -3054,13 +3054,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for text. It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @access public - * @since 3.1.000 (2008-6-11) - * @see SetFillColor() - */ + * Defines the color used for text. It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color array of colors + * @access public + * @since 3.1.000 (2008-6-11) + * @see SetFillColor() + */ public function SetTextColorArray($color) { if (isset($color)) { $color = array_values($color); @@ -3075,15 +3075,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 1.3 - * @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell() - */ + * Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 + * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 + * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 + * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 + * @access public + * @since 1.3 + * @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell() + */ public function SetTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1) { // set default values if (!is_numeric($col1)) { @@ -3116,13 +3116,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the spot color used for text. - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor() - */ + * Defines the spot color used for text. + * @param string $name name of the spot color + * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @access public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor() + */ public function SetTextSpotColor($name, $tint=100) { if (!isset($this->spot_colors[$name])) { $this->Error('Undefined spot color: '.$name); @@ -3135,33 +3135,33 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the length of a string in user unit. A font must be selected.
    - * @param string $s The string whose length is to be computed - * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param string $fontstyle Font style. Possible values are (case insensitive): or any combination. The default value is regular. - * @param float $fontsize Font size in points. The default value is the current size. - * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths - * @author Nicola Asuni - * @access public - * @since 1.2 - */ + * Returns the length of a string in user unit. A font must be selected.
    + * @param string $s The string whose length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive): or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return mixed int total string length or array of characted widths + * @author Nicola Asuni + * @access public + * @since 1.2 + */ public function GetStringWidth($s, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { return $this->GetArrStringWidth($this->utf8Bidi($this->UTF8StringToArray($s), $s, $this->tmprtl), $fontname, $fontstyle, $fontsize, $getarray); } /** - * Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.
    - * @param string $sa The array of chars whose total length is to be computed - * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param string $fontstyle Font style. Possible values are (case insensitive): or any combination. The default value is regular. - * @param float $fontsize Font size in points. The default value is the current size. - * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths - * @author Nicola Asuni - * @access public - * @since 2.4.000 (2008-03-06) - */ + * Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.
    + * @param string $sa The array of chars whose total length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive): or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return mixed int total string length or array of characted widths + * @author Nicola Asuni + * @access public + * @since 2.4.000 (2008-03-06) + */ public function GetArrStringWidth($sa, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { // store current values if (!$this->empty_string($fontname)) { @@ -3191,13 +3191,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the length of the char in user unit for the current font. - * @param int $char The char code whose length is to be returned - * @return int char width - * @author Nicola Asuni - * @access public - * @since 2.4.000 (2008-03-06) - */ + * Returns the length of the char in user unit for the current font. + * @param int $char The char code whose length is to be returned + * @return int char width + * @author Nicola Asuni + * @access public + * @since 2.4.000 (2008-03-06) + */ public function GetCharWidth($char) { if ($char == 173) { // SHY character will not be printed @@ -3219,12 +3219,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the numbero of characters in a string. - * @param string $s The input string. - * @return int number of characters - * @access public - * @since 2.0.0001 (2008-01-07) - */ + * Returns the numbero of characters in a string. + * @param string $s The input string. + * @return int number of characters + * @access public + * @since 2.0.0001 (2008-01-07) + */ public function GetNumChars($s) { if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { return count($this->UTF8StringToArray($s)); @@ -3233,10 +3233,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Fill the list of available fonts ($this->fontlist). - * @access protected - * @since 4.0.013 (2008-07-28) - */ + * Fill the list of available fonts ($this->fontlist). + * @access protected + * @since 4.0.013 (2008-07-28) + */ protected function getFontsList() { $fontsdir = opendir($this->_getfontpath()); while (($file = readdir($fontsdir)) !== false) { @@ -3248,17 +3248,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Imports a TrueType, Type1, core, or CID0 font and makes it available. - * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). - * The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. - * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. - * @param string $style Font style. Possible values are (case insensitive): - * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @return array containing the font data, or false in case of error. - * @access public - * @since 1.5 - * @see SetFont() - */ + * Imports a TrueType, Type1, core, or CID0 font and makes it available. + * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). + * The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. + * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. + * @param string $style Font style. Possible values are (case insensitive): + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @return array containing the font data, or false in case of error. + * @access public + * @since 1.5 + * @see SetFont() + */ public function AddFont($family, $style='', $fontfile='') { if ($this->empty_string($family)) { if (!$this->empty_string($this->FontFamily)) { @@ -3444,19 +3444,19 @@ if (!class_exists('TCPDF', false)) { } /** - * Sets the font used to print character strings. - * The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe). - * The method can be called before the first page is created and the font is retained from page to page. - * If you just wish to change the current font size, it is simpler to call SetFontSize(). - * Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:
    - * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive): It is also possible to pass an empty string. In that case, the current family is retained. - * @param string $style Font style. Possible values are (case insensitive): or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. - * @param float $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 - * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @access public - * @since 1.0 - * @see AddFont(), SetFontSize() - */ + * Sets the font used to print character strings. + * The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe). + * The method can be called before the first page is created and the font is retained from page to page. + * If you just wish to change the current font size, it is simpler to call SetFontSize(). + * Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:
    + * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive): It is also possible to pass an empty string. In that case, the current family is retained. + * @param string $style Font style. Possible values are (case insensitive): or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. + * @param float $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @access public + * @since 1.0 + * @see AddFont(), SetFontSize() + */ public function SetFont($family, $style='', $size=0, $fontfile='') { //Select a font; size given in points if ($size == 0) { @@ -3471,12 +3471,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the size of the current font. - * @param float $size The size (in points) - * @access public - * @since 1.0 - * @see SetFont() - */ + * Defines the size of the current font. + * @param float $size The size (in points) + * @access public + * @since 1.0 + * @see SetFont() + */ public function SetFontSize($size) { //Set font size in points $this->FontSizePt = $size; @@ -3497,14 +3497,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Return the font descent value - * @param string $font font name - * @param string $style font style - * @param float $size The size (in points) - * @return int font descent - * @access public - * @since 4.9.003 (2010-03-30) - */ + * Return the font descent value + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) + * @return int font descent + * @access public + * @since 4.9.003 (2010-03-30) + */ public function getFontDescent($font, $style='', $size=0) { //Set font size in points $sizek = $size / $this->k; @@ -3518,14 +3518,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Return the font ascent value - * @param string $font font name - * @param string $style font style - * @param float $size The size (in points) - * @return int font ascent - * @access public - * @since 4.9.003 (2010-03-30) - */ + * Return the font ascent value + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) + * @return int font ascent + * @access public + * @since 4.9.003 (2010-03-30) + */ public function getFontAscent($font, $style='', $size=0) { //Set font size in points $sizek = $size / $this->k; @@ -3539,22 +3539,22 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the default monospaced font. - * @param string $font Font name. - * @access public - * @since 4.5.025 - */ + * Defines the default monospaced font. + * @param string $font Font name. + * @access public + * @since 4.5.025 + */ public function SetDefaultMonospacedFont($font) { $this->default_monospaced_font = $font; } /** - * Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
    - * The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink(). - * @access public - * @since 1.5 - * @see Cell(), Write(), Image(), Link(), SetLink() - */ + * Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
    + * The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink(). + * @access public + * @since 1.5 + * @see Cell(), Write(), Image(), Link(), SetLink() + */ public function AddLink() { //Create a new internal link $n = count($this->links) + 1; @@ -3563,14 +3563,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the page and position a link points to. - * @param int $link The link identifier returned by AddLink() - * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) - * @param int $page Number of target page; -1 indicates the current page. This is the default value - * @access public - * @since 1.5 - * @see AddLink() - */ + * Defines the page and position a link points to. + * @param int $link The link identifier returned by AddLink() + * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) + * @param int $page Number of target page; -1 indicates the current page. This is the default value + * @access public + * @since 1.5 + * @see AddLink() + */ public function SetLink($link, $y=0, $page=-1) { if ($y == -1) { $y = $this->y; @@ -3582,35 +3582,35 @@ if (!class_exists('TCPDF', false)) { } /** - * Puts a link on a rectangular area of the page. - * Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param mixed $link URL or identifier returned by AddLink() - * @param int $spaces number of spaces on the text to link - * @access public - * @since 1.5 - * @see AddLink(), Annotation(), Cell(), Write(), Image() - */ + * Puts a link on a rectangular area of the page. + * Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param mixed $link URL or identifier returned by AddLink() + * @param int $spaces number of spaces on the text to link + * @access public + * @since 1.5 + * @see AddLink(), Annotation(), Cell(), Write(), Image() + */ public function Link($x, $y, $w, $h, $link, $spaces=0) { $this->Annotation($x, $y, $w, $h, $link, array('Subtype'=>'Link'), $spaces); } /** - * Puts a markup annotation on a rectangular area of the page. - * !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!! - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param string $text annotation text or alternate content - * @param array $opt array of options (see section 8.4 of PDF reference 1.7). - * @param int $spaces number of spaces on the text to link - * @access public - * @since 4.0.018 (2008-08-06) - */ + * Puts a markup annotation on a rectangular area of the page. + * !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!! + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param string $text annotation text or alternate content + * @param array $opt array of options (see section 8.4 of PDF reference 1.7). + * @param int $spaces number of spaces on the text to link + * @access public + * @since 4.0.018 (2008-08-06) + */ public function Annotation($x, $y, $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { if ($x === '') { $x = $this->x; @@ -3686,11 +3686,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Embedd the attached files. - * @since 4.4.000 (2008-12-07) - * @access protected - * @see Annotation() - */ + * Embedd the attached files. + * @since 4.4.000 (2008-12-07) + * @access protected + * @see Annotation() + */ protected function _putEmbeddedFiles() { reset($this->embeddedfiles); foreach ($this->embeddedfiles as $filename => $filedata) { @@ -3709,28 +3709,28 @@ if (!class_exists('TCPDF', false)) { } /** - * Prints a text cell at the specified position. - * The origin is on the left of the first charcter, on the baseline. - * This method allows to place a string precisely on the page. - * @param float $x Abscissa of the cell origin - * @param float $y Ordinate of the cell origin - * @param string $txt String to print - * @param int $fstroke outline size in user units (false = disable) - * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). - * @param boolean $ffill if true fills the text - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param int $ln Indicates where the current position should go after the call. Possible values are:Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are: - * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch stretch carachter mode: - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: - * @param string $valign text vertical alignment inside the cell. Possible values are: - * @access public - * @since 1.0 - * @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell() - */ + * Prints a text cell at the specified position. + * The origin is on the left of the first charcter, on the baseline. + * This method allows to place a string precisely on the page. + * @param float $x Abscissa of the cell origin + * @param float $y Ordinate of the cell origin + * @param string $txt String to print + * @param int $fstroke outline size in user units (false = disable) + * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). + * @param boolean $ffill if true fills the text + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param int $ln Indicates where the current position should go after the call. Possible values are:Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are: + * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch stretch carachter mode: + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: + * @param string $valign text vertical alignment inside the cell. Possible values are: + * @access public + * @since 1.0 + * @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell() + */ public function Text($x, $y, $txt, $fstroke=false, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { $textrendermode = $this->textrendermode; $textstrokewidth = $this->textstrokewidth; @@ -3743,14 +3743,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. - * The default implementation returns a value according to the mode selected by SetAutoPageBreak().
    - * This method is called automatically and should not be called directly by the application. - * @return boolean - * @access public - * @since 1.4 - * @see SetAutoPageBreak() - */ + * Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. + * The default implementation returns a value according to the mode selected by SetAutoPageBreak().
    + * This method is called automatically and should not be called directly by the application. + * @return boolean + * @access public + * @since 1.4 + * @see SetAutoPageBreak() + */ public function AcceptPageBreak() { if ($this->num_columns > 1) { // multi column mode @@ -3770,14 +3770,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Add page if needed. - * @param float $h Cell height. Default value: 0. - * @param mixed $y starting y position, leave empty for current position. - * @param boolean $addpage if true add a page, otherwise only return the true/false state - * @return boolean true in case of page break, false otherwise. - * @since 3.2.000 (2008-07-01) - * @access protected - */ + * Add page if needed. + * @param float $h Cell height. Default value: 0. + * @param mixed $y starting y position, leave empty for current position. + * @param boolean $addpage if true add a page, otherwise only return the true/false state + * @return boolean true in case of page break, false otherwise. + * @since 3.2.000 (2008-07-01) + * @access protected + */ protected function checkPageBreak($h=0, $y='', $addpage=true) { if ($this->empty_string($y)) { $y = $this->y; @@ -3809,25 +3809,25 @@ if (!class_exists('TCPDF', false)) { } /** - * Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
    - * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param float $w Cell width. If 0, the cell extends up to the right margin. - * @param float $h Cell height. Default value: 0. - * @param string $txt String to print. Default value: empty string. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param int $ln Indicates where the current position should go after the call. Possible values are: + * Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
    + * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param int $ln Indicates where the current position should go after the call. Possible values are: Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are: - * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch stretch carachter mode: - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: - * @param string $valign text vertical alignment inside the cell. Possible values are: - * @access public - * @since 1.0 - * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak() - */ + * @param string $align Allows to center or align the text. Possible values are: + * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch stretch carachter mode: + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: + * @param string $valign text vertical alignment inside the cell. Possible values are: + * @access public + * @since 1.0 + * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak() + */ public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { if (!$ignore_min_height) { $min_cell_height = $this->FontSize * $this->cell_height_ratio; @@ -3840,12 +3840,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Removes SHY characters from text. - * @param string $txt input string - * @return string without SHY characters. - * @access public - * @since (4.5.019) 2009-02-28 - */ + * Removes SHY characters from text. + * @param string $txt input string + * @return string without SHY characters. + * @access public + * @since (4.5.019) 2009-02-28 + */ public function removeSHY($txt='') { /* * Unicode Data @@ -3865,24 +3865,24 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
    - * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param float $w Cell width. If 0, the cell extends up to the right margin. - * @param float $h Cell height. Default value: 0. - * @param string $txt String to print. Default value: empty string. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param int $ln Indicates where the current position should go after the call. Possible values are:Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are: - * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch stretch carachter mode: - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: - * @param string $valign text vertical alignment inside the cell. Possible values are: - * @access protected - * @since 1.0 - * @see Cell() - */ + * Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
    + * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param int $ln Indicates where the current position should go after the call. Possible values are:Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are: + * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch stretch carachter mode: + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are: + * @param string $valign text vertical alignment inside the cell. Possible values are: + * @access protected + * @since 1.0 + * @see Cell() + */ protected function getCellCode($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { $txt = $this->removeSHY($txt); $rs = ''; //string to be returned @@ -4268,28 +4268,28 @@ if (!class_exists('TCPDF', false)) { } /** - * This method allows printing text with line breaks. - * They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
    - * Text can be aligned, centered or justified. The cell block can be framed and the background painted. - * @param float $w Width of cells. If 0, they extend up to the right margin of the page. - * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param string $txt String to print - * @param mixed $border Indicates if borders must be drawn around the cell block. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param string $align Allows to center or align the text. Possible values are: - * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. - * @param int $ln Indicates where the current position should go after the call. Possible values are: - * @param float $x x position in user units - * @param float $y y position in user units - * @param boolean $reseth if true reset the last cell height (default true). - * @param int $stretch stretch carachter mode: - * @param boolean $ishtml set to true if $txt is HTML content (default = false). - * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. - * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. - * @return int Return the number of cells or 1 for html mode. - * @access public - * @since 1.3 - * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() - */ + * This method allows printing text with line breaks. + * They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
    + * Text can be aligned, centered or justified. The cell block can be framed and the background painted. + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param float $h Cell minimum height. The cell extends automatically if needed. + * @param string $txt String to print + * @param mixed $border Indicates if borders must be drawn around the cell block. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param string $align Allows to center or align the text. Possible values are: + * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. + * @param int $ln Indicates where the current position should go after the call. Possible values are: + * @param float $x x position in user units + * @param float $y y position in user units + * @param boolean $reseth if true reset the last cell height (default true). + * @param int $stretch stretch carachter mode: + * @param boolean $ishtml set to true if $txt is HTML content (default = false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. + * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. + * @return int Return the number of cells or 1 for html mode. + * @access public + * @since 1.3 + * @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 ($this->empty_string($this->lasth) OR $reseth) { //set row height @@ -4442,13 +4442,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) - * @param mixed $border Indicates if borders must be drawn around the cell block. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param string multicell position: 'start', 'middle', 'end' - * @return border mode - * @access protected - * @since 4.4.002 (2008-12-09) - */ + * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) + * @param mixed $border Indicates if borders must be drawn around the cell block. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param string multicell position: 'start', 'middle', 'end' + * @return border mode + * @access protected + * @since 4.4.002 (2008-12-09) + */ protected function getBorderMode($border, $position='start') { if ((!$this->opencell) AND ($border == 1)) { return 1; @@ -4521,22 +4521,22 @@ if (!class_exists('TCPDF', false)) { } /** - * This method returns the estimated number of lines required to print the text (not the real number just a quick estimation). - * If you want o know the exact number of lines you have to use the following technique: - *
    -		*  // store current object
    -		*  $pdf->startTransaction();
    -		*  // get the number of lines for multicell
    -		*  $lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
    -		*  // restore previous object
    -		*  $pdf = $pdf->rollbackTransaction();
    -		* 
    - * @param string $txt text to print - * @param float $w width of cell. If 0, they extend up to the right margin of the page. - * @return int Return the estimated number of lines. - * @access public - * @since 4.5.011 - */ + * This method returns the estimated number of lines required to print the text (not the real number just a quick estimation). + * If you want o know the exact number of lines you have to use the following technique: + *
    +		 *  // store current object
    +		 *  $pdf->startTransaction();
    +		 *  // get the number of lines for multicell
    +		 *  $lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
    +		 *  // restore previous object
    +		 *  $pdf = $pdf->rollbackTransaction();
    +		 * 
    + * @param string $txt text to print + * @param float $w width of cell. If 0, they extend up to the right margin of the page. + * @return int Return the estimated number of lines. + * @access public + * @since 4.5.011 + */ public function getNumLines($txt, $w=0) { $lines = 0; if ($this->empty_string($w) OR ($w <= 0)) { @@ -4566,21 +4566,21 @@ if (!class_exists('TCPDF', false)) { } /** - * This method prints text from the current position.
    - * @param float $h Line height - * @param string $txt String to print - * @param mixed $link URL or identifier returned by AddLink() - * @param int $fill Indicates if the background must be painted (1) or transparent (0). Default value: 0. - * @param string $align Allows to center or align the text. Possible values are: - * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. - * @param int $stretch stretch carachter mode: - * @param boolean $firstline if true prints only the first line and return the remaining string. - * @param boolean $firstblock if true the string is the starting of a line. - * @param float $maxh maximum height. The remaining unprinted text will be returned. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. - * @return mixed Return the number of cells or the remaining string if $firstline = true. - * @access public - * @since 1.5 - */ + * This method prints text from the current position.
    + * @param float $h Line height + * @param string $txt String to print + * @param mixed $link URL or identifier returned by AddLink() + * @param int $fill Indicates if the background must be painted (1) or transparent (0). Default value: 0. + * @param string $align Allows to center or align the text. Possible values are: + * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. + * @param int $stretch stretch carachter mode: + * @param boolean $firstline if true prints only the first line and return the remaining string. + * @param boolean $firstblock if true the string is the starting of a line. + * @param float $maxh maximum height. The remaining unprinted text will be returned. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. + * @return mixed Return the number of cells or the remaining string if $firstline = true. + * @access public + * @since 1.5 + */ public function Write($h, $txt, $link='', $fill=0, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0) { if (strlen($txt) == 0) { $txt = ' '; @@ -4917,10 +4917,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the remaining width between the current position and margins. - * @return int Return the remaining width - * @access protected - */ + * Returns the remaining width between the current position and margins. + * @return int Return the remaining width + * @access protected + */ protected function getRemainingWidth() { if ($this->rtl) { return ($this->x - $this->lMargin); @@ -4930,13 +4930,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Extract a slice of the $strarr array and return it as string. - * @param string $strarr The input array of characters. - * @param int $start the starting element of $strarr. - * @param int $end first element that will not be returned. - * @return Return part of a string - * @access public - */ + * Extract a slice of the $strarr array and return it as string. + * @param string $strarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @return Return part of a string + * @access public + */ public function UTF8ArrSubString($strarr, $start='', $end='') { if (strlen($start) == 0) { $start = 0; @@ -4952,14 +4952,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Extract a slice of the $uniarr array and return it as string. - * @param string $uniarr The input array of characters. - * @param int $start the starting element of $strarr. - * @param int $end first element that will not be returned. - * @return Return part of a string - * @access public - * @since 4.5.037 (2009-04-07) - */ + * Extract a slice of the $uniarr array and return it as string. + * @param string $uniarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @return Return part of a string + * @access public + * @since 4.5.037 (2009-04-07) + */ public function UniArrSubString($uniarr, $start='', $end='') { if (strlen($start) == 0) { $start = 0; @@ -4975,24 +4975,24 @@ if (!class_exists('TCPDF', false)) { } /** - * Convert an array of UTF8 values to array of unicode characters - * @param string $ta The input array of UTF8 values. - * @return Return array of unicode characters - * @access public - * @since 4.5.037 (2009-04-07) - */ + * Convert an array of UTF8 values to array of unicode characters + * @param string $ta The input array of UTF8 values. + * @return Return array of unicode characters + * @access public + * @since 4.5.037 (2009-04-07) + */ public function UTF8ArrayToUniArray($ta) { return array_map(array($this, 'unichr'), $ta); } /** - * Returns the unicode caracter specified by UTF-8 code - * @param int $c UTF-8 code - * @return Returns the specified character. - * @author Miguel Perez, Nicola Asuni - * @access public - * @since 2.3.000 (2008-03-05) - */ + * Returns the unicode caracter specified by UTF-8 code + * @param int $c UTF-8 code + * @return Returns the specified character. + * @author Miguel Perez, Nicola Asuni + * @access public + * @since 2.3.000 (2008-03-05) + */ public function unichr($c) { if (!$this->isunicode) { return chr($c); @@ -5032,36 +5032,36 @@ if (!class_exists('TCPDF', false)) { } /** - * Puts an image in the page. - * The upper-left corner must be given. - * The dimensions can be specified in different ways: - * Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; - * The format can be specified explicitly or inferred from the file extension.
    - * It is possible to put a link on the image.
    - * Remark: if an image is used several times, only one copy will be embedded in the file.
    - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param mixed $link URL or identifier returned by AddLink(). - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: - * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). - * @param int $dpi dot-per-inch resolution used on resize - * @param string $palign Allows to center or align the image on the current line. Possible values are: - * @param boolean $ismask true if this image is a mask, false otherwise - * @param mixed $imgmask image object returned by this function or false - * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box. - * @param boolean $hidden if true do not display the image. - * @return image information - * @access public - * @since 1.1 - */ + * Puts an image in the page. + * The upper-left corner must be given. + * The dimensions can be specified in different ways: + * Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; + * The format can be specified explicitly or inferred from the file extension.
    + * It is possible to put a link on the image.
    + * Remark: if an image is used several times, only one copy will be embedded in the file.
    + * @param string $file Name of the file containing the image. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: + * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are: + * @param boolean $ismask true if this image is a mask, false otherwise + * @param mixed $imgmask image object returned by this function or false + * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box. + * @param boolean $hidden if true do not display the image. + * @return image information + * @access public + * @since 1.1 + */ public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false) { if ($x === '') { $x = $this->x; @@ -5326,13 +5326,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Convert the loaded php image to a JPEG and then return a structure for the PDF creator. - * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param string $file Image file name. - * @param image $image Image object. - * return image JPEG image object. - * @access protected - */ + * Convert the loaded php image to a JPEG and then return a structure for the PDF creator. + * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. + * @param string $file Image file name. + * @param image $image Image object. + * return image JPEG image object. + * @access protected + */ protected function _toJPEG($image) { $tempname = tempnam(K_PATH_CACHE, 'jpg_'); imagejpeg($image, $tempname, $this->jpeg_quality); @@ -5344,11 +5344,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Extract info from a JPEG file without using the GD library. - * @param string $file image file to parse - * @return array structure containing the image data - * @access protected - */ + * Extract info from a JPEG file without using the GD library. + * @param string $file image file to parse + * @return array structure containing the image data + * @access protected + */ protected function _parsejpeg($file) { $a = getimagesize($file); if (empty($a)) { @@ -5370,11 +5370,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Extract info from a PNG file without using the GD library. - * @param string $file image file to parse - * @return array structure containing the image data - * @access protected - */ + * Extract info from a PNG file without using the GD library. + * @param string $file image file to parse + * @return array structure containing the image data + * @access protected + */ protected function _parsepng($file) { $f = fopen($file, 'rb'); if ($f === false) { @@ -5471,15 +5471,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Binary-safe and URL-safe file read. - * 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) - */ + * Binary-safe and URL-safe file read. + * 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) { @@ -5493,23 +5493,23 @@ if (!class_exists('TCPDF', false)) { } /** - * Extract info from a PNG image with alpha channel using the GD library. - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param mixed $link URL or identifier returned by AddLink(). - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: - * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). - * @param int $dpi dot-per-inch resolution used on resize - * @param string $palign Allows to center or align the image on the current line. Possible values are: - * @author Valentin Schmidt, Nicola Asuni - * @access protected - * @since 4.3.007 (2008-12-04) - * @see Image() - */ + * Extract info from a PNG image with alpha channel using the GD library. + * @param string $file Name of the file containing the image. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: + * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are: + * @author Valentin Schmidt, Nicola Asuni + * @access protected + * @since 4.3.007 (2008-12-04) + * @see Image() + */ protected function ImagePngAlpha($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='') { // get image size list($wpx, $hpx) = getimagesize($file); @@ -5549,24 +5549,24 @@ if (!class_exists('TCPDF', false)) { } /** - * Correct the gamma value to be used with GD library - * @param float $v the gamma value to be corrected - * @access protected - * @since 4.3.007 (2008-12-04) - */ + * Correct the gamma value to be used with GD library + * @param float $v the gamma value to be corrected + * @access protected + * @since 4.3.007 (2008-12-04) + */ protected function getGDgamma($v) { return (pow(($v / 255), 2.2) * 255); } /** - * Performs a line break. - * The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. - * @param float $h The height of the break. By default, the value equals the height of the last printed cell. - * @param boolean $cell if true add a cMargin to the x coordinate - * @access public - * @since 1.0 - * @see Cell() - */ + * Performs a line break. + * The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. + * @param float $h The height of the break. By default, the value equals the height of the last printed cell. + * @param boolean $cell if true add a cMargin to the x coordinate + * @access public + * @since 1.0 + * @see Cell() + */ public function Ln($h='', $cell=false) { if (($this->num_columns > 0) AND ($this->y == $this->columns[$this->current_column]['y']) AND isset($this->columns[$this->current_column]['x']) AND ($this->x == $this->columns[$this->current_column]['x'])) { // revove vertical space from the top of the column @@ -5591,13 +5591,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the relative X value of current position. - * The value is relative to the left border for LTR languages and to the right border for RTL languages. - * @return float - * @access public - * @since 1.2 - * @see SetX(), GetY(), SetY() - */ + * Returns the relative X value of current position. + * The value is relative to the left border for LTR languages and to the right border for RTL languages. + * @return float + * @access public + * @since 1.2 + * @see SetX(), GetY(), SetY() + */ public function GetX() { //Get x position if ($this->rtl) { @@ -5608,36 +5608,36 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the absolute X value of current position. - * @return float - * @access public - * @since 1.2 - * @see SetX(), GetY(), SetY() - */ + * Returns the absolute X value of current position. + * @return float + * @access public + * @since 1.2 + * @see SetX(), GetY(), SetY() + */ public function GetAbsX() { return $this->x; } /** - * Returns the ordinate of the current position. - * @return float - * @access public - * @since 1.0 - * @see SetY(), GetX(), SetX() - */ + * Returns the ordinate of the current position. + * @return float + * @access public + * @since 1.0 + * @see SetY(), GetX(), SetX() + */ public function GetY() { //Get y position return $this->y; } /** - * Defines the abscissa of the current position. - * If the passed value is negative, it is relative to the right of the page (or left if language is RTL). - * @param float $x The value of the abscissa. - * @access public - * @since 1.2 - * @see GetX(), GetY(), SetY(), SetXY() - */ + * Defines the abscissa of the current position. + * If the passed value is negative, it is relative to the right of the page (or left if language is RTL). + * @param float $x The value of the abscissa. + * @access public + * @since 1.2 + * @see GetX(), GetY(), SetY(), SetXY() + */ public function SetX($x) { //Set x position if ($this->rtl) { @@ -5662,14 +5662,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Moves the current abscissa back to the left margin and sets the ordinate. - * If the passed value is negative, it is relative to the bottom of the page. - * @param float $y The value of the ordinate. - * @param bool $resetx if true (default) reset the X position. - * @access public - * @since 1.0 - * @see GetX(), GetY(), SetY(), SetXY() - */ + * Moves the current abscissa back to the left margin and sets the ordinate. + * If the passed value is negative, it is relative to the bottom of the page. + * @param float $y The value of the ordinate. + * @param bool $resetx if true (default) reset the X position. + * @access public + * @since 1.0 + * @see GetX(), GetY(), SetY(), SetXY() + */ public function SetY($y, $resetx=true) { if ($resetx) { //reset x @@ -5693,14 +5693,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines the abscissa and ordinate of the current position. - * If the passed values are negative, they are relative respectively to the right and bottom of the page. - * @param float $x The value of the abscissa - * @param float $y The value of the ordinate - * @access public - * @since 1.2 - * @see SetX(), SetY() - */ + * Defines the abscissa and ordinate of the current position. + * If the passed values are negative, they are relative respectively to the right and bottom of the page. + * @param float $x The value of the abscissa + * @param float $y The value of the ordinate + * @access public + * @since 1.2 + * @see SetX(), SetY() + */ public function SetXY($x, $y) { //Set x and y positions $this->SetY($y); @@ -5708,15 +5708,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Send the document to a given destination: string, local file or browser. - * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
    - * The method first calls Close() if necessary to terminate the document. - * @param string $name The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character. - * @param string $dest Destination where to send the document. It can take one of the following values: - * @access public - * @since 1.0 - * @see Close() - */ + * Send the document to a given destination: string, local file or browser. + * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
    + * The method first calls Close() if necessary to terminate the document. + * @param string $name The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character. + * @param string $dest Destination where to send the document. It can take one of the following values: + * @access public + * @since 1.0 + * @see Close() + */ public function Output($name='doc.pdf', $dest='I') { //Output PDF to some destination //Finish document if necessary @@ -5898,9 +5898,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Check for locale-related bug - * @access protected - */ + * Check for locale-related bug + * @access protected + */ protected function _dochecks() { //Check for locale-related bug if (1.1 == 1) { @@ -5913,10 +5913,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Return fonts path - * @return string - * @access protected - */ + * Return fonts path + * @return string + * @access protected + */ protected function _getfontpath() { if (!defined('K_PATH_FONTS') AND is_dir(dirname(__FILE__).'/fonts')) { define('K_PATH_FONTS', dirname(__FILE__).'/fonts/'); @@ -5925,9 +5925,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output pages. - * @access protected - */ + * Output pages. + * @access protected + */ protected function _putpages() { $nb = $this->numpages; if (!empty($this->AliasNbPages)) { @@ -6063,12 +6063,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Output referencees to page annotations - * @param int $n page number - * @access protected - * @author Nicola Asuni - * @since 4.7.000 (2008-08-29) - */ + * Output referencees to page annotations + * @param int $n page number + * @access protected + * @author Nicola Asuni + * @since 4.7.000 (2008-08-29) + */ protected function _putannotsrefs($n) { if (!(isset($this->PageAnnots[$n]) OR ($this->sign AND isset($this->signature_data['cert_type'])))) { return; @@ -6093,13 +6093,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Output annotations objects for all pages. - * !!! THIS METHOD IS NOT YET COMPLETED !!! - * See section 12.5 of PDF 32000_2008 reference. - * @access protected - * @author Nicola Asuni - * @since 4.0.018 (2008-08-06) - */ + * Output annotations objects for all pages. + * !!! THIS METHOD IS NOT YET COMPLETED !!! + * See section 12.5 of PDF 32000_2008 reference. + * @access protected + * @author Nicola Asuni + * @since 4.0.018 (2008-08-06) + */ protected function _putannotsobjs() { // reset object counter $this->annot_obj_id = $this->annots_start_obj_id; @@ -6707,14 +6707,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Put appearance streams XObject used to define annotation's appearance states - * @param int $w annotation width - * @param int $h annotation height - * @param string $stream appearance stream - * @return int object ID - * @access protected - * @since 4.8.001 (2009-09-09) - */ + * Put appearance streams XObject used to define annotation's appearance states + * @param int $w annotation width + * @param int $h annotation height + * @param string $stream appearance stream + * @return int object ID + * @access protected + * @since 4.8.001 (2009-09-09) + */ protected function _putAPXObject($w=0, $h=0, $stream='') { $stream = trim($stream); ++$this->apxo_obj_id; @@ -6740,9 +6740,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output fonts. - * @access protected - */ + * Output fonts. + * @access protected + */ protected function _putfonts() { $nf = $this->n; foreach ($this->diffs as $diff) { @@ -6874,13 +6874,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Outputs font widths - * @parameter array $font font data - * @parameter int $cidoffset offset for CID values - * @author Nicola Asuni - * @access protected - * @since 4.4.000 (2008-12-07) - */ + * Outputs font widths + * @parameter array $font font data + * @parameter int $cidoffset offset for CID values + * @author Nicola Asuni + * @access protected + * @since 4.4.000 (2008-12-07) + */ protected function _putfontwidths($font, $cidoffset=0) { ksort($font['cw']); $rangeid = 0; @@ -6972,14 +6972,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Adds unicode fonts.
    - * Based on PDF Reference 1.3 (section 5) - * @parameter array $font font data - * @return int font object ID - * @access protected - * @author Nicola Asuni - * @since 1.52.0.TC005 (2005-01-05) - */ + * Adds unicode fonts.
    + * Based on PDF Reference 1.3 (section 5) + * @parameter array $font font data + * @return int font object ID + * @access protected + * @author Nicola Asuni + * @since 1.52.0.TC005 (2005-01-05) + */ protected function _puttruetypeunicode($font) { // Type0 Font // A composite font composed of other fonts, organized hierarchically @@ -7191,10 +7191,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Output Spot Colors Resources. - * @access protected - * @since 4.0.024 (2008-09-12) - */ + * Output Spot Colors Resources. + * @access protected + * @since 4.0.024 (2008-09-12) + */ protected function _putspotcolors() { foreach ($this->spot_colors as $name => $color) { $this->_newobj(); @@ -7209,9 +7209,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output object dictionary for images. - * @access protected - */ + * Output object dictionary for images. + * @access protected + */ protected function _putxobjectdict() { foreach ($this->imagekeys as $file) { $info = $this->getImageBuffer($file); @@ -7220,9 +7220,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output Resources Dictionary. - * @access protected - */ + * Output Resources Dictionary. + * @access protected + */ protected function _putresourcedict() { $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); $this->_out('/Font <<'); @@ -7261,9 +7261,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output Resources. - * @access protected - */ + * Output Resources. + * @access protected + */ protected function _putresources() { $this->_putextgstates(); $this->_putocg(); @@ -7294,10 +7294,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Adds some Metadata information (Document Information Dictionary) - * (see Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference) - * @access protected - */ + * Adds some Metadata information (Document Information Dictionary) + * (see Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference) + * @access protected + */ protected function _putinfo() { if (!$this->empty_string($this->title)) { // The document's title. @@ -7335,9 +7335,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output Catalog. - * @access protected - */ + * Output Catalog. + * @access protected + */ protected function _putcatalog() { $this->_out('/Type /Catalog'); $this->_out('/Pages 1 0 R'); @@ -7416,11 +7416,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Output viewer preferences. - * @author Nicola asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ + * Output viewer preferences. + * @author Nicola asuni + * @since 3.1.000 (2008-06-09) + * @access protected + */ protected function _putviewerpreferences() { $this->_out('/ViewerPreferences<<'); if ($this->rtl) { @@ -7488,9 +7488,9 @@ if (!class_exists('TCPDF', false)) { } /** - * Output trailer. - * @access protected - */ + * Output trailer. + * @access protected + */ protected function _puttrailer() { $this->_out('/Size '.($this->n + 1)); $this->_out('/Root '.$this->n.' 0 R'); @@ -7502,17 +7502,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Output PDF header. - * @access protected - */ + * Output PDF header. + * @access protected + */ protected function _putheader() { $this->_out('%PDF-'.$this->PDFVersion); } /** - * Output end of document (EOF). - * @access protected - */ + * Output end of document (EOF). + * @access protected + */ protected function _enddoc() { $this->state = 1; $this->_putheader(); @@ -7625,11 +7625,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Initialize a new page. - * @param string $orientation page orientation. Possible values are (case insensitive): - * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). - * @access protected - */ + * Initialize a new page. + * @param string $orientation page orientation. Possible values are (case insensitive): + * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit). + * @access protected + */ protected function _beginpage($orientation='', $format='') { ++$this->page; $this->setPageBuffer($this->page, ''); @@ -7666,19 +7666,19 @@ if (!class_exists('TCPDF', false)) { } /** - * Mark end of page. - * @access protected - */ + * Mark end of page. + * @access protected + */ protected function _endpage() { $this->setVisibility('all'); $this->state = 1; } /** - * Begin a new object and return the object number. - * @return int object number - * @access protected - */ + * Begin a new object and return the object number. + * @return int object number + * @access protected + */ protected function _newobj() { ++$this->n; $this->offsets[$this->n] = $this->bufferlen; @@ -7687,37 +7687,37 @@ if (!class_exists('TCPDF', false)) { } /** - * Underline text. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to underline - * @access protected - */ + * Underline text. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to underline + * @access protected + */ protected function _dounderline($x, $y, $txt) { $w = $this->GetStringWidth($txt); return $this->_dounderlinew($x, $y, $w); } /** - * Line through text. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to linethrough - * @access protected - */ + * Line through text. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to linethrough + * @access protected + */ protected function _dolinethrough($x, $y, $txt) { $w = $this->GetStringWidth($txt); return $this->_dolinethroughw($x, $y, $w); } /** - * Underline for rectangular text area. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param int $w width to underline - * @access protected - * @since 4.8.008 (2009-09-29) - */ + * Underline for rectangular text area. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w width to underline + * @access protected + * @since 4.8.008 (2009-09-29) + */ protected function _dounderlinew($x, $y, $w) { $up = $this->CurrentFont['up']; $ut = $this->CurrentFont['ut']; @@ -7725,13 +7725,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Line through for rectangular text area. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to linethrough - * @access protected - * @since 4.8.008 (2009-09-29) - */ + * Line through for rectangular text area. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to linethrough + * @access protected + * @since 4.8.008 (2009-09-29) + */ protected function _dolinethroughw($x, $y, $w) { $up = $this->CurrentFont['up']; $ut = $this->CurrentFont['ut']; @@ -7739,33 +7739,33 @@ if (!class_exists('TCPDF', false)) { } /** - * Read a 4-byte integer from file. - * @param string $f file name. - * @return 4-byte integer - * @access protected - */ + * Read a 4-byte integer from file. + * @param string $f file name. + * @return 4-byte integer + * @access protected + */ protected function _freadint($f) { $a = unpack('Ni', fread($f, 4)); return $a['i']; } /** - * Add "\" before "\", "(" and ")" - * @param string $s string to escape. - * @return string escaped string. - * @access protected - */ + * Add "\" before "\", "(" and ")" + * @param string $s string to escape. + * @return string escaped string. + * @access protected + */ protected function _escape($s) { // the chr(13) substitution fixes the Bugs item #1421290. return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); } /** - * Format a data string for meta information - * @param string $s data string to escape. - * @return string escaped string. - * @access protected - */ + * Format a data string for meta information + * @param string $s data string to escape. + * @return string escaped string. + * @access protected + */ protected function _datastring($s) { if ($this->encrypted) { $s = $this->_RC4($this->_objectkey($this->n), $s); @@ -7774,11 +7774,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Format a data string for annotation objects - * @param string $s data string to escape. - * @return string escaped string. - * @access protected - */ + * Format a data string for annotation objects + * @param string $s data string to escape. + * @return string escaped string. + * @access protected + */ protected function _dataannobjstring($s) { if ($this->encrypted) { $s = $this->_RC4($this->_objectkey($this->annot_obj_id + 1), $s); @@ -7787,22 +7787,22 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns a formatted date for meta information - * @return string escaped date string. - * @access protected - * @since 4.6.028 (2009-08-25) - */ + * Returns a formatted date for meta information + * @return string escaped date string. + * @access protected + * @since 4.6.028 (2009-08-25) + */ protected function _datestring() { $current_time = substr_replace(date('YmdHisO'), '\'', (0 - 2), 0).'\''; return $this->_datastring('D:'.$current_time); } /** - * Format a text string for meta information - * @param string $s string to escape. - * @return string escaped string. - * @access protected - */ + * Format a text string for meta information + * @param string $s string to escape. + * @return string escaped string. + * @access protected + */ protected function _textstring($s) { if ($this->isunicode) { //Convert string to UTF-16BE @@ -7812,11 +7812,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Format a UTF-8 text string for meta information on annotations - * @param string $s string to escape. - * @return string escaped string. - * @access protected - */ + * Format a UTF-8 text string for meta information on annotations + * @param string $s string to escape. + * @return string escaped string. + * @access protected + */ protected function _textannobjstring($s) { if ($this->isunicode) { //Convert string to UTF-16BE @@ -7826,11 +7826,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Format a text string - * @param string $s string to escape. - * @return string escaped string. - * @access protected - */ + * Format a text string + * @param string $s string to escape. + * @return string escaped string. + * @access protected + */ protected function _escapetext($s) { if ($this->isunicode) { if (($this->CurrentFont['type'] == 'core') OR ($this->CurrentFont['type'] == 'TrueType') OR ($this->CurrentFont['type'] == 'Type1')) { @@ -7844,11 +7844,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Output a stream. - * @param string $s string to output. - * @param int $n object reference for encryption mode - * @access protected - */ + * Output a stream. + * @param string $s string to output. + * @param int $n object reference for encryption mode + * @access protected + */ protected function _putstream($s, $n=0) { if ($this->encrypted) { if ($n <= 0) { @@ -7863,10 +7863,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Output a string to the document. - * @param string $s string to output. - * @access protected - */ + * Output a string to the document. + * @param string $s string to output. + * @access protected + */ protected function _out($s) { if ($this->state == 2) { if ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { @@ -8318,7 +8318,7 @@ if (!class_exists('TCPDF', false)) { * @param $text_to_convert Text to convert. * @return string converted * @access public - */ + */ public function unhtmlentities($text_to_convert) { return html_entity_decode($text_to_convert, ENT_QUOTES, $this->encoding); } @@ -8327,11 +8327,11 @@ if (!class_exists('TCPDF', false)) { // SINCE 2.0.000 (2008-01-02) /** - * Compute encryption key depending on object number where the encrypted data is stored - * @param int $n object number - * @access protected - * @since 2.0.000 (2008-01-02) - */ + * Compute encryption key depending on object number where the encrypted data is stored + * @param int $n object number + * @access protected + * @since 2.0.000 (2008-01-02) + */ protected function _objectkey($n) { return substr($this->_md5_16($this->encryption_key.pack('VXxx', $n)), 0, 10); } @@ -8351,15 +8351,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the input text exrypted using RC4 algorithm and the specified key. - * RC4 is the standard encryption algorithm used in PDF format - * @param string $key encryption key - * @param String $text input text to be encrypted - * @return String encrypted text - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Returns the input text exrypted using RC4 algorithm and the specified key. + * RC4 is the standard encryption algorithm used in PDF format + * @param string $key encryption key + * @param String $text input text to be encrypted + * @return String encrypted text + * @access protected + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ protected function _RC4($key, $text) { if ($this->last_rc4_key != $key) { $k = str_repeat($key, ((256 / strlen($key)) + 1)); @@ -8393,26 +8393,26 @@ if (!class_exists('TCPDF', false)) { } /** - * Encrypts a string using MD5 and returns it's value as a binary string. - * @param string $str input string - * @return String MD5 encrypted binary string - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Encrypts a string using MD5 and returns it's value as a binary string. + * @param string $str input string + * @return String MD5 encrypted binary string + * @access protected + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ protected function _md5_16($str) { return pack('H*', md5($str)); } /** - * Compute O value (used for RC4 encryption) - * @param String $user_pass user password - * @param String $owner_pass user password - * @return String O value - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Compute O value (used for RC4 encryption) + * @param String $user_pass user password + * @param String $owner_pass user password + * @return String O value + * @access protected + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ protected function _Ovalue($user_pass, $owner_pass) { $tmp = $this->_md5_16($owner_pass); $owner_RC4_key = substr($tmp, 0, 5); @@ -8420,25 +8420,25 @@ if (!class_exists('TCPDF', false)) { } /** - * Compute U value (used for RC4 encryption) - * @return String U value - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Compute U value (used for RC4 encryption) + * @return String U value + * @access protected + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ protected function _Uvalue() { return $this->_RC4($this->encryption_key, $this->padding); } /** - * Compute encryption key - * @param String $user_pass user password - * @param String $owner_pass user password - * @param String $protection protection type - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Compute encryption key + * @param String $user_pass user password + * @param String $owner_pass user password + * @param String $protection protection type + * @access protected + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ protected function _generateencryptionkey($user_pass, $owner_pass, $protection) { // Pad passwords $user_pass = substr($user_pass.$this->padding, 0, 32); @@ -8455,22 +8455,22 @@ if (!class_exists('TCPDF', false)) { } /** - * Set document protection - * The permission array is composed of values taken from the following ones: - * - copy: copy text and images to the clipboard - * - print: print the document - * - modify: modify it (except for annotations and forms) - * - annot-forms: add annotations and forms - * Remark: the protection against modification is for people who have the full Acrobat product. - * If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. - * Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts. - * @param Array $permissions the set of permissions. Empty by default (only viewing is allowed). (print, modify, copy, annot-forms) - * @param String $user_pass user password. Empty by default. - * @param String $owner_pass owner password. If not specified, a random value is used. - * @access public - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ + * Set document protection + * The permission array is composed of values taken from the following ones: + * - copy: copy text and images to the clipboard + * - print: print the document + * - modify: modify it (except for annotations and forms) + * - annot-forms: add annotations and forms + * Remark: the protection against modification is for people who have the full Acrobat product. + * If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. + * Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts. + * @param Array $permissions the set of permissions. Empty by default (only viewing is allowed). (print, modify, copy, annot-forms) + * @param String $user_pass user password. Empty by default. + * @param String $owner_pass owner password. If not specified, a random value is used. + * @access public + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec + */ public function SetProtection($permissions=array(), $user_pass='', $owner_pass=null) { $options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32); $protection = 192; @@ -8492,13 +8492,13 @@ if (!class_exists('TCPDF', false)) { // START TRANSFORMATIONS SECTION ----------------------- /** - * Starts a 2D tranformation saving current graphic state. - * This function must be called before scaling, mirroring, translation, rotation and skewing. - * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Starts a 2D tranformation saving current graphic state. + * This function must be called before scaling, mirroring, translation, rotation and skewing. + * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function StartTransform() { $this->_out('q'); $this->transfmrk[$this->page][] = $this->pagelen[$this->page]; @@ -8507,13 +8507,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Stops a 2D tranformation restoring previous graphic state. - * This function must be called after scaling, mirroring, translation, rotation and skewing. - * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Stops a 2D tranformation restoring previous graphic state. + * This function must be called after scaling, mirroring, translation, rotation and skewing. + * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function StopTransform() { $this->_out('Q'); if (isset($this->transfmatrix[$this->transfmatrix_key])) { @@ -8523,54 +8523,54 @@ if (!class_exists('TCPDF', false)) { array_pop($this->transfmrk[$this->page]); } /** - * Horizontal Scaling. - * @param float $s_x scaling factor for width as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Horizontal Scaling. + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function ScaleX($s_x, $x='', $y='') { $this->Scale($s_x, 100, $x, $y); } /** - * Vertical Scaling. - * @param float $s_y scaling factor for height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Vertical Scaling. + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function ScaleY($s_y, $x='', $y='') { $this->Scale(100, $s_y, $x, $y); } /** - * Vertical and horizontal proportional Scaling. - * @param float $s scaling factor for width and height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Vertical and horizontal proportional Scaling. + * @param float $s scaling factor for width and height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function ScaleXY($s, $x='', $y='') { $this->Scale($s, $s, $x, $y); } /** - * Vertical and horizontal non-proportional Scaling. - * @param float $s_x scaling factor for width as percent. 0 is not allowed. - * @param float $s_y scaling factor for height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Vertical and horizontal non-proportional Scaling. + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function Scale($s_x, $s_y, $x='', $y='') { if ($x === '') { $x = $this->x; @@ -8600,83 +8600,83 @@ if (!class_exists('TCPDF', false)) { } /** - * Horizontal Mirroring. - * @param int $x abscissa of the point. Default is current x position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Horizontal Mirroring. + * @param int $x abscissa of the point. Default is current x position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function MirrorH($x='') { $this->Scale(-100, 100, $x); } /** - * Verical Mirroring. - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Verical Mirroring. + * @param int $y ordinate of the point. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function MirrorV($y='') { $this->Scale(100, -100, '', $y); } /** - * Point reflection mirroring. - * @param int $x abscissa of the point. Default is current x position - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Point reflection mirroring. + * @param int $x abscissa of the point. Default is current x position + * @param int $y ordinate of the point. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function MirrorP($x='',$y='') { $this->Scale(-100, -100, $x, $y); } /** - * Reflection against a straight line through point (x, y) with the gradient angle (angle). - * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line). - * @param int $x abscissa of the point. Default is current x position - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Reflection against a straight line through point (x, y) with the gradient angle (angle). + * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line). + * @param int $x abscissa of the point. Default is current x position + * @param int $y ordinate of the point. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function MirrorL($angle=0, $x='',$y='') { $this->Scale(-100, 100, $x, $y); $this->Rotate(-2*($angle-90), $x, $y); } /** - * Translate graphic object horizontally. - * @param int $t_x movement to the right (or left for RTL) - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Translate graphic object horizontally. + * @param int $t_x movement to the right (or left for RTL) + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function TranslateX($t_x) { $this->Translate($t_x, 0); } /** - * Translate graphic object vertically. - * @param int $t_y movement to the bottom - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Translate graphic object vertically. + * @param int $t_y movement to the bottom + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function TranslateY($t_y) { $this->Translate(0, $t_y); } /** - * Translate graphic object horizontally and vertically. - * @param int $t_x movement to the right - * @param int $t_y movement to the bottom - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Translate graphic object horizontally and vertically. + * @param int $t_x movement to the right + * @param int $t_y movement to the bottom + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function Translate($t_x, $t_y) { if ($this->rtl) { $t_x = -$t_x; @@ -8693,14 +8693,14 @@ if (!class_exists('TCPDF', false)) { } /** - * Rotate object. - * @param float $angle angle in degrees for counter-clockwise rotation - * @param int $x abscissa of the rotation center. Default is current x position - * @param int $y ordinate of the rotation center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Rotate object. + * @param float $angle angle in degrees for counter-clockwise rotation + * @param int $x abscissa of the rotation center. Default is current x position + * @param int $y ordinate of the rotation center. Default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function Rotate($angle, $x='', $y='') { if ($x === '') { $x = $this->x; @@ -8726,41 +8726,41 @@ if (!class_exists('TCPDF', false)) { } /** - * Skew horizontally. - * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Skew horizontally. + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param int $x abscissa of the skewing center. default is current x position + * @param int $y ordinate of the skewing center. default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function SkewX($angle_x, $x='', $y='') { $this->Skew($angle_x, 0, $x, $y); } /** - * Skew vertically. - * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Skew vertically. + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param int $x abscissa of the skewing center. default is current x position + * @param int $y ordinate of the skewing center. default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function SkewY($angle_y, $x='', $y='') { $this->Skew(0, $angle_y, $x, $y); } /** - * Skew. - * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Skew. + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param int $x abscissa of the skewing center. default is current x position + * @param int $y ordinate of the skewing center. default is current y position + * @access public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ public function Skew($angle_x, $angle_y, $x='', $y='') { if ($x === '') { $x = $this->x; @@ -8789,11 +8789,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Apply graphic transformations. - * @access protected - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ + * Apply graphic transformations. + * @access protected + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ protected function Transform($tm) { $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $tm[0], $tm[1], $tm[2], $tm[3], $tm[4], $tm[5])); // add tranformation matrix @@ -8812,12 +8812,12 @@ if (!class_exists('TCPDF', false)) { // The following section is based on the code provided by David Hernandez Sanz /** - * Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page. - * @param float $width The width. - * @access public - * @since 1.0 - * @see Line(), Rect(), Cell(), MultiCell() - */ + * Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page. + * @param float $width The width. + * @access public + * @since 1.0 + * @see Line(), Rect(), Cell(), MultiCell() + */ public function SetLineWidth($width) { //Set line width $this->LineWidth = $width; @@ -8828,37 +8828,37 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the current the line width. - * @return int Line width - * @access public - * @since 2.1.000 (2008-01-07) - * @see Line(), SetLineWidth() - */ + * Returns the current the line width. + * @return int Line width + * @access public + * @since 2.1.000 (2008-01-07) + * @see Line(), SetLineWidth() + */ public function GetLineWidth() { return $this->LineWidth; } /** - * Set line style. - * @param array $style Line style. Array with keys among the following: - * - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Set line style. + * @param array $style Line style. Array with keys among the following: + * + * @access public + * @since 2.1.000 (2008-01-08) + */ public function SetLineStyle($style) { if (!is_array($style)) { return; @@ -8911,12 +8911,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Set a draw point. - * @param float $x Abscissa of point. - * @param float $y Ordinate of point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ + * Set a draw point. + * @param float $x Abscissa of point. + * @param float $y Ordinate of point. + * @access protected + * @since 2.1.000 (2008-01-08) + */ protected function _outPoint($x, $y) { if ($this->rtl) { $x = $this->w - $x; @@ -8925,12 +8925,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a line from last draw point. - * @param float $x Abscissa of end point. - * @param float $y Ordinate of end point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ + * Draws a line from last draw point. + * @param float $x Abscissa of end point. + * @param float $y Ordinate of end point. + * @access protected + * @since 2.1.000 (2008-01-08) + */ protected function _outLine($x, $y) { if ($this->rtl) { $x = $this->w - $x; @@ -8939,15 +8939,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a rectangle. - * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). - * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). - * @param float $w Width. - * @param float $h Height. - * @param string $op options - * @access protected - * @since 2.1.000 (2008-01-08) - */ + * Draws a rectangle. + * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). + * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). + * @param float $w Width. + * @param float $h Height. + * @param string $op options + * @access protected + * @since 2.1.000 (2008-01-08) + */ protected function _outRect($x, $y, $w, $h, $op) { if ($this->rtl) { $x = $this->w - $x - $w; @@ -8956,17 +8956,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a Bezier curve from last draw point. - * The Bezier curve is a tangent to the line between the control points at either end of the curve. - * @param float $x1 Abscissa of control point 1. - * @param float $y1 Ordinate of control point 1. - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ + * Draws a Bezier curve from last draw point. + * The Bezier curve is a tangent to the line between the control points at either end of the curve. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @access protected + * @since 2.1.000 (2008-01-08) + */ protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) { if ($this->rtl) { $x1 = $this->w - $x1; @@ -8977,16 +8977,16 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a line between two points. - * @param float $x1 Abscissa of first point. - * @param float $y1 Ordinate of first point. - * @param float $x2 Abscissa of second point. - * @param float $y2 Ordinate of second point. - * @param array $style Line style. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @access public - * @since 1.0 - * @see SetLineWidth(), SetDrawColor(), SetLineStyle() - */ + * Draws a line between two points. + * @param float $x1 Abscissa of first point. + * @param float $y1 Ordinate of first point. + * @param float $x2 Abscissa of second point. + * @param float $y2 Ordinate of second point. + * @param array $style Line style. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @access public + * @since 1.0 + * @see SetLineWidth(), SetDrawColor(), SetLineStyle() + */ public function Line($x1, $y1, $x2, $y2, $style=array()) { if (is_array($style)) { $this->SetLineStyle($style); @@ -8997,31 +8997,31 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a rectangle. - * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). - * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). - * @param float $w Width. - * @param float $h Height. - * @param string $style Style of rendering. Possible values are: - * - * @param array $border_style Border style of rectangle. Array with keys among the following: - * - * If a key is not present or is null, not draws the border. Default value: default line style (empty array). - * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @since 1.0 - * @see SetLineStyle() - */ + * Draws a rectangle. + * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). + * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). + * @param float $w Width. + * @param float $h Height. + * @param string $style Style of rendering. Possible values are: + * + * @param array $border_style Border style of rectangle. Array with keys among the following: + * + * If a key is not present or is null, not draws the border. Default value: default line style (empty array). + * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @access public + * @since 1.0 + * @see SetLineStyle() + */ public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { if (!(false === strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); @@ -9095,31 +9095,31 @@ if (!class_exists('TCPDF', false)) { /** - * Draws a Bezier curve. - * The Bezier curve is a tangent to the line between the control points at - * either end of the curve. - * @param float $x0 Abscissa of start point. - * @param float $y0 Ordinate of start point. - * @param float $x1 Abscissa of control point 1. - * @param float $y1 Ordinate of control point 1. - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @see SetLineStyle() - * @since 2.1.000 (2008-01-08) - */ + * Draws a Bezier curve. + * The Bezier curve is a tangent to the line between the control points at + * either end of the curve. + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @access public + * @see SetLineStyle() + * @since 2.1.000 (2008-01-08) + */ public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { if (!(false === strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); @@ -9157,26 +9157,26 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a poly-Bezier curve. - * Each Bezier curve segment is a tangent to the line between the control points at - * either end of the curve. - * @param float $x0 Abscissa of start point. - * @param float $y0 Ordinate of start point. - * @param float $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @see SetLineStyle() - * @since 3.0008 (2008-05-12) - */ + * Draws a poly-Bezier curve. + * Each Bezier curve segment is a tangent to the line between the control points at + * either end of the curve. + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @access public + * @see SetLineStyle() + * @since 3.0008 (2008-05-12) + */ public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { if (!(false === strpos($style, 'F')) AND isset($fill_color)) { $this->SetFillColorArray($fill_color); @@ -9217,30 +9217,30 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws an ellipse. - * An ellipse is formed from n Bezier curves. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $rx Horizontal radius. - * @param float $ry Vertical radius (if ry = 0 then is a circle, see {@link Circle Circle}). Default value: 0. - * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. - * @param float $astart: Angle start of draw line. Default value: 0. - * @param float $afinish: Angle finish of draw line. Default value: 360. - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of ellipse. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param integer $nc Number of curves used in ellipse. Default value: 8. - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws an ellipse. + * An ellipse is formed from n Bezier curves. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $rx Horizontal radius. + * @param float $ry Vertical radius (if ry = 0 then is a circle, see {@link Circle Circle}). Default value: 0. + * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. + * @param float $astart: Angle start of draw line. Default value: 0. + * @param float $afinish: Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of ellipse. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @param integer $nc Number of curves used in ellipse. Default value: 8. + * @access public + * @since 2.1.000 (2008-01-08) + */ public function Ellipse($x0, $y0, $rx, $ry=0, $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=8) { if ($angle) { $this->StartTransform(); @@ -9323,80 +9323,80 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a circle. - * A circle is formed from n Bezier curves. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r Radius. - * @param float $astart: Angle start of draw line. Default value: 0. - * @param float $afinish: Angle finish of draw line. Default value: 360. - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of circle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param integer $nc Number of curves used in circle. Default value: 8. - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws a circle. + * A circle is formed from n Bezier curves. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius. + * @param float $astart: Angle start of draw line. Default value: 0. + * @param float $afinish: Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of circle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param integer $nc Number of curves used in circle. Default value: 8. + * @access public + * @since 2.1.000 (2008-01-08) + */ public function Circle($x0, $y0, $r, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=8) { $this->Ellipse($x0, $y0, $r, 0, 0, $astart, $afinish, $style, $line_style, $fill_color, $nc); } /** - * Draws a polygonal line - * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of polygon. Array with keys among the following: - * - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param boolean $closed if true the polygon is closes, otherwise will remain open - * @access public - * @since 4.8.003 (2009-09-15) - */ + * Draws a polygonal line + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of polygon. Array with keys among the following: + * + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @param boolean $closed if true the polygon is closes, otherwise will remain open + * @access public + * @since 4.8.003 (2009-09-15) + */ public function PolyLine($p, $style='', $line_style=array(), $fill_color=array()) { $this->Polygon($p, $style, $line_style, $fill_color, false); } /** - * Draws a polygon. - * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of polygon. Array with keys among the following: - * - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param boolean $closed if true the polygon is closes, otherwise will remain open - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws a polygon. + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of polygon. Array with keys among the following: + * + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @param boolean $closed if true the polygon is closes, otherwise will remain open + * @access public + * @since 2.1.000 (2008-01-08) + */ public function Polygon($p, $style='', $line_style=array(), $fill_color=array(), $closed=true) { $nc = count($p); // number of coordinates $np = $nc / 2; // number of points @@ -9487,41 +9487,41 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a regular polygon. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r: Radius of inscribed circle. - * @param integer $ns Number of sides. - * @param float $angle Angle oriented (anti-clockwise). Default value: 0. - * @param boolean $draw_circle Draw inscribed circle or not. Default value: false. - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of polygon sides. Array with keys among the following: - * - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: - * - * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws a regular polygon. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r: Radius of inscribed circle. + * @param integer $ns Number of sides. + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle Draw inscribed circle or not. Default value: false. + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of polygon sides. Array with keys among the following: + * + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + * + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @access public + * @since 2.1.000 (2008-01-08) + */ public function RegularPolygon($x0, $y0, $r, $ns, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { if (3 > $ns) { $ns = 3; @@ -9540,43 +9540,43 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a star polygon - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r Radius of inscribed circle. - * @param integer $nv Number of vertices. - * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon). - * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. - * @param boolean $draw_circle: Draw inscribed circle or not. Default value is false. - * @param string $style Style of rendering. Possible values are: - * - * @param array $line_style Line style of polygon sides. Array with keys among the following: - * - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: - * - * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws a star polygon + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius of inscribed circle. + * @param integer $nv Number of vertices. + * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon). + * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle: Draw inscribed circle or not. Default value is false. + * @param string $style Style of rendering. Possible values are: + * + * @param array $line_style Line style of polygon sides. Array with keys among the following: + * + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + * + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @access public + * @since 2.1.000 (2008-01-08) + */ public function StarPolygon($x0, $y0, $r, $nv, $ng, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { if ($nv < 2) { $nv = 2; @@ -9606,26 +9606,26 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a rounded rectangle. - * @param float $x Abscissa of upper-left corner. - * @param float $y Ordinate of upper-left corner. - * @param float $w Width. - * @param float $h Height. - * @param float $r Radius of the rounded corners. - * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top left, top right, bottom right and bottom left. Default value: all rounded corner ("1111"). - * @param string $style Style of rendering. Possible values are: - * - * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ + * Draws a rounded rectangle. + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param float $r Radius of the rounded corners. + * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top left, top right, bottom right and bottom left. Default value: all rounded corner ("1111"). + * @param string $style Style of rendering. Possible values are: + * + * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). + * @access public + * @since 2.1.000 (2008-01-08) + */ public function RoundedRect($x, $y, $w, $h, $r, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { if ('0000' == $round_corner) { // Not rounded $this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color); @@ -9700,17 +9700,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Draws a grahic arrow. - * @parameter float $x0 Abscissa of first point. - * @parameter float $y0 Ordinate of first point. - * @parameter float $x0 Abscissa of second point. - * @parameter float $y1 Ordinate of second point. - * @parameter int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) - * @parameter float $arm_size length of arrowhead arms - * @parameter int $arm_angle angle between an arm and the shaft - * @author Piotr Galecki, Nicola Asuni, Andy Meier - * @since 4.6.018 (2009-07-10) - */ + * Draws a grahic arrow. + * @parameter float $x0 Abscissa of first point. + * @parameter float $y0 Ordinate of first point. + * @parameter float $x0 Abscissa of second point. + * @parameter float $y1 Ordinate of second point. + * @parameter int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) + * @parameter float $arm_size length of arrowhead arms + * @parameter int $arm_angle angle between an arm and the shaft + * @author Piotr Galecki, Nicola Asuni, Andy Meier + * @since 4.6.018 (2009-07-10) + */ public function Arrow($x0, $y0, $x1, $y1, $head_style=0, $arm_size=5, $arm_angle=15) { // getting arrow direction angle // 0 deg angle is when both arms go along X axis. angle grows clockwise. @@ -9771,7 +9771,7 @@ if (!class_exists('TCPDF', false)) { * @access protected * @author Nicola Asuni * @since 2.1.000 (2008-01-08) - */ + */ protected function utf8StrRev($str, $setbom=false, $forcertl=false) { return $this->utf8StrArrRev($this->UTF8StringToArray($str), $str, $setbom, $forcertl); } @@ -9786,7 +9786,7 @@ if (!class_exists('TCPDF', false)) { * @access protected * @author Nicola Asuni * @since 4.9.000 (2010-03-27) - */ + */ protected function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false) { return $this->arrUTF8ToUTF16BE($this->utf8Bidi($arr, $str, $forcertl), $setbom); } @@ -9800,7 +9800,7 @@ if (!class_exists('TCPDF', false)) { * @author Nicola Asuni * @access protected * @since 2.4.000 (2008-03-06) - */ + */ protected function utf8Bidi($ta, $str='', $forcertl=false) { global $unicode, $unicode_mirror, $unicode_arlet, $laa_array, $diacritics; // paragraph embedding level @@ -10363,15 +10363,15 @@ if (!class_exists('TCPDF', false)) { // END OF BIDIRECTIONAL TEXT SECTION ------------------- /** - * Adds a bookmark. - * @param string $txt bookmark description. - * @param int $level bookmark level (minimum value is 0). - * @param float $y Ordinate of the boorkmark position (default = -1 = current position). - * @param int $page target page number (leave empty for current page). - * @access public - * @author Olivier Plathey, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Adds a bookmark. + * @param string $txt bookmark description. + * @param int $level bookmark level (minimum value is 0). + * @param float $y Ordinate of the boorkmark position (default = -1 = current position). + * @param int $page target page number (leave empty for current page). + * @access public + * @author Olivier Plathey, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ public function Bookmark($txt, $level=0, $y=-1, $page='') { if ($level < 0) { $level = 0; @@ -10395,11 +10395,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Create a bookmark PDF string. - * @access protected - * @author Olivier Plathey, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Create a bookmark PDF string. + * @access protected + * @author Olivier Plathey, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ protected function _putbookmarks() { $nb = count($this->outlines); if ($nb == 0) { @@ -10467,25 +10467,25 @@ if (!class_exists('TCPDF', false)) { // --- JAVASCRIPT ------------------------------------------------------ /** - * Adds a javascript - * @param string $script Javascript code - * @access public - * @author Johannes Güntert, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Adds a javascript + * @param string $script Javascript code + * @access public + * @author Johannes Güntert, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ public function IncludeJS($script) { $this->javascript .= $script; } /** - * Adds a javascript object and return object ID - * @param string $script Javascript code - * @param boolean $onload if true executes this object when opening the document - * @return int internal object ID - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Adds a javascript object and return object ID + * @param string $script Javascript code + * @param boolean $onload if true executes this object when opening the document + * @return int internal object ID + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function addJavascriptObject($script, $onload=false) { ++$this->js_obj_id; $this->js_objects[$this->js_obj_id] = array('js' => $script, 'onload' => $onload); @@ -10493,11 +10493,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Create a javascript PDF string. - * @access protected - * @author Johannes Güntert, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Create a javascript PDF string. + * @access protected + * @author Johannes Güntert, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ protected function _putjavascript() { if (empty($this->javascript) AND empty($this->js_objects)) { return; @@ -10552,12 +10552,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Convert color to javascript color. - * @param string $color color name or #RRGGBB - * @access protected - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Convert color to javascript color. + * @param string $color color name or #RRGGBB + * @access protected + * @author Denis Van Nuffelen, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ protected function _JScolor($color) { static $aColors = array('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray'); if (substr($color,0,1) == '#') { @@ -10570,18 +10570,18 @@ if (!class_exists('TCPDF', false)) { } /** - * Adds a javascript form field. - * @param string $type field type - * @param string $name field name - * @param int $x horizontal position - * @param int $y vertical position - * @param int $w width - * @param int $h height - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access protected - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ + * Adds a javascript form field. + * @param string $type field type + * @param string $name field name + * @param int $x horizontal position + * @param int $y vertical position + * @param int $w width + * @param int $h height + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @access protected + * @author Denis Van Nuffelen, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ protected function _addfield($type, $name, $x, $y, $w, $h, $prop) { if ($this->rtl) { $x = $x - $w; @@ -10610,13 +10610,13 @@ if (!class_exists('TCPDF', false)) { // --- FORM FIELDS ----------------------------------------------------- /** - * Convert JavaScript form fields properties array to Annotation Properties array. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @return array of annotation properties - * @access protected - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ + * Convert JavaScript form fields properties array to Annotation Properties array. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @return array of annotation properties + * @access protected + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ protected function getAnnotOptFromJSProp($prop) { if (isset($prop['aopt']) AND is_array($prop['aopt'])) { // the annotation options area lready defined @@ -10975,41 +10975,41 @@ if (!class_exists('TCPDF', false)) { } /** - * Set default properties for form fields. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ + * Set default properties for form fields. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ public function setFormDefaultProp($prop=array()) { $this->default_form_prop = $prop; } /** - * Return the default properties for form fields. - * @return array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ + * Return the default properties for form fields. + * @return array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ public function getFormDefaultProp() { return $this->default_form_prop; } /** - * Creates a text field - * @param string $name field name - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a text field + * @param string $name field name + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11087,20 +11087,20 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a RadioButton field - * @param string $name field name - * @param int $w width - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param string $onvalue value to be returned if selected. - * @param boolean $checked define the initial state. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a RadioButton field + * @param string $name field name + * @param int $w width + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param boolean $checked define the initial state. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11175,20 +11175,20 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a List-box field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param array $values array containing the list of values. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a List-box field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11235,20 +11235,20 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a Combo-box field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param array $values array containing the list of values. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a Combo-box field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11296,20 +11296,20 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a CheckBox field - * @param string $name field name - * @param int $w width - * @param boolean $checked define the initial state. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param string $onvalue value to be returned if selected. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a CheckBox field + * @param string $name field name + * @param int $w width + * @param boolean $checked define the initial state. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11365,21 +11365,21 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a button field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param string $caption caption. - * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ + * Creates a button field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param string $caption caption. + * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @access public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x='', $y='', $js=false) { if ($x === '') { $x = $this->x; @@ -11524,12 +11524,12 @@ if (!class_exists('TCPDF', false)) { // --- END FORMS FIELDS ------------------------------------------------ /** - * Add certification signature (DocMDP or UR3) - * You can set only one signature type - * @access protected - * @author Nicola Asuni - * @since 4.6.008 (2009-05-07) - */ + * Add certification signature (DocMDP or UR3) + * You can set only one signature type + * @access protected + * @author Nicola Asuni + * @since 4.6.008 (2009-05-07) + */ protected function _putsignature() { if ((!$this->sign) OR (!isset($this->signature_data['cert_type']))) { return; @@ -11588,19 +11588,19 @@ if (!class_exists('TCPDF', false)) { } /** - * Set User's Rights for PDF Reader - * WARNING: This works only using the Adobe private key with the setSignature() method!. - * Check the PDF Reference 8.7.1 Transform Methods, - * Table 8.105 Entries in the UR transform parameters dictionary - * @param boolean $enable if true enable user's rights on PDF reader - * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. - * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. - * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate - * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. - * @access public - * @author Nicola Asuni - * @since 2.9.000 (2008-03-26) - */ + * Set User's Rights for PDF Reader + * WARNING: This works only using the Adobe private key with the setSignature() method!. + * Check the PDF Reference 8.7.1 Transform Methods, + * Table 8.105 Entries in the UR transform parameters dictionary + * @param boolean $enable if true enable user's rights on PDF reader + * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. + * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. + * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate + * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. + * @access public + * @author Nicola Asuni + * @since 2.9.000 (2008-03-26) + */ public function setUserRights( $enable=true, $document='/FullSave', @@ -11619,18 +11619,18 @@ if (!class_exists('TCPDF', false)) { } /** - * Enable document signature (requires the OpenSSL Library). - * The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. - * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://') - * @param mixed $private_key private key (string or filename prefixed with 'file://') - * @param string $private_key_password password - * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. - * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. - * @param array $info array of option information: Name, Location, Reason, ContactInfo. - * @access public - * @author Nicola Asuni - * @since 4.6.005 (2009-04-24) - */ + * Enable document signature (requires the OpenSSL Library). + * The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. + * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://') + * @param mixed $private_key private key (string or filename prefixed with 'file://') + * @param string $private_key_password password + * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. + * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. + * @param array $info array of option information: Name, Location, Reason, ContactInfo. + * @access public + * @author Nicola Asuni + * @since 4.6.005 (2009-04-24) + */ public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array()) { // to create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt // to convert pfx certificate to pem: openssl @@ -11653,12 +11653,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Create a new page group. - * NOTE: call this function before calling AddPage() - * @param int $page starting group page (leave empty for next page). - * @access public - * @since 3.0.000 (2008-03-27) - */ + * Create a new page group. + * NOTE: call this function before calling AddPage() + * @param int $page starting group page (leave empty for next page). + * @access public + * @since 3.0.000 (2008-03-27) + */ public function startPageGroup($page='') { if (empty($page)) { $page = $this->page + 1; @@ -11667,13 +11667,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines an alias for the total number of pages. - * It will be substituted as the document is closed. - * @param string $alias The alias. - * @access public - * @since 1.4 - * @see getAliasNbPages(), PageNo(), Footer() - */ + * Defines an alias for the total number of pages. + * It will be substituted as the document is closed. + * @param string $alias The alias. + * @access public + * @since 1.4 + * @see getAliasNbPages(), PageNo(), Footer() + */ public function AliasNbPages($alias='{nb}') { $this->AliasNbPages = $alias; } @@ -11685,7 +11685,7 @@ if (!class_exists('TCPDF', false)) { * @access public * @since 4.0.018 (2008-08-08) * @see AliasNbPages(), PageNo(), Footer() - */ + */ public function getAliasNbPages() { if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { return '{'.$this->AliasNbPages.'}'; @@ -11694,13 +11694,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Defines an alias for the page number. - * It will be substituted as the document is closed. - * @param string $alias The alias. - * @access public - * @since 4.5.000 (2009-01-02) - * @see getAliasNbPages(), PageNo(), Footer() - */ + * Defines an alias for the page number. + * It will be substituted as the document is closed. + * @param string $alias The alias. + * @access public + * @since 4.5.000 (2009-01-02) + * @see getAliasNbPages(), PageNo(), Footer() + */ public function AliasNumPage($alias='{pnb}') { //Define an alias for total number of pages $this->AliasNumPage = $alias; @@ -11713,7 +11713,7 @@ if (!class_exists('TCPDF', false)) { * @access public * @since 4.5.000 (2009-01-02) * @see AliasNbPages(), PageNo(), Footer() - */ + */ public function getAliasNumPage() { if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { return '{'.$this->AliasNumPage.'}'; @@ -11722,21 +11722,21 @@ if (!class_exists('TCPDF', false)) { } /** - * Return the current page in the group. - * @return current page in the group - * @access public - * @since 3.0.000 (2008-03-27) - */ + * Return the current page in the group. + * @return current page in the group + * @access public + * @since 3.0.000 (2008-03-27) + */ public function getGroupPageNo() { return $this->pagegroups[$this->currpagegroup]; } /** - * Returns the current group page number formatted as a string. - * @access public - * @since 4.3.003 (2008-11-18) - * @see PaneNo(), formatPageNumber() - */ + * Returns the current group page number formatted as a string. + * @access public + * @since 4.3.003 (2008-11-18) + * @see PaneNo(), formatPageNumber() + */ public function getGroupPageNoFormatted() { return $this->formatPageNumber($this->getGroupPageNo()); } @@ -11748,7 +11748,7 @@ if (!class_exists('TCPDF', false)) { * @return alias of the current page group * @access public * @since 3.0.000 (2008-03-27) - */ + */ public function getPageGroupAlias() { if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { return '{'.$this->currpagegroup.'}'; @@ -11763,7 +11763,7 @@ if (!class_exists('TCPDF', false)) { * @return alias of the current page group * @access public * @since 4.5.000 (2009-01-02) - */ + */ public function getPageNumGroupAlias() { if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) { return '{'.str_replace('{nb', '{pnb', $this->currpagegroup).'}'; @@ -11772,43 +11772,43 @@ if (!class_exists('TCPDF', false)) { } /** - * Format the page numbers. - * This method can be overriden for custom formats. - * @param int $num page number - * @access protected - * @since 4.2.005 (2008-11-06) - */ + * Format the page numbers. + * This method can be overriden for custom formats. + * @param int $num page number + * @access protected + * @since 4.2.005 (2008-11-06) + */ protected function formatPageNumber($num) { return number_format((float)$num, 0, '', '.'); } /** - * Format the page numbers on the Table Of Content. - * This method can be overriden for custom formats. - * @param int $num page number - * @access protected - * @since 4.5.001 (2009-01-04) - * @see addTOC() - */ + * Format the page numbers on the Table Of Content. + * This method can be overriden for custom formats. + * @param int $num page number + * @access protected + * @since 4.5.001 (2009-01-04) + * @see addTOC() + */ protected function formatTOCPageNumber($num) { return number_format((float)$num, 0, '', '.'); } /** - * Returns the current page number formatted as a string. - * @access public - * @since 4.2.005 (2008-11-06) - * @see PaneNo(), formatPageNumber() - */ + * Returns the current page number formatted as a string. + * @access public + * @since 4.2.005 (2008-11-06) + * @see PaneNo(), formatPageNumber() + */ public function PageNoFormatted() { return $this->formatPageNumber($this->PageNo()); } /** - * Put visibility settings. - * @access protected - * @since 3.0.000 (2008-03-27) - */ + * Put visibility settings. + * @access protected + * @since 3.0.000 (2008-03-27) + */ protected function _putocg() { $this->_newobj(); $this->n_ocg_print = $this->n; @@ -11823,13 +11823,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the visibility of the successive elements. - * This can be useful, for instance, to put a background - * image or color that will show on screen but won't print. - * @param string $v visibility mode. Legal values are: all, print, screen. - * @access public - * @since 3.0.000 (2008-03-27) - */ + * Set the visibility of the successive elements. + * This can be useful, for instance, to put a background + * image or color that will show on screen but won't print. + * @param string $v visibility mode. Legal values are: all, print, screen. + * @access public + * @since 3.0.000 (2008-03-27) + */ public function setVisibility($v) { if ($this->openMarkedContent) { // close existing open marked-content @@ -11860,12 +11860,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Add transparency parameters to the current extgstate - * @param array $params parameters - * @return the number of extgstates - * @access protected - * @since 3.0.000 (2008-03-27) - */ + * Add transparency parameters to the current extgstate + * @param array $params parameters + * @return the number of extgstates + * @access protected + * @since 3.0.000 (2008-03-27) + */ protected function addExtGState($parms) { $n = count($this->extgstates) + 1; // check if this ExtGState already exist @@ -11880,21 +11880,21 @@ if (!class_exists('TCPDF', false)) { } /** - * Add an extgstate - * @param array $gs extgstate - * @access protected - * @since 3.0.000 (2008-03-27) - */ + * Add an extgstate + * @param array $gs extgstate + * @access protected + * @since 3.0.000 (2008-03-27) + */ protected function setExtGState($gs) { $this->_out(sprintf('/GS%d gs', $gs)); } /** - * Put extgstates for object transparency - * @param array $gs extgstate - * @access protected - * @since 3.0.000 (2008-03-27) - */ + * Put extgstates for object transparency + * @param array $gs extgstate + * @access protected + * @since 3.0.000 (2008-03-27) + */ protected function _putextgstates() { $ne = count($this->extgstates); for ($i = 1; $i <= $ne; ++$i) { @@ -11913,23 +11913,23 @@ if (!class_exists('TCPDF', false)) { } /** - * Set alpha for stroking (CA) and non-stroking (ca) operations. - * @param float $alpha real value from 0 (transparent) to 1 (opaque) - * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity - * @access public - * @since 3.0.000 (2008-03-27) - */ + * Set alpha for stroking (CA) and non-stroking (ca) operations. + * @param float $alpha real value from 0 (transparent) to 1 (opaque) + * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity + * @access public + * @since 3.0.000 (2008-03-27) + */ public function setAlpha($alpha, $bm='Normal') { $gs = $this->addExtGState(array('ca' => $alpha, 'CA' => $alpha, 'BM' => '/'.$bm)); $this->setExtGState($gs); } /** - * Set the default JPEG compression quality (1-100) - * @param int $quality JPEG quality, integer between 1 and 100 - * @access public - * @since 3.0.000 (2008-03-27) - */ + * Set the default JPEG compression quality (1-100) + * @param int $quality JPEG quality, integer between 1 and 100 + * @access public + * @since 3.0.000 (2008-03-27) + */ public function setJPEGQuality($quality) { if (($quality < 1) OR ($quality > 100)) { $quality = 75; @@ -11938,70 +11938,70 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the default number of columns in a row for HTML tables. - * @param int $cols number of columns - * @access public - * @since 3.0.014 (2008-06-04) - */ + * Set the default number of columns in a row for HTML tables. + * @param int $cols number of columns + * @access public + * @since 3.0.014 (2008-06-04) + */ public function setDefaultTableColumns($cols=4) { $this->default_table_columns = intval($cols); } /** - * Set the height of the cell (line height) respect the font height. - * @param int $h cell proportion respect font height (typical value = 1.25). - * @access public - * @since 3.0.014 (2008-06-04) - */ + * Set the height of the cell (line height) respect the font height. + * @param int $h cell proportion respect font height (typical value = 1.25). + * @access public + * @since 3.0.014 (2008-06-04) + */ public function setCellHeightRatio($h) { $this->cell_height_ratio = $h; } /** - * return the height of cell repect font height. - * @access public - * @since 4.0.012 (2008-07-24) - */ + * return the height of cell repect font height. + * @access public + * @since 4.0.012 (2008-07-24) + */ public function getCellHeightRatio() { return $this->cell_height_ratio; } /** - * Set the PDF version (check PDF reference for valid values). - * Default value is 1.t - * @access public - * @since 3.1.000 (2008-06-09) - */ + * Set the PDF version (check PDF reference for valid values). + * Default value is 1.t + * @access public + * @since 3.1.000 (2008-06-09) + */ public function setPDFVersion($version='1.7') { $this->PDFVersion = $version; } /** - * Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print. - * (see Section 8.1 of PDF reference, "Viewer Preferences"). - * - * @param array $preferences array of options. - * @author Nicola Asuni - * @access public - * @since 3.1.000 (2008-06-09) - */ + * Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print. + * (see Section 8.1 of PDF reference, "Viewer Preferences"). + * + * @param array $preferences array of options. + * @author Nicola Asuni + * @access public + * @since 3.1.000 (2008-06-09) + */ public function setViewerPreferences($preferences) { $this->viewer_preferences = $preferences; } /** - * Paints color transition registration bars - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param boolean $transition if true prints tcolor transitions to white. - * @param boolean $vertical if true prints bar vertically. - * @param string $colors colors to print, one letter per color separated by comma (for example 'A,W,R,G,B,C,M,Y,K'): A=black, W=white, R=red, G=green, B=blue, C=cyan, M=magenta, Y=yellow, K=black. - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ + * Paints color transition registration bars + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param boolean $transition if true prints tcolor transitions to white. + * @param boolean $vertical if true prints bar vertically. + * @param string $colors colors to print, one letter per color separated by comma (for example 'A,W,R,G,B,C,M,Y,K'): A=black, W=white, R=red, G=green, B=blue, C=cyan, M=magenta, Y=yellow, K=black. + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @access public + */ public function colorRegistrationBar($x, $y, $w, $h, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K') { $bars = explode(',', $colors); $numbars = count($bars); // number of bars to print @@ -12089,17 +12089,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Paints crop mark - * @param float $x abscissa of the crop mark center. - * @param float $y ordinate of the crop mark center. - * @param float $w width of the crop mark. - * @param float $h height of the crop mark. - * @param string $type type of crop mark, one sybol per type separated by comma: A = top left, B = top right, C = bottom left, D = bottom right. - * @param array $color crop mark color (default black). - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ + * Paints crop mark + * @param float $x abscissa of the crop mark center. + * @param float $y ordinate of the crop mark center. + * @param float $w width of the crop mark. + * @param float $h height of the crop mark. + * @param string $type type of crop mark, one sybol per type separated by comma: A = top left, B = top right, C = bottom left, D = bottom right. + * @param array $color crop mark color (default black). + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @access public + */ public function cropMark($x, $y, $w, $h, $type='A,B,C,D', $color=array(0,0,0)) { $this->SetLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color)); $crops = explode(',', $type); @@ -12159,17 +12159,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Paints a registration mark - * @param float $x abscissa of the registration mark center. - * @param float $y ordinate of the registration mark center. - * @param float $r radius of the crop mark. - * @param boolean $double if true print two concentric crop marks. - * @param array $cola crop mark color (default black). - * @param array $colb second crop mark color. - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ + * Paints a registration mark + * @param float $x abscissa of the registration mark center. + * @param float $y ordinate of the registration mark center. + * @param float $r radius of the crop mark. + * @param boolean $double if true print two concentric crop marks. + * @param array $cola crop mark color (default black). + * @param array $colb second crop mark color. + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @access public + */ public function registrationMark($x, $y, $r, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)) { $line_style = array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola); $this->SetFillColorArray($cola); @@ -12189,58 +12189,58 @@ if (!class_exists('TCPDF', false)) { } /** - * Paints a linear colour gradient. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (RGB components). - * @param array $col2 second color (RGB components). - * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ + * Paints a linear colour gradient. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (RGB components). + * @param array $col2 second color (RGB components). + * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access public + */ public function LinearGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0,0,1,0)) { $this->Clip($x, $y, $w, $h); $this->Gradient(2, $col1, $col2, $coords); } /** - * Paints a radial colour gradient. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (RGB components). - * @param array $col2 second color (RGB components). - * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ + * Paints a radial colour gradient. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (RGB components). + * @param array $col2 second color (RGB components). + * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access public + */ public function RadialGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0.5,0.5,0.5,0.5,1)) { $this->Clip($x, $y, $w, $h); $this->Gradient(3, $col1, $col2, $coords); } /** - * Paints a coons patch mesh. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (lower left corner) (RGB components). - * @param array $col2 second color (lower right corner) (RGB components). - * @param array $col3 third color (upper right corner) (RGB components). - * @param array $col4 fourth color (upper left corner) (RGB components). - * @param array $coords - * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 - * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ + * Paints a coons patch mesh. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (lower left corner) (RGB components). + * @param array $col2 second color (lower right corner) (RGB components). + * @param array $col3 third color (upper right corner) (RGB components). + * @param array $col4 fourth color (upper left corner) (RGB components). + * @param array $coords + * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 + * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access public + */ public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $col3=array(), $col4=array(), $coords=array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min=0, $coords_max=1) { $this->Clip($x, $y, $w, $h); $n = count($this->gradients) + 1; @@ -12312,15 +12312,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Set a rectangular clipping area. - * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode). - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ + * Set a rectangular clipping area. + * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode). + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access protected + */ protected function Clip($x, $y, $w, $h) { if ($this->rtl) { $x = $this->w - $x - $w; @@ -12335,15 +12335,15 @@ if (!class_exists('TCPDF', false)) { } /** - * Output gradient. - * @param int $type type of gradient. - * @param array $col1 first color array (GRAY, RGB or CMYK) - * @param array $col2 second color array (GRAY, RGB or CMYK) - must be the same color type as $col1 - * @param array $coords array of coordinates. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ + * Output gradient. + * @param int $type type of gradient. + * @param array $col1 first color array (GRAY, RGB or CMYK) + * @param array $col2 second color array (GRAY, RGB or CMYK) - must be the same color type as $col1 + * @param array $coords array of coordinates. + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access protected + */ protected function Gradient($type, $col1, $col2, $coords) { $n = count($this->gradients) + 1; $this->gradients[$n]['type'] = $type; @@ -12374,11 +12374,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Output shaders. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ + * Output shaders. + * @author Andreas Würmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access protected + */ function _putshaders() { foreach ($this->gradients as $id => $grad) { if (($grad['type'] == 2) OR ($grad['type'] == 3)) { @@ -12428,31 +12428,31 @@ if (!class_exists('TCPDF', false)) { } /** - * Output an arc - * @author Maxime Delorme, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ + * Output an arc + * @author Maxime Delorme, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access protected + */ protected function _outarc($x1, $y1, $x2, $y2, $x3, $y3) { $h = $this->h; $this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c', $x1*$this->k, ($h-$y1)*$this->k, $x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k)); } /** - * Draw the sector of a circle. - * It can be used for instance to render pie charts. - * @param float $xc abscissa of the center. - * @param float $yc ordinate of the center. - * @param float $r radius. - * @param float $a start angle (in degrees). - * @param float $b end angle (in degrees). - * @param string $style: D, F, FD or DF (draw, fill, fill and draw). Default: FD. - * @param float $cw: indicates whether to go clockwise (default: true). - * @param float $o: origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. - * @author Maxime Delorme, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ + * Draw the sector of a circle. + * It can be used for instance to render pie charts. + * @param float $xc abscissa of the center. + * @param float $yc ordinate of the center. + * @param float $r radius. + * @param float $a start angle (in degrees). + * @param float $b end angle (in degrees). + * @param string $style: D, F, FD or DF (draw, fill, fill and draw). Default: FD. + * @param float $cw: indicates whether to go clockwise (default: true). + * @param float $o: origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. + * @author Maxime Delorme, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access public + */ public function PieSector($xc, $yc, $r, $a, $b, $style='FD', $cw=true, $o=90) { if ($this->rtl) { $xc = $this->w - $xc; @@ -12514,23 +12514,23 @@ if (!class_exists('TCPDF', false)) { } /** - * Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. - * Only vector drawing is supported, not text or bitmap. - * Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2). - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param mixed $link URL or identifier returned by AddLink(). - * @param boolean useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: - * @param string $palign Allows to center or align the image on the current line. Possible values are: - * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): - * @author Valentin Schmidt, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ + * Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. + * Only vector drawing is supported, not text or bitmap. + * Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2). + * @param string $file Name of the file containing the image. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param mixed $link URL or identifier returned by AddLink(). + * @param boolean useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: + * @param string $palign Allows to center or align the image on the current line. Possible values are: + * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @author Valentin Schmidt, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @access public + */ public function ImageEps($file, $x='', $y='', $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0) { if ($x === '') { $x = $this->x; @@ -16096,13 +16096,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the booklet mode for double-sided pages. - * @param boolean $booklet true set the booklet mode on, fals eotherwise. - * @param float $inner Inner page margin. - * @param float $outer Outer page margin. - * @access public - * @since 4.2.000 (2008-10-29) - */ + * Set the booklet mode for double-sided pages. + * @param boolean $booklet true set the booklet mode on, fals eotherwise. + * @param float $inner Inner page margin. + * @param float $outer Outer page margin. + * @access public + * @since 4.2.000 (2008-10-29) + */ public function SetBooklet($booklet=true, $inner=-1, $outer=-1) { $this->booklet = $booklet; if ($inner >= 0) { @@ -16114,11 +16114,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Swap the left and right margins. - * @param boolean $reverse if true swap left and right margins. - * @access protected - * @since 4.2.000 (2008-10-29) - */ + * Swap the left and right margins. + * @param boolean $reverse if true swap left and right margins. + * @access protected + * @since 4.2.000 (2008-10-29) + */ protected function swapMargins($reverse=true) { if ($reverse) { // swap left and right margins @@ -16132,63 +16132,63 @@ if (!class_exists('TCPDF', false)) { } /** - * Set the vertical spaces for HTML tags. - * The array must have the following structure (example): - * $tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); - * The first array level contains the tag names, - * the second level contains 0 for opening tags or 1 for closing tags, - * the third level contains the vertical space unit (h) and the number spaces to add (n). - * If the h parameter is not specified, default values are used. - * @param array $tagvs array of tags and relative vertical spaces. - * @access public - * @since 4.2.001 (2008-10-30) - */ + * Set the vertical spaces for HTML tags. + * The array must have the following structure (example): + * $tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); + * The first array level contains the tag names, + * the second level contains 0 for opening tags or 1 for closing tags, + * the third level contains the vertical space unit (h) and the number spaces to add (n). + * If the h parameter is not specified, default values are used. + * @param array $tagvs array of tags and relative vertical spaces. + * @access public + * @since 4.2.001 (2008-10-30) + */ public function setHtmlVSpace($tagvs) { $this->tagvspaces = $tagvs; } /** - * Set custom width for list indentation. - * @param float $width width of the indentation. Use negative value to disable it. - * @access public - * @since 4.2.007 (2008-11-12) - */ + * Set custom width for list indentation. + * @param float $width width of the indentation. Use negative value to disable it. + * @access public + * @since 4.2.007 (2008-11-12) + */ public function setListIndentWidth($width) { return $this->customlistindent = floatval($width); } /** - * Set the top/bottom cell sides to be open or closed when the cell cross the page. - * @param boolean $isopen if true keeps the top/bottom border open for the cell sides that cross the page. - * @access public - * @since 4.2.010 (2008-11-14) - */ + * Set the top/bottom cell sides to be open or closed when the cell cross the page. + * @param boolean $isopen if true keeps the top/bottom border open for the cell sides that cross the page. + * @access public + * @since 4.2.010 (2008-11-14) + */ public function setOpenCell($isopen) { $this->opencell = $isopen; } /** - * Set the color and font style for HTML links. - * @param array $color RGB array of colors - * @param string $fontstyle additional font styles to add - * @access public - * @since 4.4.003 (2008-12-09) - */ + * Set the color and font style for HTML links. + * @param array $color RGB array of colors + * @param string $fontstyle additional font styles to add + * @access public + * @since 4.4.003 (2008-12-09) + */ public function setHtmlLinksStyle($color=array(0,0,255), $fontstyle='U') { $this->htmlLinkColorArray = $color; $this->htmlLinkFontStyle = $fontstyle; } /** - * Convert HTML string containing value and unit of measure to user's units or points. - * @param string $htmlval string containing values and unit - * @param string $refsize reference value in points - * @param string $defaultunit default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). - * @param boolean $point if true returns points, otherwise returns value in user's units - * @return float value in user's unit or point if $points=true - * @access public - * @since 4.4.004 (2008-12-10) - */ + * Convert HTML string containing value and unit of measure to user's units or points. + * @param string $htmlval string containing values and unit + * @param string $refsize reference value in points + * @param string $defaultunit default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). + * @param boolean $point if true returns points, otherwise returns value in user's units + * @return float value in user's unit or point if $points=true + * @access public + * @since 4.4.004 (2008-12-10) + */ public function getHTMLUnitToUnits($htmlval, $refsize=1, $defaultunit='px', $points=false) { $supportedunits = array('%', 'em', 'ex', 'px', 'in', 'cm', 'mm', 'pc', 'pt'); $retval = 0; @@ -16257,12 +16257,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns the Roman representation of an integer number - * @param int number to convert - * @return string roman representation of the specified number - * @access public - * @since 4.4.004 (2008-12-10) - */ + * Returns the Roman representation of an integer number + * @param int number to convert + * @return string roman representation of the specified number + * @access public + * @since 4.4.004 (2008-12-10) + */ public function intToRoman($number) { $roman = ''; while ($number >= 1000) { @@ -16321,13 +16321,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Output an HTML list bullet or ordered item symbol - * @param int $listdepth list nesting level - * @param string $listtype type of list - * @param float $size current font size - * @access protected - * @since 4.4.004 (2008-12-10) - */ + * Output an HTML list bullet or ordered item symbol + * @param int $listdepth list nesting level + * @param string $listtype type of list + * @param float $size current font size + * @access protected + * @since 4.4.004 (2008-12-10) + */ protected function putHtmlListBullet($listdepth, $listtype='', $size=10) { $size /= $this->k; $fill = ''; @@ -16465,11 +16465,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns current graphic variables as array. - * @return array graphic variables - * @access protected - * @since 4.2.010 (2008-11-14) - */ + * Returns current graphic variables as array. + * @return array graphic variables + * @access protected + * @since 4.2.010 (2008-11-14) + */ protected function getGraphicVars() { $grapvars = array( 'FontFamily' => $this->FontFamily, @@ -16498,11 +16498,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Set graphic variables. - * @param $gvars array graphic variables - * @access protected - * @since 4.2.010 (2008-11-14) - */ + * Set graphic variables. + * @param $gvars array graphic variables + * @access protected + * @since 4.2.010 (2008-11-14) + */ protected function setGraphicVars($gvars) { $this->FontFamily = $gvars['FontFamily']; $this->FontStyle = $gvars['FontStyle']; @@ -16532,24 +16532,24 @@ if (!class_exists('TCPDF', false)) { } /** - * Returns a temporary filename for caching object on filesystem. - * @param string $prefix prefix to add to filename - * return string filename. - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Returns a temporary filename for caching object on filesystem. + * @param string $prefix prefix to add to filename + * return string filename. + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function getObjFilename($name) { return tempnam(K_PATH_CACHE, $name.'_'); } /** - * Writes data to a temporary file on filesystem. - * @param string $file file name - * @param mixed $data data to write on file - * @param boolean $append if true append data, false replace. - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Writes data to a temporary file on filesystem. + * @param string $file file name + * @param mixed $data data to write on file + * @param boolean $append if true append data, false replace. + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function writeDiskCache($filename, $data, $append=false) { if ($append) { $fmode = 'ab+'; @@ -16572,22 +16572,22 @@ if (!class_exists('TCPDF', false)) { } /** - * Read data from a temporary file on filesystem. - * @param string $file file name - * @return mixed retrieved data - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Read data from a temporary file on filesystem. + * @param string $file file name + * @return mixed retrieved data + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function readDiskCache($filename) { return file_get_contents($filename); } /** - * Set buffer content (always append data). - * @param string $data data - * @access protected - * @since 4.5.000 (2009-01-02) - */ + * Set buffer content (always append data). + * @param string $data data + * @access protected + * @since 4.5.000 (2009-01-02) + */ protected function setBuffer($data) { $this->bufferlen += strlen($data); if ($this->diskcache) { @@ -16601,11 +16601,11 @@ if (!class_exists('TCPDF', false)) { } /** - * Get buffer content. - * @return string buffer content - * @access protected - * @since 4.5.000 (2009-01-02) - */ + * Get buffer content. + * @return string buffer content + * @access protected + * @since 4.5.000 (2009-01-02) + */ protected function getBuffer() { if ($this->diskcache) { return $this->readDiskCache($this->buffer); @@ -16615,13 +16615,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set page buffer content. - * @param int $page page number - * @param string $data page data - * @param boolean $append if true append data, false replace. - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Set page buffer content. + * @param int $page page number + * @param string $data page data + * @param boolean $append if true append data, false replace. + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function setPageBuffer($page, $data, $append=false) { if ($this->diskcache) { if (!isset($this->pages[$page])) { @@ -16643,12 +16643,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Get page buffer content. - * @param int $page page number - * @return string page buffer content or false in case of error - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Get page buffer content. + * @param int $page page number + * @return string page buffer content or false in case of error + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function getPageBuffer($page) { if ($this->diskcache) { return $this->readDiskCache($this->pages[$page]); @@ -16659,12 +16659,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Set image buffer content. - * @param string $image image key - * @param array $data image data - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Set image buffer content. + * @param string $image image key + * @param array $data image data + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function setImageBuffer($image, $data) { if ($this->diskcache) { if (!isset($this->images[$image])) { @@ -16681,13 +16681,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set image buffer content for a specified sub-key. - * @param string $image image key - * @param string $key image sub-key - * @param array $data image data - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Set image buffer content for a specified sub-key. + * @param string $image image key + * @param string $key image sub-key + * @param array $data image data + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function setImageSubBuffer($image, $key, $data) { if (!isset($this->images[$image])) { $this->setImageBuffer($image, array()); @@ -16702,12 +16702,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Get image buffer content. - * @param string $image image key - * @return string image buffer content or false in case of error - * @access protected - * @since 4.5.000 (2008-12-31) - */ + * Get image buffer content. + * @param string $image image key + * @return string image buffer content or false in case of error + * @access protected + * @since 4.5.000 (2008-12-31) + */ protected function getImageBuffer($image) { if ($this->diskcache AND isset($this->images[$image])) { return unserialize($this->readDiskCache($this->images[$image])); @@ -16718,12 +16718,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Set font buffer content. - * @param string $font font key - * @param array $data font data - * @access protected - * @since 4.5.000 (2009-01-02) - */ + * Set font buffer content. + * @param string $font font key + * @param array $data font data + * @access protected + * @since 4.5.000 (2009-01-02) + */ protected function setFontBuffer($font, $data) { if ($this->diskcache) { if (!isset($this->fonts[$font])) { @@ -16739,13 +16739,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set font buffer content. - * @param string $font font key - * @param string $key font sub-key - * @param array $data font data - * @access protected - * @since 4.5.000 (2009-01-02) - */ + * Set font buffer content. + * @param string $font font key + * @param string $key font sub-key + * @param array $data font data + * @access protected + * @since 4.5.000 (2009-01-02) + */ protected function setFontSubBuffer($font, $key, $data) { if (!isset($this->fonts[$font])) { $this->setFontBuffer($font, array()); @@ -16760,12 +16760,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Get font buffer content. - * @param string $font font key - * @return string font buffer content or false in case of error - * @access protected - * @since 4.5.000 (2009-01-02) - */ + * Get font buffer content. + * @param string $font font key + * @return string font buffer content or false in case of error + * @access protected + * @since 4.5.000 (2009-01-02) + */ protected function getFontBuffer($font) { if ($this->diskcache AND isset($this->fonts[$font])) { return unserialize($this->readDiskCache($this->fonts[$font])); @@ -16776,13 +16776,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Move a page to a previous position. - * @param int $frompage number of the source page - * @param int $topage number of the destination page (must be less than $frompage) - * @return true in case of success, false in case of error. - * @access public - * @since 4.5.000 (2009-01-02) - */ + * Move a page to a previous position. + * @param int $frompage number of the source page + * @param int $topage number of the destination page (must be less than $frompage) + * @return true in case of success, false in case of error. + * @access public + * @since 4.5.000 (2009-01-02) + */ public function movePage($frompage, $topage) { if (($frompage > $this->numpages) OR ($frompage <= $topage)) { return false; @@ -16914,12 +16914,12 @@ if (!class_exists('TCPDF', false)) { } /** - * Remove the specified page. - * @param int $page page to remove - * @return true in case of success, false in case of error. - * @access public - * @since 4.6.004 (2009-04-23) - */ + * Remove the specified page. + * @param int $page page to remove + * @return true in case of success, false in case of error. + * @access public + * @since 4.6.004 (2009-04-23) + */ public function deletePage($page) { if ($page > $this->numpages) { return false; @@ -17051,17 +17051,17 @@ if (!class_exists('TCPDF', false)) { } /** - * Output a Table of Content Index (TOC). - * After calling this method you have to call addPage() to add other content. - * You can override this method to achieve different styles. - * @param int $page page number where this TOC should be inserted (leave empty for current page). - * @param string $numbersfont set the font for page numbers (please use monospaced font for better alignment). - * @param string $filler string used to fill the space between text and page number. - * @param string $toc_name name to use for TOC bookmark. - * @access public - * @author Nicola Asuni - * @since 4.5.000 (2009-01-02) - */ + * Output a Table of Content Index (TOC). + * After calling this method you have to call addPage() to add other content. + * You can override this method to achieve different styles. + * @param int $page page number where this TOC should be inserted (leave empty for current page). + * @param string $numbersfont set the font for page numbers (please use monospaced font for better alignment). + * @param string $filler string used to fill the space between text and page number. + * @param string $toc_name name to use for TOC bookmark. + * @access public + * @author Nicola Asuni + * @since 4.5.000 (2009-01-02) + */ public function addTOC($page='', $numbersfont='', $filler='.', $toc_name='TOC') { $fontsize = $this->FontSizePt; $fontfamily = $this->FontFamily; @@ -17200,10 +17200,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Stores a copy of the current TCPDF object used for undo operation. - * @access public - * @since 4.5.029 (2009-03-19) - */ + * Stores a copy of the current TCPDF object used for undo operation. + * @access public + * @since 4.5.029 (2009-03-19) + */ public function startTransaction() { if (isset($this->objcopy)) { // remove previous copy @@ -17217,10 +17217,10 @@ if (!class_exists('TCPDF', false)) { } /** - * Delete the copy of the current TCPDF object used for undo operation. - * @access public - * @since 4.5.029 (2009-03-19) - */ + * Delete the copy of the current TCPDF object used for undo operation. + * @access public + * @since 4.5.029 (2009-03-19) + */ public function commitTransaction() { if (isset($this->objcopy)) { $this->objcopy->_destroy(true, true); @@ -17229,12 +17229,12 @@ if (!class_exists('TCPDF', false)) { } /** - * This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction(). - * @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value. - * @return TCPDF object. - * @access public - * @since 4.5.029 (2009-03-19) - */ + * This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction(). + * @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value. + * @return TCPDF object. + * @access public + * @since 4.5.029 (2009-03-19) + */ public function rollbackTransaction($self=false) { if (isset($this->objcopy)) { if (isset($this->objcopy->diskcache) AND $this->objcopy->diskcache) { @@ -17258,36 +17258,36 @@ if (!class_exists('TCPDF', false)) { } /** - * Creates a copy of a class object - * @param object $object class object to be cloned - * @return cloned object - * @access public - * @since 4.5.029 (2009-03-19) - */ + * Creates a copy of a class object + * @param object $object class object to be cloned + * @return cloned object + * @access public + * @since 4.5.029 (2009-03-19) + */ public function objclone($object) { return @clone($object); } /** - * Determine whether a string is empty. - * @param string $str string to be checked - * @return boolean true if string is empty - * @access public - * @since 4.5.044 (2009-04-16) - */ + * Determine whether a string is empty. + * @param string $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))); } /** - * Find position of last occurrence of a substring in a string - * @param string $haystack The string to search in. - * @param string $needle substring to search. - * @param int $offset May be specified to begin searching an arbitrary number of characters into the string. - * @return Returns the position where the needle exists. Returns FALSE if the needle was not found. - * @access public - * @since 4.8.038 (2010-03-13) - */ + * Find position of last occurrence of a substring in a string + * @param string $haystack The string to search in. + * @param string $needle substring to search. + * @param int $offset May be specified to begin searching an arbitrary number of characters into the string. + * @return Returns the position where the needle exists. Returns FALSE if the needle was not found. + * @access public + * @since 4.8.038 (2010-03-13) + */ public function revstrpos($haystack, $needle, $offset = 0) { $length = strlen($haystack); $offset = ($offset > 0)?($length - $offset):abs($offset); @@ -17402,13 +17402,13 @@ if (!class_exists('TCPDF', false)) { } /** - * Set Text rendering mode. - * @param int $stroke outline size in user units (0 = disable). - * @param boolean $fill if true fills the text (default). - * @param boolean $clip if true activate clipping mode - * @access public - * @since 4.9.008 (2009-04-02) - */ + * Set Text rendering mode. + * @param int $stroke outline size in user units (0 = disable). + * @param boolean $fill if true fills the text (default). + * @param boolean $clip if true activate clipping mode + * @access public + * @since 4.9.008 (2009-04-02) + */ public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode // convert text rendering parameters @@ -17458,6 +17458,170 @@ if (!class_exists('TCPDF', false)) { $this->textstrokewidth = $stroke * $this->k; } + /** + * Returns an array of chars containing soft hyphens. + * @param array $word array of chars + * @param array $patterns Array of hypenation patterns. + * @param array $dictionary Array of words to be returned without applying the hyphenation algoritm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word lenght to apply the hyphenation algoritm. + * @param int $charmax Maximum lenght of broken piece of word. + * @return array text with soft hyphens + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @access protected + */ + protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { + $hyphenword = array(); // hyphens positions + $numchars = count($word); + if ($numchars <= $charmin) { + return $word; + } + $word_string = $this->UTF8ArrSubString($word); + // some words will be returned as-is + $pattern = '/^([a-zA-Z0-9_\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; + if (preg_match($pattern, $word_string) > 0) { + // email + return $word; + } + $pattern = '/(([a-zA-Z0-9\-]+\.)?)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; + if (preg_match($pattern, $word_string) > 0) { + // URL + return $word; + } + if (isset($dictionary[$word_string])) { + return $this->UTF8StringToArray($dictionary[$word_string]); + } + // suround word with '_' characters + $tmpword = array_merge(array(95), $word, array(95)); + $tmpnumchars = $numchars + 2; + $maxpos = $tmpnumchars - $charmin; + for ($pos = 0; $pos < $maxpos; ++$pos) { + $imax = min(($tmpnumchars - $pos), $charmax); + for ($i = $charmin; $i <= $imax; ++$i) { + $subword = strtolower($this->UTF8ArrSubString($tmpword, $pos, $pos + $i)); + if (isset($patterns[$subword])) { + $pattern = $this->UTF8StringToArray($patterns[$subword]); + $pattern_length = count($pattern); + $digits = 1; + for ($j = 0; $j < $pattern_length; ++$j) { + // check if $pattern[$j] is a number + if (($pattern[$j] >= 48) AND ($pattern[$j] <= 57)) { + if ($j == 0) { + $zero = $pos - 1; + } else { + $zero = $pos + $j - $digits; + } + if (!isset($hyphenword[$zero]) OR ($hyphenword[$zero] != $pattern[$j])) { + $hyphenword[$zero] = $this->unichr($pattern[$j]); + } + ++$digits; + } + } + } + } + } + $inserted = 0; + $maxpos = $numchars - $rightmin; + for($i = $leftmin; $i <= $maxpos; ++$i) { + if(isset($hyphenword[$i]) AND (($hyphenword[$i] % 2) != 0)) { + // 173 = soft hyphen character + array_splice($word, $i + $inserted, 0, 173); + ++$inserted; + } + } + return $word; + } + + /** + * Returns an array of hyphenation patterns. + * @param string $file TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + * @return array of hyphenation patterns + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @access public + */ + public function getHyphenPatternsFromTEX($file) { + // TEX patterns are available at: + // http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + $data = file_get_contents($file); + $patterns = array(); + // remove comments + $data = preg_replace('/\%[^\n]*/', '', $data); + // extract the patterns part + preg_match('/\\\\patterns\{([^\}]*)\}/i', $data, $matches); + $data = trim(substr($matches[0], 10, -1)); + // extract each pattern + $patterns_array = preg_split('/[\s]+/', $data); + // create new language array of patterns + $patterns = array(); + foreach($patterns_array as $val) { + if (!$this->empty_string($val)) { + $val = trim($val); + $val = str_replace('\'', '\\\'', $val); + $key = preg_replace('/[0-9]+/', '', $val); + $patterns[$key] = $val; + } + } + return $patterns; + } + + /** + * Returns text with soft hyphens. + * @param string $text text to process + * @param mixed $patterns Array of hypenation patterns or a TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + * @param array $dictionary Array of words to be returned without applying the hyphenation algoritm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word lenght to apply the hyphenation algoritm. + * @param int $charmax Maximum lenght of broken piece of word. + * @return array text with soft hyphens + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @access public + */ + public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { + global $unicode; + $text = $this->unhtmlentities($text); + $word = array(); // last word + $txtarr = array(); // text to be returned + $intag = false; // true if we are inside an HTML tag + if (!is_array($patterns)) { + $patterns = $this->getHyphenPatternsFromTEX($patterns); + } + // get array of characters + $unichars = $this->UTF8StringToArray($text); + // for each char + foreach ($unichars as $char) { + if ((!$intag) AND $unicode[$char] == 'L') { + // letter character + $word[] = $char; + } else { + // other type of character + if (!$this->empty_string($word)) { + // hypenate the word + $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); + $word = array(); + } + $txtarr[] = $char; + if (chr($char) == '<') { + // we are inside an HTML tag + $intag = true; + } elseif ($intag AND (chr($char) == '>')) { + // end of HTML tag + $intag = false; + } + } + } + if (!$this->empty_string($word)) { + // hypenate the word + $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); + } + // convert char array to string and return + return $this->UTF8ArrSubString($txtarr); + } + } // END OF TCPDF CLASS } //============================================================+