+ - Patch #71 "External and internal links, local and remote" wa applied.
+
+6.0.080 (2014-05-20)
+ - Bug item #921 "Fatal error in hyphenateText() function" was fixed.
+ - Bug item #923 "Automatic Hyphenation error" was fixed.
+ - Patch #70 "Augument TCPDFBarcode classes with ability to return raw png image data" was applied.
+
+6.0.079 (2014-05-19)
+ - Patch item #69 "Named destinations, HTML internal and external links" was merged.
+ - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed.
+ - Image method now trigs an error in case the cache is now writeable.
+ - Fixed issue with layer default status.
+
+6.0.078 (2014-05-12)
+ - A warning issue in addTTFfont() method was fixed.
+ - Fonts were updated to include cbbox metrics.
+
+6.0.077 (2014-05-06)
+ - A Datamatrix barcode bug was fixed.
+
+6.0.076 (2014-05-06)
+ - A bug in Datamatrix Base256 encoding was fixed.
+ - Merged fix for SVG use/clip-gradient.
+ - Now it is possible to prefix a page number in Link methods with the * character to avoid been changed when adding/deleting/moving pages (see example_045.php).
+
+6.0.075 (2014-05-05)
+ - Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
+
+6.0.074 (2014-05-03)
+ - Part of Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
+ - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
+
+6.0.073 (2014-04-29)
+ - Bug #913 "Possible bug with line-height" was fixed.
+ - Bug #914 "MultiCell and FitCell" was fixed.
+ - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
+
+6.0.072 (2014-04-27)
+ - Deprecated curly braces substring syntax was replaced with square braces.
+
+6.0.071 (2014-04-25)
+ - Bug #911 "error with buffered png pics" was fixed.
+
+6.0.070 (2014-04-24)
+ - Bug #910 "An SVG image is being cut off (with clipping mask) when you use align options" was fixed.
+
+6.0.069 (2014-04-24)
+ - Datamatrix Base256 encoding was fixed.
+
+6.0.068 (2014-04-22)
+ - Some Datamatrix barcode bugs were fixed.
+
+6.0.067 (2014-04-21)
+ - startLayer() method signature was changed to include a new "lock" parameter.
+
+6.0.066 (2014-04-20)
+ - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed.
+
+6.0.065 (2014-04-10)
+ - Bug #905 "RGB percentage color bug in convertHTMLColorToDec()" was fixed.
+
+6.0.064 (2014-04-07)
+ - Header and Footer fonts are now set by default.
+ - Bug #904 "PDF corrupted" was fixed.
+
+6.0.063 (2014-04-03)
+ - Method TCPDF_IMAGES::_parsepng() was fixed to support transparency in Indexed images.
+
+6.0.062 (2014-03-02)
+ - The method startLayer() now accepts the NULL value for the $print parameter to not set the print layer option.
+
+6.0.061 (2014-02-18)
+ - Bug #893 "Parsing error on streamed xref for secured pdf" was fixed.
+
+6.0.060 (2014-02-16)
+ - Bug #891 "Error on parsing hexa fields" was fixed.
+ - Bug #892 "Parsing pdf with trailing space at start" was fixed.
+
+6.0.059 (2014-02-03)
+ - SVG 'use' support was imporved.
+
+6.0.058 (2014-01-31)
+ - Bug #886 "Bugs with SVG using <defs> and <use>" was fixed.
+
+6.0.057 (2014-01-26)
+ - Bug #883 "Parsing error" was fixed.
+
+6.0.056 (2014-01-25)
+ - The automatic cache folder selection now works also with some restricted hosting environments.
+ - CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz).
+ - Bug #884 "Parsing error prev tag looking for" was fixed.
+ - Bug #879 "Thead on the second page inherits style of previous tr" was fixed
+
+6.0.054 (2014-01-13)
+ - Bug #877 "Parenteses causing corrupt text" was fixed.
+
+6.0.053 (2014-01-03)
+ - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed.
+ - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied.
+
+6.0.052 (2013-12-12)
+ - Bug #871 "Datamatrix coding" was fixed.
+
+6.0.051 (2013-12-02)
+ - cbbox array values in addTTFfont() were converted to integers.
+
+6.0.050 (2013-12-01)
+ - The method getNumLines() was extended to support hyphenation.
+ - The CSS property line-height now supports non percentage values.
+
+6.0.050 (2013-11-27)
+ - A bug related to PNG images was fixed.
+
+6.0.048 (2013-11-24)
+ - SVG vars are now reset in ImageSVG() method.
+
+6.0.047 (2013-11-19)
+ - SVG support was extended to support some nested defs.
+
+6.0.046 (2013-11-17)
+ - preg_replace_callback functions were replaced to improve memory performances.
+
+6.0.045 (2013-11-17)
+ - Bug #862 "Parsing error on flate filter" was fixed.
+
+6.0.044 (2013-11-10)
+ - Bug #857 "Undefined offset error" was fixed.
+ - The uniord method now uses a static cache to improve performances (thanks to Mathieu Masseboeuf for the sugegstion).
+ - Two bugs in the TCPDF_FONTS class were fixed.
+
+6.0.043 (2013-10-29)
+ - Bug #854 "CSS instruction display" was fixed.
+
+6.0.042 (2013-10-25)
+ - Bug #852 "CMYK Colors Bug" was fixed.
+
+6.0.041 (2013-10-21)
+ - Bug #851 "Problem with images in PDF. PHP timing out" was fixed.
+
+6.0.040 (2013-10-20)
+ - Bug #849 "SVG import bug" was fixed.
+
+6.0.039 (2013-10-13)
+ - Bug #843 "Wrong call in parser" was fixed.
+ - Bug #844 "Wrong object type named" was fixed.
+ - Bug #845 "Parsing error on obj ref prefixed by '000000'" was fixed.
+
+6.0.038 (2013-10-06)
+ - Bug #841 "Division by zero warning at writeHTML a <li> tag" was fixed.
+
+6.0.037 (2013-09-30)
+ - Method getAllSpotColors() was added to return all spot colors.
+ - Method colorRegistrationBar() was extended to automatically print all spot colors and support individual spot colors.
+ - The method registrationMarkCMYK() was added to print a registration mark for CMYK colors.
+ - A bug related to page groups was fixed.
+ - Gradient() method now supports CMYK equivalents of spot colors.
+ - Example n. 56 was updated.
+
+6.0.036 (2013-09-29)
+ - Methods for registration bars and crop marks were extended to support registration color (see example n. 56).
+ - New default spot colors were added to tcpdf_colors.php, including the 'All' and 'None' special registration colors.
+
+6.0.035 (2013-09-25)
+ - TCPDF_PARSER class was improved.
+
+6.0.034 (2013-09-24)
+ - Bug #839 "Error in xref parsing in mixed newline chars" was fixed.
+
+6.0.033 (2013-09-23)
+ - Bug fix related to PNG image transparency using GD library.
+
+6.0.032 (2013-09-23)
+ - Bug #838 "Fatal error when imagick cannot handle the image, even though GD is available and can" was fixed.
+
+6.0.031 (2013-09-18)
+ - Bug #836 "Optional EOL marker before endstream" was fixed.
+ - Some additional controls were added to avoid "division by zero" error with badly formatted input.
+
+6.0.030 (2013-09-17)
+ - Bug #835 "PDF417 and Cyrilic simbols" was fixed.
+
+6.0.029 (2013-09-15)
+ - Constants K_TCPDF_PARSER_THROW_EXCEPTION_ERROR and K_TCPDF_PARSER_IGNORE_DECODING_ERRORS where removed in favor of a new configuration array in the TCPDF_PARSER class.
+ - The TCPDF_PARSER class can now be configured using the new $cfg parameter.
+
+6.0.028 (2013-09-15)
+ - A debug print_r was removed form tcpdf_parser.php.
+ - TCPDF_FILTERS class now throws an exception in case of error.
+ - TCPDF_PARSER class now throws an exception in case of error unless you define the constant K_TCPDF_PARSER_THROW_EXCEPTION_ERROR to false.
+ - The constant K_TCPDF_PARSER_IGNORE_DECODING_ERRORS can be set to tru eto ignore decoding errors on TCPDF_PARSER.
+
+6.0.027 (2013-09-14)
+ - A bug in tcpdf_parser wen parsing hexadecimal strings was fixed.
+ - A bug in tcpdf_parser wen looking for statxref was fixed.
+ - A bug on RC4 encryption was fixed.
+
+6.0.026 (2013-09-14)
+ - A bug in tcpdf_parser wen decoding streams was fixed.
+
+6.0.025 (2013-09-04)
+ - A pregSplit() bug was fixed.
+ - Improved content loading from URLs.
+ - Improved font path loading.
+
+6.0.024 (2013-09-02)
+ - Bug #826 "addEmptySignatureAppearance issue" was fixed.
+
+6.0.023 (2013-08-05)
+ - GNU Freefont fonts were updated.
+ - Licensing and copyright information about fonts were improved.
+ - PNG image support was improved.
+
+6.0.022 (2013-08-02)
+ - fixing initialization problem for signature_appearance property.
+
+6.0.021 (2013-07-18)
+ - The bug caused by the preg_split function on some PHP 5.2.x versions was fixed.
+
+6.0.020 (2013-06-04)
+ - The method addTTFfont() was fixed (Bug item #813 Undefined offset).
+
+6.0.019 (2013-06-04)
+ - The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility.
+ - The exceptions raised by file_exists() function were suppressed.
+
+6.0.018 (2013-05-19)
+ - The barcode examples were changed to automatically search for the barcode class path (in case the examples directory is not installed under the TCPDF root).
+
+6.0.017 (2013-05-16)
+ - The command line tool tcpdf_addfont.php was improved.
+ - The php logic was removed from configuration files that now contains only constant defines.
+ - The tcpdf_autoconfig.php file was added to automatically set missing configuration values.
+
+6.0.016 (2013-05-15)
+ - The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
+ - Constant K_PATH_IMAGES is now automatically set in configuration file.
+
+6.0.015 (2013-05-14)
+ - Some unused vars were removed from AddFont() method.
+ - Some directories were moved inside the examples directory.
+ - All examples were updated to reflect the new default structure.
+ - Source code were clean-up up to be more compatible with system packaging.
+ - Files encodings and permissions were reset.
+ - The command line tool tcpdf_addfont.php was added on the tools directory.
+
+6.0.014 (2013-04-13)
+ - The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
+
+6.0.013 (2013-04-10)
+ - Add support for SVG dx and dy text/tspan attributes.
+ - replace require() with require_once().
+ - fix some minor typos on documentation.
+ - fix a problem when deleting all pages.
+
+6.0.012 (2013-04-24)
+ - An error condition in addHtmlLink() method was fixed (bug #799).
+
+6.0.011 (2013-04-22)
+ - Minor documentation changes.
+
+6.0.010 (2013-04-03)
+ - The method Rect() was fixed to print borders correctly.
+
+6.0.009 (2013-04-02)
+ - Adding back some files that were not properly committed on the latest release.
+
+6.0.008 (2013-04-01)
+ - Duplicated encoding maps was removed from tcpdf_font_data.php.
+ - Fixing bug on AddTTFFont().
+
+6.0.007 (2013-03-29)
+ - HTML/CSS font size conversion were improved.
+
+6.0.006 (2013-03-27)
+ - Bug related to SVG and EPS files on xobjects were fixed.
+
+6.0.005 (2013-03-26)
+ - Default font path was fixed.
+
+6.0.004 (2013-03-21)
+ - Return value of addTTFfont() method was fixed.
+
+6.0.003 (2013-03-20)
+ - A bug related to non-unicode mode was fixed.
+
+6.0.002 (2013-03-18)
+ - _getFIXED call on tcpdf_fonts.php was fixed.
+
+6.0.001 (2013-03-18)
+ - Fixed $uni_type call on tcpdf.php.
+
+6.0.000 (2013-03-17)
+ - IMPORTANT: PHP4 support has been removed starting from this version.
+ - Several TCPDF methods and vars were moved to new class files: tcpdf_static.php, tcpdf_colors.php, tcpdf_images.php, tcpdf_font_data.php, tcpdf_fonts.php.
+ - Files htmlcolors.php, spotcolors.php, unicode_data.php and ecodings_maps.php were removed.
+ - Barcode classes were renamed and new barcode examples were added.
+ - Thai language rendering was fixed and improved.
+ - Method isCharDefined() was improved.
+ - Protected method replaceChar() was added.
+ - Font "kerning" word was corrected to "tracking".
+
+5.9.166 (2012-06-21)
+ - Array to string conversion on file_id creation was fixed.
+ - Thai language rendering was fixed (thanks to Atsawin Chaowanakritsanakul).
+
+5.9.165 (2012-06-07)
+ - Some HTML form related bugs were fixed.
+
+5.9.164 (2012-06-06)
+ - A bug introduced on the latest release was fixed.
+
+5.9.163 (2012-06-05)
+ - Method getGDgamma() was changed.
+ - Rendering performances of PNG images with alpha channel were improved.
+
+5.9.162 (2012-05-11)
+ - A bug related to long text on TD cells was fixed.
+
+5.9.161 (2012-05-09)
+ - A bug on XREF table was fixed (Bug ID: 3525051).
+ - Deprecated Imagick:clone was replaced.
+ - Method objclone() was fixed for PHP4.
+
+5.9.160 (2012-05-03)
+ - A bug on tcpdf_parser.php was fixed.
+
+5.9.159 (2012-04-30)
+ - Barcode classes were updated to fix PNG export Bug (ID: 3522291).
+
+5.9.158 (2012-04-22)
+ - Some SVG-related bugs were fixed.
+
+5.9.157 (2012-04-16)
+ - Some SVG-related bugs were fixed.
+
+5.9.156 (2012-04-10)
+ - Bug item #3515885 "TOC and booklet: left and right page exchanged".
+ - SetAutoPageBreak(false) now works also in multicolumn mode.
+
+5.9.155 (2012-04-02)
+ - Bug item #3512596 "font import problems" was fixed.
+ - Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).
+ - All fonts were updated.
+ - Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed.
+ - Bug item #3513749 "TCPDF Superscript/Subscript" was fixed.
+
+5.9.154 (2012-03-29)
+ - A debug echo was removed.
+
+5.9.153 (2012-03-28)
+ - A bug on font conversion was fixed.
+ - All fonts were updated.
+ - Method isCharDefined() was added to find if a character is defined on the selected font.
+ - Method replaceMissingChars() was added to automatically replace missing chars on selected font.
+ - SetFont() method was fixed.
+
+5.9.152 (2012-03-23)
+ - The following overprint methods were added: setOverprint(), getOverprint().
+ - Signature of setAlpha() method was changed and method getAlpha() was added.
+ - stroke-opacity support was added on SVG.
+ - The following date methods were added: setDocCreationTimestamp(), setDocModificationTimestamp(), getDocCreationTimestamp(), getDocModificationTimestamp(), getFormattedDate(), getTimestamp().
+ - Signature of _datestring() method was changed.
+ - Method getFontBBox() was added.
+ - Method setPageBoxTypes() was aded.
+
+5.9.151 (2012-03-22)
+ - Bug item #3509889 "Transform() distorts PDF" was fixed.
+ - Precision of real number were extended.
+ - ComboBox and ListBox methods were fixed.
+ - Bulgarian language file was added.
+ - addTOC() method was improved to include bookmark color and font style.
+
+5.9.150 (2012-03-16)
+ - A bug related to form fields in PDF/A mode was fixed.
+
+5.9.149 (2012-02-21)
+ - Bug item #3489933 "SVG Parser treats tspan like text" was fixed.
+
+5.9.148 (2012-02-17)
+ - Bug item #3488600 "Multiple radiobutton sets get first set value" was fixed.
+
+5.9.147 (2012-02-14)
+ - A problem with SVG gradients has been fixed.
+
+5.9.146 (2012-02-12)
+ - Bug item #3486880 "$filehash undefine error" was fixed.
+ - The default font is now the one specified at PDF_FONT_NAME_MAIN constant.
+
+5.9.145 (2012-01-28)
+ - Japanese language file was added.
+ - TCPDF license and README.TXT files were updated.
+
+5.9.144 (2012-01-12)
+ - HTML output on barcode classes was improved.
+
+5.9.143 (2012-01-08)
+ - Bug item #3471057 "setCreator() has no effect" was fixed.
+
+5.9.142 (2011-12-23)
+ - Source code documentation was updated.
+
+5.9.141 (2011-12-14)
+ - Some minor bugs were fixed.
+
+5.9.140 (2011-12-13)
+ - SVG now supports embedded images encoded as base64.
+
+5.9.139 (2011-12-11)
+ - Spot color methods were fixed.
+
+5.9.138 (2011-12-10)
+ - cropMark() method was improved (check source code documentation).
+ - Example n. 56 was updated.
+ - Bug item #3452390 "Check Box still not ticked when set to true" was fixed.
+
+5.9.137 (2011-12-01)
+ - Bug item #3447005 "Background color and border of Form Elements is printed" was fixed.
+ - Color support for Form elements was improved.
+
+5.9.136 (2011-11-27)
+ - Bug item #3443387 "SetMargins with keep option does not work for top margin" was fixed.
+
+5.9.135 (2011-11-04)
+ - Bug item #3433406 "Double keywords in description" was fixed.
+
+5.9.134 (2011-10-29)
+ - The default value for $defcol parameter on convertHTMLColorToDec() method was fixed.
+ - Deafult HTTP headers were changed to avoid browser caching.
+ - Some deprecated syntax were replaced.
+
+5.9.133 (2011-10-26)
+ - Bug item #3428446 "copyPage method not working when diskcache enabled" was fixed.
+
+5.9.132 (2011-10-20)
+ - Bug item #3426167 "bug in function convertHTMLColorToDec()" was fixed.
+
+5.9.131 (2011-10-13)
+ - An error message was added to ImagePngAlpha() method.
+
+5.9.130 (2011-10-12)
+ - Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata);
+
+5.9.129 (2011-10-07)
+ - Core fonts metrics was fixed (replace all helvetica and times php files on fonts folder).
+ - Form fields support was improved and some problems were fixed (check the example n. 14).
+ - Bug item #3420249 "Issue with booklet and MultiCell" was fixed.
+
+5.9.128 (2011-10-06)
+ - Method addTTFfont() was improved (check the source code documentation).
+ - Method setExtraXMP() to set custom XMP data was added.
+
+5.9.127 (2011-10-04)
+ - Readonly mode option was activated for radiobuttons.
+
+5.9.126 (2011-10-03)
+ - Bug item #3417989 "Graphics State operator in form XObject fails to render" was fixed.
+ - Xobjects problems with transparency, gradients and spot colors were fixed.
+
+5.9.125 (2011-10-03)
+ - Support for 8-digit CMYK hexadecimal color representation was added (to be used with XHTML and SVG).
+ - Spot colors support was improved (check example n. 37).
+ - Color methods were improved.
+
+5.9.124 (2011-10-02)
+ - Core fonts were updated.
+
+5.9.123 (2011-10-02)
+ - The method addTTFfont() wad added to automatically convert TTF fonts (check the new fonts guide at http://www.tcpdf.org).
+ - Old font utils were removed.
+ - All fonts were updated and new arabic fonts were added (almohanad were removed and replaced by aefurat and aealarabiya).
+ - The file unicode_data.php was updated.
+ - The file encodings_maps.php was added.
+ - PDF/A files are now compressed to save space.
+ - XHTML input form fields now support text-alignment attribute.
+
+5.9.122 (2011-09-29)
+ - PDF/A-1b compliance was improved to pass some online testing.
+
+5.9.121 (2011-09-28)
+ - This version includes support for PDF/A-1b format (the class constructor signature was changed - see example n. 65).
+ - Method setSRGBmode() was added to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document (file sRGB.icc was added).
+ - 14 new fonts were added to allow embedding core fonts (for PDF/A compliance).
+ - Font utils were fixed.
+
+5.9.120 (2011-09-22)
+ - This version includes a fix for _getTrueTypeFontSubset() method.
+
+5.9.119 (2011-09-19)
+ - This version includes a fix for extra page numbering on TOC.
+
+5.9.118 (2011-09-17)
+ - This version includes some changes that allows you to add a bookmark for a page that do not exist.
+
+5.9.117 (2011-09-15)
+ - TCPDFBarcode and TCPDF2DBarcode classes were extended to include a method for exporting barcodes as PNG images.
+
+5.9.116 (2011-09-14)
+ - Datamatrix class was improved and documentation was fixed.
+
+5.9.115 (2011-09-13)
+ - Datamatrix ECC200 barcode support was added (a new datamatrix.php file was added) - check example n. 50.
+ - getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode.
+ - cURL options on Image() method were improved.
+ - A bug on write2DBarcode() was fixed.
+
+5.9.114 (2011-09-04)
+ - A bug related to column position was fixed.
+
+5.9.113 (2011-08-24)
+ - This release include two new experimental files for parsing an existing PDF document (the integration with TCPDF is under development).
+
+5.9.112 (2011-08-18)
+ - A newline character was added after the 'trailer' keyword for compatibility with some parsers.
+ - Support for layers was improved.
+
+5.9.111 (2011-08-17)
+ - Barcode CODE 39 default gap was restored at 1.
+
+5.9.110 (2011-08-17)
+ - Barcode CODE 39 was fixed.
+
+5.9.109 (2011-08-12)
+ - Method getNumLines() was fixed.
+ - A bug related to page break in multi-column mode was fixed.
+
+5.9.108 (2011-08-09)
+ - A bug on PHP4 version was fixed.
+
+5.9.107 (2011-08-08)
+ - This version includes a minor bugfix.
+
+5.9.106 (2011-08-04)
+ - This version includes transparency groups: check the new parameter on startTemplate() method and example 62.
+
+5.9.105 (2011-08-04)
+ - Bug item #3386153 "Check Box not ticked when set to true" was fixed.
+
+5.9.104 (2011-08-01)
+ - Bug item #3383698 "imagemagick, resize and dpi" was fixed.
+
+5.9.103 (2011-07-16)
+ - Alignment of XHTML lines was improved.
+ - Spell of the "length" word was fixed.
+
+5.9.102 (2011-07-13)
+ - Methods startLayer() and endLayer() were added to support arbitrary PDF layers.
+ - Some improvements/fixes for images were added (thanks to Brendan Abbott).
+
+5.9.101 (2011-07-07)
+ - Support for JPEG and PNG ICC Color Profiles was added.
+ - Method addEmptySignatureAppearance() was added to add empty signature fields (see example n. 52).
+ - Bug item #3354332 "Strange line spacing with reduced font-size in writeHTML" was fixed.
+
+5.9.100 (2011-06-29)
+ - An SVG bug has been fixed.
+
+5.9.099 (2011-06-27)
+ - Bug item #3335045 "Font freesans seems somehow corrupted in footer" was fixed.
+
+5.9.098 (2011-06-23)
+ - The Named Destination feature was fixed.
+
+5.9.097 (2011-06-23)
+ - The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd.
+ - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant.
+
+5.9.096 (2011-06-19)
+ - Bug item #3322234 "Surrogate pairs codes in arrUTF8ToUTF16BE" was fixed.
+
+5.9.095 (2011-06-18)
+ - Numbers alignment for Table-Of-Content methods was improved and fixed.
+ - Font subsetting was fixed to include all parts of composite fonts.
+
+5.9.094 (2011-06-17)
+ - Bug item #3317898 "Page Group numbering broken in 5.9.093" was fixed.
+
+5.9.093 (2011-06-16)
+ - Method setStartingPageNumber() was added to set starting page number (for automatic page numbering).
+
+5.9.092 (2011-06-15)
+ - Method _putpages() was improved.
+ - Bug item #3316678 "Memory overflow when use Rotate and SetAutoPageBreak" was fixed.
+ - Right alignment of page numbers was improved.
+
+5.9.090 (2011-06-14)
+ - Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility.
+
+5.9.089 (2011-06-13)
+ - Example n. 8 was updated.
+ - Method sendOutputData() was changed to remove default compression (it was incompatible with some server settings).
+ - Bugs related to page group numbers were fixed.
+ - Method copyPage() was fixed.
+ - Method Image() was improved to include support for alternative and external images.
+
+5.9.088 (2011-06-01)
+ - Method getAutoPageBreak() was added (see example n. 51).
+ - Example n. 51 (full page background) was updated.
+
+5.9.087 (2011-06-01)
+ - Method sendOutputData() was improved to include deflate encoding.
+ - Barcode classes on PHP 4 version were fixed.
+
+5.9.086 (2011-05-31)
+ - Font files were updated (the ones on the previous release were broken).
+ - The script fonts/utils/makeallttffonts.php was updated and fixed.
+ - Output() method was improved to use compression when available.
+
+5.9.085 (2011-05-31)
+ - TCPDFBarcode class (barcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
+ - TCPDF2DBarcode class (2dbarcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
+
+5.9.084 (2011-05-29)
+ - Font files were updated.
+ - The file fonts/utils/makeallttffonts.php was updated.
+ - Bug item# 3308774 "Problems with font subsetting" was fixed.
+ - ImageSVG() and fitBlock() methods were improved to handle some SVG problems.
+ - Some problems with PHP4 compatibility were fixed.
+
+5.9.014 (2010-11-15)
+ - Bug item #3109464 "QRCode error" was fixed.
+
+5.9.013 (2010-11-15)
+ - Bug item #3109257 "Problem with interlaced GIFs and PNGs" was fixed.
+ - Image function now accepts image data streams (check example n. 9).
+
+5.9.012 (2010-11-12)
+ - Method getTCPDFVersion() was added.
+ - PDF_PRODUCER constant was removed.
+ - Method convertHTMLColorToDec() was improved.
+ - HTML colors now support spot color names defined on the new spotcolors.php file.
+ - The default method Header() was improved to support SVG and EPS/AI images.
+ - A bug on SVG importer was fixed.
+
+5.9.011 (2010-11-02)
+ - Bug item #3101486 "Bug Fix for image loading" was fixed.
+
+5.9.010 (2010-10-27)
+ - Support for CSS properties 'border-spacing' and 'padding' for tables were added.
+ - Several language files were added.
+
+5.9.009 (2010-10-21)
+ - HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction.
+
+5.9.008 (2010-10-21)
+ - Bug item #3091502 "Bookmark oddity" was fixed.
+ - HTML internal links now accepts page number and Y position.
+ - The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27).
+
+5.9.007 (2010-10-20)
+ - Method adjustCellPadding() was fixed to handle bad input.
+
+5.9.006 (2010-10-19)
+ - Support for AES 256 bit encryption was added (see example n. 16).
+ - Method getNumLines() was fixed for the empty string case.
+
+5.9.005 (2010-10-18)
+ - Method addPageRegion() was changed to accept regions starting exactly from the top of the page.
+
+5.9.004 (2010-10-18)
+ - A bug related to annotations was fixed.
+ - The file unicode_data.php was canged to encapsulate all data in a class.
+ - The file htmlcolors.php was changed to remove the global variable.
+
+5.9.003 (2010-10-15)
+ - Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion().
+ - A bug on Right-To-Left alignment was fixed.
+
+5.9.002 (2010-10-08)
+ - Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4).
+
+5.9.001 (2010-10-07)
+ - The problem of blank page for nobr table higher than a single page was fixed.
+
+5.9.000 (2010-10-06)
+ - Support for text stretching and spacing (tracking) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
+ - Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63).
+ - The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods.
+ - Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5).
+ - Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5).
+ - Method write1DBarcode() was improved to permit custom labels (see example n. 27).
+ - Method ImagePngAlpha() now includes support for ImageMagick to improve performances.
+ - XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods.
+ - The signature of getNumLines() and getStringHeight() methods is changed.
+ - A bug related to SetFont on XObject templates was fixed.
+
+5.8.033 (2010-09-25)
+ - A problem with Footer() and multiple columns was fixed.
+
+5.8.032 (2010-09-22)
+ - Bug #3073165 "Issues with changes to addHTMLVertSpace()" was fixed.
+
+5.8.031 (2010-09-20)
+ - Bug #3071961 "Spaces in HTML" was fixed.
+
+5.8.030 (2010-09-17)
+ - SVG support was improved and some bugs were fixed.
+
+5.8.029 (2010-09-16)
+ - A problem with HTML borders was fixed.
+
+5.8.028 (2010-09-13)
+ - Bug #3065224 "mcrypt_create_iv error on TCPDF 5.8.027 on PHP 5.3.2" was fixed.
+
+5.8.027 (2010-09-13)
+ - Bug #3065118 "mcrypt_decrypt error on TCPDF 5.8.026 on PHP 5.3.2" was fixed.
+
+5.8.026 (2010-09-13)
+ - A bug on addHTMLTOC() method was fixed. Note: be sure that the #TOC_PAGE_NUMBER# template has enough width to be printed correctly.
+
+5.8.025 (2010-09-09)
+ - Bug #3062692 "Textarea inside a table" was fixed.
+
+5.8.024 (2010-09-08)
+ - Bug #3062005 "Undefined variable: ann_obj_id" was fixed.
+
+5.8.023 (2010-08-31)
+ - Forms bug added on version 5.8.019 was fixed.
+
+5.8.022 (2010-08-31)
+ - Bug #3056632 "SVG rendered vertically flipped" was fixed.
+
+5.8.021 (2010-08-30)
+ - A new CID-0 'chinese' font was added for traditional Chinese.
+ - Bug #3054287 'Inner tags are ignored due to "align" attribute' was fixed.
+
+5.8.020 (2010-08-26)
+ - CSS "catch-all" class selector is now supported.
+
+5.8.019 (2010-08-26)
+ - XObject Templates now includes support for links and annotations.
+ - A problem related to link alignment on cell was fixed.
+ - A problem related to SVG styles was fixed.
+
+5.8.018 (2010-08-25)
+ - Method getNumberOfColumns() was added.
+ - A problem related to table header was fixed.
+ - Method getSVGTransformMatrix() was fixed to apply SVG transformations in the correct order.
+ - SVG support was improved and several bugs were fixed.
+
+5.8.017 (2010-08-25)
+ - This version includes support for XObject Templates (see the new example n. 62).
+ - Methods starttemplate(), endTemplate() and printTemplate() were added (see the new example n. 62).
+
+5.8.016 (2010-08-24)
+ - Alignment problem on write2DBarcode was fixed.
+
+5.8.015 (2010-08-24)
+ - A problem arised with the latest bugfix was fixed.
+
+5.8.014 (2010-08-23)
+ - Method _getxobjectdict() was added for better compatibility with external extensions.
+ - A bug related to radiobuttons was fixed.
+ - Bug #3051509 "new line after punctuation marks" was fixed (partially).
+
+5.8.013 (2010-08-23)
+ - SVG support for 'direction' property was added.
+ - A problem on default width calculation for linear barcodes was fixed.
+ - New option was added to write1DBarcode() method to improve alignments (see example n. 27).
+ - Bug #3050896 "Nested HTML tables: styles are not applied" was fixed.
+ - Method _putresourcedict() was improved to include external XObject templates.
+
+5.8.012 (2010-08-22)
+ - Support for SVG 'text-anchor' property was added.
+
+5.8.011 (2010-08-21)
+ - Method write1DBarcode() was improved to be backward compatible (check the new example n. 27).
+ - Support for CSS width and height properties on images were added.
+
+5.8.010 (2010-08-20)
+ - Documentation of unhtmlentities() was fixed.
+ - The 'fitwidth' option was added and border color problem was fixed on write1DBarcode() method (check the example n. 27).
+
+5.8.009 (2010-08-20)
+ - Internal object numbering was improved.
+ - Some errors in object encryption were fixed.
+
+5.8.008 (2010-08-19)
+ - Method write1DBarcode() was changed, check the example n. 27.
+ - Method Footer() was changed to account for barcode changes.
+ - Automatic calculation of K_PATH_URL constant was fixed on configuration file.
+ - Method setEqualColumns() was fixed for $width=0 case.
+ - Method AddTOC() was fixed for multipage and multicolumn modes.
+ - Better support for SVG "font-family" property.
+ - A problem on default Page Zoom mode was fixed.
+ - Several Annotation bugs were fixed.
+
+5.8.007 (2010-08-18)
+ - A bug affecting HTML tables was fixed.
+ - Bug #3047500 "SVG not rendering paths properly" was fixed.
+
+5.8.006 (2010-08-17)
+ - A bug affecting HTML table nesting was fixed.
+
+5.8.005 (2010-08-17)
+ - A bug affecting the HTML 'select' tag in certain conditions was fixed.
+
+5.8.004 (2010-08-17)
+ - Better support for HTML "font-family" property.
+ - A bug related to HTML multicolumn was fixed.
+
+5.8.003 (2010-08-16)
+ - Better support for HTML "font-family" property.
+
+5.8.002 (2010-08-14)
+ - HTML alignments were improved
+ - IMPORTANT: Default regular expression to find spaces has been changed to exclude the non-breaking-space (160 DEC- A0 HEX). If you are using setSpacesRE() method, please read the new documentation.
+ - Example n. 1 was updated.
+
+5.8.001 (2010-08-12)
+ - Bug #3043650 "subsetchars incorrectly cached" was fixed.
+
+5.8.000 (2010-08-11)
+ - A control to avoid bookmarking page 0 was added.
+ - addTOC() method now includes support for multicolumn mode.
+ - Support for tables in multicolumn mode was improved.
+ - Example n.10 was updated.
+ - All trimming functions were replaced with stringLeftTrim(), stringRightTrim() and stringTrim().
+ - Bug #3016920 "Font subsetting issues when editing pdf" was partially fixed (Note that flattening transparency layers is currently incompatible with TrueTypeUnicode fonts).
+
+5.4.002 (2010-06-18)
+ - A problem related with setProtection() method was fixed.
+
+5.4.001 (2010-06-18)
+ - A problem related with setProtection() method was fixed.
+
+5.4.000 (2010-06-18)
+ - The method setSignatureAppearance() was added, check the example n. 52.
+ - Several problems related to font subsetting were fixed.
+ - IMPORTANT: Support for font subsetting was added by default to reduce the size of documents using large unicode font files.
+ If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font.
+ If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF.
+ - The signature of the SetFont() and AddFont() methods were changed to include the font subsetting option (subsetting is applied by default).
+ - A problem on color and style of HTML links was fixed.
+ - A bug relative to gradients was fixed.
+ - The getStringHeight() method was added and getNumLines() method was improved.
+ - All examples were updated.
+
+5.0.013 (2010-05-19)
+ - A bug related to page-breaks and table cells was fixed.
+
+5.0.012 (2010-05-19)
+ - Page orientation bug was fixed.
+ - The access to method setPageFormat() was changed to 'protected' because it is not intended to be directly called.
+
+5.0.011 (2010-05-19)
+ - Page orientation bug was fixed.
+ - Bug #3003966 "Multiple columns and nested lists" was fixed.
+
+5.0.010 (2010-05-17)
+ - The methods setPageFormat(), setPageOrientation() and related methods were extended to include page boxes, page rotations and page transitions.
+ - The method setPageBoxes() was added to set page boundaries (MediaBox, CropBox, BleedBox, TrimBox, ArtBox);
+ - A bug relative to underline, overline and linethrough was fixed.
+
+5.0.009 (2010-05-16)
+ - Bug #3002381 "Multiple columns and nested lists" was fixed.
+
+5.0.008 (2010-05-15)
+ - Bug "Columns WriteHTML and Justification" was fixed.
+
+5.0.007 (2010-05-14)
+ - Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed.
+ - Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed.
+
+5.0.006 (2010-05-13)
+ - Length of hr tag was fixed.
+ - An error on 2d barcode method was fixed.
+
+5.0.005 (2010-05-12)
+ - WARNING: The logic of permissions on the SetProtection() method has been inverted and extended (see example 16). Now you have to specify the features you want to block.
+ - SetProtection() method was extended to support RSA and AES 128 encryption and public-keys (see example 16).
+ - Bug #2999489 "setEqualColumns() and TOC uses wrong columns" was fixed (see the example 10).
+
+5.0.004 (2010-05-10)
+ - HTML line alignment when using sub and sup tags was fixed.
+
+5.0.003 (2010-05-07)
+ - Horizontal alignment was fixed for images and barcodes. Now the X coordinate is always relative to the left margin. Use GetAbsX() instead of GetX() to get the X relative to left margin.
+ - Header() method was changed to account for new image alignment rules.
+
+5.0.002 (2010-05-06)
+ - Bookmark() and related methods were fixed to accept HTML code.
+ - A problem on HTML links was fixed.
+
+5.0.001 (2010-05-06)
+ - Protected method _putstream was re-added for backward compatibility.
+ - The following method were added to display HTML Table Of Content (see example n. 59):
+ addTOCPage(), endTOCPage(), addHTMLTOC().
+
+5.0.000 (2010-05-05)
+ - Method ImageSVG() was added to embedd SVG images (see example n. 58). Note that not all SVG images are supported.
+ - Method setRasterizeVectorImages() was added to enable/disable rasterization for vector images via ImageMagick library.
+ - Method RoundedRectXY() was added.
+ - Method PieSectorXY() was added.
+ - Gradient() method is now public and support new features.
+ - Shading to transparency is now supported.
+ - Image alignments were fixed.
+ - Support for dynamic images were improved.
+ - PDF_IMAGE_SCALE_RATIO has been changed to 1.25 for better compatibility with SVG.
+ - RAW and RAW2 modes were added to 2D Barcodes (see example n. 50).
+ - Automatic padding feature was added on barcodes (see examples n. 27 and 50).
+ - Bug #2995003 "Reproduced thead bug" was fixed.
+ - The Output() method now accepts FI and FD destinations to save the document on server before sending it to the client.
+ - Ellipse() method was improved and fixed (see page 2 of example n. 12).
+ - Bug item #2990356 "Current font size not respected with more than two HTML <p>" was fixed.
+
+4.9.017 (2010-04-21)
+ - Bug item #2990224 "Different behaviour for equivalent HTML strings" was fixed.
+ - Bug item #2990314 "Dash is not appearing with SHY character" was fixed.
+
+4.9.016 (2010-04-20)
+ - An error on htmlcolors.php was fixed.
+ - getImageFileType() method was improved.
+ - GIF images with transparency are now better supported.
+ - Automatic page orientation was improved.
+
+4.9.015 (2010-04-20)
+ - A new method copyPage() was added to clone pages (see example n. 44).
+ - Support for text overline was added.
+ - Underline and linethrough methods were fixed.
+ - Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed.
+
+4.9.014 (2010-04-18)
+ - Bug item #2988845 was fixed.
+
+4.9.013 (2010-04-15)
+ - Image() and ImageEPS() methods were fixed and improved; $fitonpage parameter was added.
+
+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).
+
+4.9.010 (2010-04-06)
+ - 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.
+
+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.
+
+4.9.007 (2010-04-03)
+ - 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.
+
+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.
+
+4.9.004 (2010-03-31)
+ - Patch #979681 "GetCharWidth - default character width" was applied (bugfix).
+
+4.9.003 (2010-03-30)
+ - Problem of first <br /> 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.
+
+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).
+
+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.
+ - The handling of temporary RTL text direction mode was fixed.
+
+4.8.013 (2009-10-26)
+ - Bug item #2884729 "Problem with word-wrap and hyphen" was fixed.
+
+4.8.012 (2009-10-23)
+ - Table cell alignments for RTL booklet mode were fixed.
+ - Images and barcode alignments for booklet mode were fixed.
+
+4.8.011 (2009-10-22)
+ - DejaVu fonts were updated to latest version.
+
+4.8.010 (2009-10-21)
+ - Bookmark for TOC page was added.
+ - Signature of addTOC() method is changed.
+ - Bookmarks are now automatically sorted by page and Y position.
+ - Example n. 45 was updated.
+ - Example n. 55 was added to display all charactes available on core fonts.
+
+4.8.009 (2009-09-30)
+ - Compatibility with PHP 5.3 was improved.
+ - All examples were updated.
+ - Index file for examples was added.
+
+4.8.008 (2009-09-29)
+ - Example 49 was updated.
+ - Underline and linethrough now works with cell stretching mode.
+
+4.8.007 (2009-09-23)
+ - Infinite loop problem caused by nobr attribute was fixed.
+
+4.8.006 (2009-09-23)
+ - Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed.
+ - Support for text-indent CSS attribute was added.
+ - Method rollbackTransaction() was changed to support self-reassigment of previous object (check source code documentation).
+ - Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: <tr nobr="true">...</tr>).
+
+4.8.005 (2009-09-17)
+ - A bug relative to multiple transformations and annotations was fixed.
+
+4.8.004 (2009-09-16)
+ - A bug on _putannotsrefs() method was fixed.
+
+4.8.003 (2009-09-15)
+ - Bug item #2858754 "Division by zero" was fixed.
+ - A bug relative to HTML list items was fixed.
+ - A bug relative to form fields on multiple pages was fixed.
+ - PolyLine() method was added (see example n. 12).
+ - Signature of Polygon() method was changed.
+
+4.8.002 (2009-09-12)
+ - A problem related to CID-0 fonts offset was fixed: if the $cw[1] entry on the CID-0 font file is not defined, then a CID keys offset is introduced.
+
+4.8.001 (2009-09-09)
+ - The appearance streams (AP) for anotations form fields was fixed (see examples n. 14 and 54).
+ - Radiobuttons were fixed.
+
+4.8.000 (2009-09-07)
+ - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54).
+ - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button().
+ - Support for Widget annotations was improved.
+ - Alignment of annotation objects was fixed (examples 36 and 41 were updated).
+ - Support for TCPDF methods on HTML was improved (see example n. 49).
+
+4.7.002 (2009-09-02)
+ - Bug item #2848892 "writeHTML + table: Gaps between rows" was fixed.
+ - JavaScript support was fixed (see example n. 53).
+
+4.7.001 (2009-08-30)
+ - The Polygon() and Arrow() methods were fixed and improved (see example n. 12).
+
+4.7.000 (2009-08-29)
+ - This is a major release.
+ - Some procedures were internally optimized.
+ - The problem of mixed signature and annotations was fixed (example n. 52).
+
+4.6.030 (2009-08-29)
+ - IMPORTANT: percentages on table cell widths are now relative to the full table width (as in standard HTML).
+ - Various minor bugs were fixed.
+ - Example n. 52 (digital signature) was updated.
+
+4.6.029 (2009-08-26)
+ - PHP4 version was fixed.
+
+4.6.028 (2009-08-25)
+ - Signature algorithm was finally fixed (see example n. 52).
+
+4.6.027 (2009-08-24)
+ - TCPDF now supports unembedded TrueTypeUnicode Fonts (just comment the $file entry on the fonts' php file.
+
+4.6.026 (2009-08-21)
+ - Bug #2841693 "Problem with MultiCell and ishtml and justification" was fixed.
+ - Signature functions were improved but not yet fixed (tcpdf.crt and example n. 52 were updated).
+
+4.6.025 (2009-08-17)
+ - Carriage returns (\r) were removed from source code.
+ - Problem related to set_magic_quotes_runtime() depracated was fixed.
+
+4.6.024 (2009-08-07)
+ - Bug item #2833556 "justification using other units than mm" was fixed.
+ - Documentation was fixed/updated.
+
+4.6.023 (2009-08-02)
+ - Bug item #2830537 "MirrorH can show mask for transparent PNGs" was fixed.
+
+4.6.022 (2009-07-24)
+ - A bug relative to single line printing when using WriteHTMLCell() was fixed.
+ - Signature support were improved but is still experimental.
+ - Fonts Free and Dejavu were updated to latest versions.
+
+4.6.021 (2009-07-20)
+ - Bug item #2824015 "XHTML Ampersand & in hyperlink bug" was fixed.
+ - Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed.
+ - Links alignment on justified text was fixed.
+ - Unicode "\u" modifier was added to re_spaces variable by default.
+
+4.6.020 (2009-07-16)
+ - Bug item #2821921 "issue in example 18" was fixed.
+ - Signature of SetRTL() method was changed.
+
+4.6.019 (2009-07-13)
+ - Bug item #2820703 "xref table broken" was fixed.
+
+4.6.018 (2009-07-10)
+ - Bug item #2819319 "Text over text" was fixed.
+ - Method Arrow() was added to print graphic arrows (example 12 was updated).
+
+4.6.017 (2009-07-05)
+ - Bug item #2816079 "Example 48 not working" was fixed.
+ - The signature of the checkPageBreak() was changed. The parameter $addpage was added to turn off the automatic page creation.
+
+4.6.016 (2009-06-16)
+ - Method setSpacesRE() was added to set the regular expression used for detecting withespaces or word separators. If you are using chinese, try: setSpacesRE('/[\s\p{Z}\p{Lo}]/');, otherwise you can use setSpacesRE('/[\s\p{Z}]/');
+ - The method _putinfo() now automatically fills the metadata with '?' in case of empty string.
+
+4.6.015 (2009-06-11)
+ - Bug #2804667 "word wrap bug" was fixed.
+
+4.6.014 (2009-06-04)
+ - Bug #2800931 "Table thead tag bug" was fixed.
+ - A bug related to <pre> tag was fixed.
+
+4.6.013 (2009-05-28)
+ - List bullets position was fixed for RTL languages.
+
+4.6.012 (2009-05-23)
+ - setUserRights() method doesn't work anymore unless you call the setSignature() method with the Adobe private key!
+
+4.6.011 (2009-05-18)
+ - Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation).
+
+4.6.010 (2009-05-17)
+ - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null.
+ - <tcpdf> tag indent problem was fixed.
+ - $y parameter was added to checkPageBreak() method.
+ - Bug n. 2791773 "writeHTML" was fixed.
+
+4.6.009 (2009-05-13)
+ - xref table for embedded files was fixed.
+
+4.6.008 (2009-05-07)
+ - setSignature() method was improved (but is still experimental).
+ - Example n. 52 was added.
+
+4.6.007 (2009-05-05)
+ - Bug #2786685 "writeHtmlCell and <br /> in custom footer" was fixed.
+ - Table header repeating bug was fixed.
+ - Some newlines and tabs are now automatically removed from HTML strings.
+
+4.6.006 (2009-04-28)
+ - Support for "<a name="...">...</a>" was added.
+ - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces).
+
+4.6.005 (2009-04-25)
+ - Points (pt) conversion in getHTMLUnitToUnits() was fixed.
+ - Default tcpdf.pem certificate file was added.
+ - Experimental support for signing document was added but it is not yet completed (some help is needed - I think that the calculation of the ByteRange is OK and the problem is on the signature calculation).
+
+4.6.004 (2009-04-23)
+ - Method deletePage() was added to delete pages (see example n. 44).
+
+4.6.003 (2009-04-21)
+ - The caching mechanism of the UTF8StringToArray() method was fixed.
+
+4.6.002 (2009-04-20)
+ - Documentation of rollbackTransaction() method was fixed.
+ - The setImageScale() and getImageScale() methods now set and get the adjusting parameter used by pixelsToUnits() method.
+ - HTML images now support other units of measure than pixels (getHTMLUnitToUnits() is now used instead of pixelsToUnits()).
+ - WARNING: PDF_IMAGE_SCALE_RATIO has been changed by default to 1.
+
+4.6.001 (2009-04-17)
+ - Spaces between HTML block tags are now automatically removed.
+ - The bug related to cMargin changes between tables was fixed.
+
+4.6.000 (2009-04-16)
+ - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods:
+ zero coordinates for $x and $y are now valid coordinates;
+ set $x and $y as empty strings to get the current value.
+ - Some error caused by 'empty' funtion were fixed.
+ - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false.
+ - HTML on footer bug was fixed.
+ - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43.
+
+4.5.043 (2009-04-15)
+ - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27):
+ - SetFont() method signature was changed to include the font filename.
+ - Some font-related methods were improved.
+ - Methods getFontFamily() and getFontStyle() were added.
+
+4.3.007 (2008-12-03)
+ - PNG alpha channel is now supported (GD library is required).
+ - AddFont() function now support custom font file path on $file parameter.
+ - The default width variable ($dw) is now always defined for any font.
+ - The 'Style' attribute on CID-0 fonts was removed because of protection bug.
+
+4.3.006 (2008-12-01)
+ - A regular expression on getHtmlDomArray() to find HTML tags was fixed.
+
+4.3.005 (2008-11-25)
+ - makefont.php was fixed.
+ - Bug item #2339877 was fixed (false loop condition detected on WriteHTML()).
+ - Bug item #2336733 was fixed (lasth value update on Multicell() when border and fill are disabled).
+ - Bug item #2342303 was fixed (automatic page-break on Image() and ImageEPS()).
+
+4.3.004 (2008-11-19)
+ - Function _textstring() was fixed (bug 2309051).
+ - All examples were updated.
+
+4.3.003 (2008-11-18)
+ - CID-0 font bug was fixed.
+ - Some functions were optimized.
+ - Function getGroupPageNoFormatted() was added.
+ - Example n. 23 was updated.
+
+4.3.002 (2008-11-17)
+ - Bug item #2305518 "CID-0 font don't work with encryption" was fixed.
+
+4.3.001 (2008-11-17)
+ - Bug item #2300007 "download mimetype pdf" was fixed.
+ - Double quotes were replaced by single quotes to improve PHP performances.
+ - A bug relative to HTML cell borders was fixed.
+
+4.3.000 (2008-11-14)
+ - The function setOpenCell() was added to set the top/bottom cell sides to be open or closed when the cell cross the page.
+ - A bug relative to list items indentation was fixed.
+ - A bug relative to borders on HTML tables and Multicell was fixed.
+ - A bug relative to rowspanned cells was fixed.
+ - A bug relative to html images across pages was fixed.
+
+4.2.009 (2008-11-13)
+ - Spaces between li tags are now automatically removed.
+
+4.2.008 (2008-11-12)
+ - A bug relative to fill color on next page was fixed.
+
+4.2.007 (2008-11-12)
+ - The function setListIndentWidth() was added to set custom indentation widht for HTML lists.
+
+4.2.006 (2008-11-06)
+ - A bug relative to HTML justification was fixed.
+
+4.2.005 (2008-11-06)
+ - A bug relative to HTML justification was fixed.
+ - The methods formatPageNumber() and PageNoFormatted() were added to format page numbers.
+ - Default Footer() method was changed to use PageNoFormatted() instead of PageNo().
+ - Example 6 was updated.
+
+4.2.004 (2008-11-04)
+ - Bug item n. 2217039 "filename handling improvement" was fixed.
+
+4.2.003 (2008-10-31)
+ - Font style bug was fixed.
+
+4.2.002 (2008-10-31)
+ - Bug item #2210922 (htm element br not work) was fixed.
+ - Write() function was improved to support margin changes.
+
+4.2.001 (2008-10-30)
+ - setHtmlVSpace($tagvs) function was added to set custom vertical spaces for HTML tags.
+ - writeHTML() function now support margin changes during execution.
+ - Signature of addHTMLVertSpace() function is changed.
+
+4.2.000 (2008-10-29)
+ - htmlcolors.php was changed to support class-loaders.
+ - ImageEps() function was improved in performances.
+ - Signature of Link() And Annotation() functions were changed.
+ - (Bug item #2198926) Links and Annotations alignment were fixed (support for geometric tranformations was added).
+ - rowspan mode for HTML table cells was improved and fixed.
+ - Booklet mode for double-sided pages was added; see SetBooklet() function and example n. 40.
+ - lastPage() signature is changed.
+ - Signature of Write() function is changed.
+ - Some HTML justification problems were fixed.
+ - Some functions were fixed to better support RTL mode.
+ - Example n. 10 was changed to support RTL mode.
+ - All examples were updated.
+
+4.1.004 (2008-10-23)
+ - unicode_data.php was changed to support class-loaders.
+ - Bug item #2186040/2 (writeHTML margin problem) was fixed.
+
+4.1.003 (2008-10-22)
+ - Bug item #2185399 was fixed (rowspan and page break).
+ - Bugs item #2186040 was fixed (writeHTML margin problem).
+ - Newline after table was removed.
+
+4.1.002 (2008-10-21)
+ - Bug item #2184525 was fixed (rowspan on HTML cell).
+
+4.1.001 (2008-10-21)
+ - Support for "start" attribute was added to HTML ordered list.
+ - unicode_data.php file was changed to include UTF-8 to ASCII table.
+ - Some functions were modified to better support UTF-8 extensions to core fonts.
+ - Support for images on HTML lists was improved.
+ - Examples n. 1 and 6 were updated.
+
+4.1.000 (2008-10-18)
+ - Page-break bug using HTML content was fixed.
+ - The "false" parameter was reintroduced to class_exists function on PHP5 version to avoid autoload.
+ - addHtmlLink() function was improved to support internal links (i.e.: <a href="#23">link to page 23</a>).
+ - Justification alignment is now supported on HTML (see example n. 39).
+ - example_006.php was updated.
+
+4.0.033 (2008-10-13)
+ - Bug n. 2157099 was fixed.
+ - SetX() and SetY() functions were improved.
+ - SetY() includes a new parameter to avoid the X reset.
+
+4.0.032 (2008-10-10)
+ - Bug n. 2156926 was fixed (bold, italic, underlined, linethrough).
+ - setStyle() method was removed.
+ - Configuration file was changed to use helvetica (non-unicode) font by default.
+ - The use of mixed font types was improved.
+ - All examples were updated.
+
+4.0.031 (2008-10-09)
+ - _putannots() and _putbookmarks() links alignments were fixed.
+
+4.0.030 (2008-10-07)
+ - _putbookmarks() function was fixed.
+ - _putannots() was fixed to include internal links.
+
+4.0.029 (2008-09-27)
+ - Infinite loop bug was fixed [Bug item #130309].
+ - Multicell() problem on Header() was fixed.
+
+4.0.028 (2008-09-26)
+ - setLIsymbol() was added to set the LI symbol used on UL lists.
+ - Missing $padding and $encryption_key variables declarations were added [Bug item #2129058].
+
+4.0.027 (2008-09-19)
+ - Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed.
+ - arailunicid0.php font was updated.
+ - The problem of javascript form fields duplication after saving was fixed.
+
+4.0.026 (2008-09-17)
+ - convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation.
+ - The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large
+ - Example n. 6 was updated.
+
+4.0.025 (2008-09-15)
+ - _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding.
+ - arialunicid0 font was added (see the new example n. 38).
+ - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php.
+
+4.0.024 (2008-09-12)
+ - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4.
+ - support for Spot Colors were added. Check the new example n. 37 and the following new functions:
+ AddSpotColor()
+ SetDrawSpotColor()
+ SetFillSpotColor()
+ SetTextSpotColor()
+ _putspotcolors()
+ - Bookmark() function was improved to fix wrong levels.
+ - $lasth changes after header/footer calls were fixed.
+
+4.0.023 (2008-09-05)
+ - Some HTML related problems were fixed.
+ - Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php).
+
+4.0.022 (2008-08-28)
+ - Line height on HTML was fixed.
+ - Image inside an HTML cell problem was fixed.
+ - A new "zarbold" persian font was added.
+
+4.0.021 (2008-08-24)
+ - HTTP headers were fixed on Output function().
+ - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents.
+ - Function Write() was fixed.
+ - The problem of additional vertical spaces on HTML was fixed.
+ - The problem of frame around HTML links was fixed.
+
+4.0.020 (2008-08-15)
+ - "[2052259] WriteHTML <u> & <b>" bug was fixed.
+
+4.0.019 (2008-08-13)
+ - "Rowspan on first cell" bug was fixed.
+
+4.0.018 (2008-08-08)
+ - Default cellpadding for HTML tables was fixed.
+ - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7).
+ - HTML links are now correclty shifted during line alignments.
+ - function getAliasNbPages() was added and Footer() was updated.
+ - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed.
+ - Vera font was removed, DejaVu font and Free fonts were updated.
+ - Image handling was improved.
+ - All examples were updated.
+
+3.1.000 (2008-06-11)
+ - setPDFVersion() was added to change the default PDF version (currently 1.7).
+ - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29).
+ - SetDisplayMode() signature was changed (new options were added).
+ - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30).
+ - PieSector() function was added to render render pie charts (see example 31).
+ - ImageEps() was added to display EPS and AI images with limited support (see example 32).
+ - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added.
+ - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions.
+ - HTML lists were improved and could be nested (you may now represent trees).
+ - AddFont() bug was fixed.
+ - _putfonts() bug was fixed.
+ - graphics functions were fixed.
+ - unicode_data.php file was updated (fixed).
+ - almohanad font was updated.
+ - example 18 was updated (Farsi and Arabic languages).
+ - source code cleanup.
+ - All examples were updated and new examples were added.
+
+3.0.015 (2008-06-06)
+ - AddPage() function signature is changed to include page format.
+ - example 28 was added to show page format changes.
+ - setPageUnit() function was added to change the page units of measure.
+ - setPageFormat() function was added to change the page format and orientation between pages.
+ - setPageOrientation() function was added to change the page orientation.
+ - Arabic font shaping was fixed for laa letter and square boxes (see the example 18).
+
+3.0.014 (2008-06-04)
+ - Arabic font shaping was fixed.
+ - setDefaultTableColumns() function was added.
+ - $cell_height_ratio variable was added.
+ - setCellHeightRatio() function was added to define the default height of cell repect font height.
+
+3.0.013 (2008-06-03)
+ - Multicell height parameter was fixed.
+ - Arabic font shaping was improved.
+ - unicode_data.php was updated.
+
+3.0.012 (2008-05-30)
+ - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file.
+ - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated).
+ - Arabic font shaping was improved.
+ - TranslateY() function was fixed (bug [1977962]).
+ - setVisibility() function was fixed.
+ - writeBarcode() function was fixed to scale using $xref parameter.
+ - All examples were updated.
+
+3.0.011 (2008-05-23)
+ - CMYK color support was added to all graphic functions.
+ - HTML table support was improved:
+ -- now it's possible to include additional html tags inside a cell;
+ -- colspan attribute was added.
+ - example 006 was updated.
+
+3.0.010 (2008-05-21)
+ - fixed $laa_array inclusion on utf8Bidi() function.
+
+3.0.009 (2008-05-20)
+ - unicode_data.php was updated.
+ - Arabic laa letter problem was fixed.
+
+3.0.008 (2008-05-12)
+ - Arabic support was fixed and improved (unicode_data.php was updated).
+ - Polycurve() function was added to draw a poly-Bezier curve.
+ - list items alignment was fixed.
+ - example 6 was updated.
+
+3.0.007 (2008-05-06)
+ - Arabic support was fixed and improved.
+ - AlMohanad (arabic) font was added.
+ - C128 barcode bugs were fixed.
+
+3.0.006 (2008-04-21)
+ - Condition to check negative width values was added.
+
+3.0.005 (2008-04-18)
+ - back-Slash character escape was fixed on writeHTML() function.
+ - Exampe 6 was updated.
+
+3.0.004 (2008-04-11)
+ - Bug [1939304] (Right to Left Issue) was fixed.
+
+3.0.003 (2008-04-07)
+ - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed.
+ - "face" attribute of "font" tag is now fully supported.
+
+3.0.002 (2008-04-01)
+ - Write() functions now return the number of cells and not the number of lines.
+ - TCPDF is released under LGPL 2.1, or any later version.
+
+3.0.001 (2008-05-28)
+ - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng().
+ - function writeBarcode() was fixed.
+ - all examples were updated.
+ - example 27 was added to show various barcodes.
+
+3.0.000 (2008-03-27)
+ - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug.
+ - Image-related functions were rewritten.
+ - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9).
+ - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM.
+ - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22).
+ - Page Groups were added (see example 23).
+ - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24).
+ - All private variables and functions were changed to protected.
+ - setAlpha() function was added to give transparency support for all objects (see example 25).
+ - Clipping and stroke modes were added to Text() function (see example 26).
+ - All examples were moved to "examples" directory.
+ - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9).
+
+2.9.000 (2008-03-26)
+ - htmlcolors.php file was added to include html colors.
+ - Support for HTML color names and three-digit hexadecimal color codes was added.
+ - private function convertColorHexToDec() was renamed convertHTMLColorToDec().
+ - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported).
+ - Write() function were fixed.
+ - example_006.php was updated.
+ - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14)
+
+2.8.000 (2008-03-20)
+ - Private variables were changed to protected.
+ - Function Write() was fixed and improved.
+ - Support for dl, dt, dd, del HTML tags was introduced.
+ - Line-trought mode was added for HTML and text.
+ - Text vertical alignment on cells were fixed.
+ - Examples were updated to reflect changes.
+
+2.7.002 (2008-03-13)
+ - Bug "[1912142] Encrypted PDF created/modified date" was fixed.
+
+2.7.001 (2008-03-10)
+ - Cell justification was fixed for non-unicode mode.
+
+2.7.000 (2008-03-09)
+ - Cell() stretching mode 4 (forced character spacing) was fixed.
+ - writeHTMLCell() now uses Multicell() to write.
+ - Multicell() has a new parameter $ishtml to act as writeHTMLCell().
+ - Write() speed was improved for non-arabic strings.
+ - Example n. 20 was changed.
+
+2.6.000 (2008-03-07)
+ - various alignments bugs were fixed.
+
+2.5.000 (2008-03-07)
+ - Several bugs were fixed.
+ - example_019.php was added to test non-unicode mode using old fonts.
+
+2.4.000 (2008-03-06)
+ - RTL support was deeply improved.
+ - GetStringWidth() was fixed to support RTL languages.
+ - Text() RTL alignment was fixed.
+ - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi().
+ - example_018.php was added and test_unicode.php was removed.
+
+2.3.000 (2008-03-05)
+ - MultiCell() signature is changed. Now support multiple columns across pages (see example_017).
+ - Write() signature is changed. Now support the cell mode to be used with MultiCell.
+ - Header() and Footer() were changed.
+ - The following functions were added: UTF8ArrSubString() and unichr().
+ - Examples were updated to reflect last changes.
+
+2.2.004 (2008-03-04)
+ - Several examples were added.
+ - AddPage() Header() and Footer() were fixed.
+ - Documentation is now available on http://www.tcpdf.org
+
+2.2.003 (2008-03-03)
+ - [1894853] Performance of MultiCell() was improved.
+ - RadioButton and ListBox functions were added.
+ - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf.
+
+2.2.002 (2008-02-28)
+ - [1900495] html images path was fixed.
+ - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library.
+
+2.2.001 (2008-02-16)
+ - The bug "[1894700] bug with replace relative path" was fixed
+ - Justification was fixed
+
+2.2.000 (2008-02-12)
+ - fixed javascript bug introduced with latest release
+
+2.1.002 (2008-02-12)
+ - Justify function was fixed on PHP4 version.
+ - Bookmank function was added ([1578250] Table of contents).
+ - Javascript and Form fields support was added ([1796359] Form fields).
+
+2.1.001 (2008-02-10)
+ - The bug "[1885776] Race Condition in function justitfy" was fixed.
+ - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed.
+
+2.1.000 (2008-01-07)
+ - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file
+ - Bidirectional Algorithm to correctly reverse bidirectional languages was added.
+ - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed.
+ - SetCellPadding function was added.
+ - writeHTML was updated with new parameters.
+ - Text function was fixed.
+ - MultiCell function was fixed, now works also across multiple pages.
+ - Line width was fixed on Header and Footer functions and <hr> tag.
+ - "GetImageSize" was renamed "getimagesize".
+ - Document version was changed from 1.3 to 1.5.
+ - _begindoc() function was fixed.
+ - ChangeDate was fixed and ModDate was added.
+ - The following functions were added:
+ setPage() : Move pointer to the specified document page.
+ getPage() : Get current document page number.
+ lastpage() : Reset pointer to the last document page.
+ getNumPages() : Get the total number of inserted pages.
+ GetNumChars() : count the number of (UTF-8) characters in a string.
+ - $stretch parameter was added to Cell() function to fit text on cell:
+ 0 = disabled
+ 1 = horizontal scaling only if necessary
+ 2 = forced horizontal scaling
+ 3 = character spacing only if necessary
+ 4 = forced character spacing
+ - Line function was fixed for RTL.
+ - Graphic transformation functions were added [1811158]:
+ StartTransform()
+ StopTransform()
+ ScaleX()
+ ScaleY()
+ ScaleXY()
+ Scale()
+ MirrorH()
+ MirrorV()
+ MirrorP()
+ MirrorL()
+ TranslateX()
+ TranslateY()
+ Translate()
+ Rotate()
+ SkewX()
+ SkewY()
+ Skew()
+ - Graphic function were added/updated [1688549]:
+ SetLineStyle()
+ _outPoint()
+ _outLine()
+ _outRect()
+ _outCurve()
+ Line()
+ Rect()
+ Curve
+ Ellipse
+ Circle
+ Polygon
+ RegularPolygon
+
+2.0.000 (2008-01-04)
+ - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files.
+ - setRTL($enable) method was added to manually enable/disable the RTL text direction.
+ - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left.
+ - RC4 40bit encryption was added. Check the SetProtection method.
+ - [1815213] Improved image support for GIF, JPEG, PNG formats.
+ - [1800094] Attribute "value" was added to ordered list items <li>.
+ - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be:
+ T: top-right for LTR or top-left for RTL
+ M: middle-right for LTR or middle-left for RTL
+ B: bottom-right for LTR or bottom-left for RTL
+ N: next line
+ - Attribute "align" was added to <img> html tag to set the above image "align" parameter. Possible values are:
+ top: top-right for LTR or top-left for RTL
+ middle: middle-right for LTR or middle-left for RTL
+ bottom: bottom-right for LTR or bottom-left for RTL
+ - [1798103] newline was added after </ul>, </ol> and </p> tages.
+ - [1816393] Documentation was updated.
+ - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages;
+ - The method lastPage() was added to move the pointer on the last page;
+ This library may include third party font files released with different licenses.
+
+ All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3),
+ they do not contain any binary data but just a description of the general properties of a particular font.
+ These files can be also generated on the fly using the font utilities and TCPDF methods.
+
+ All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files).
+
+ The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3).
+ The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license.
+ For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503
+ Link : http://www.gnu.org/software/freefont/
+
+ The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection.
+ For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33
+ Link : http://dejavu-fonts.org
+
+ The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2).
+ } elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) {
+ break;
+ }
+ ++$k;
+ }
+ return ENC_C40;
+ }
+ }
+ }
+ } // end of while
+ }
+
+ /**
+ * Get the switching codeword to a new encoding mode (latch codeword)
+ * @param $mode (int) New encoding mode.
+ * @return (int) Switch codeword.
+ * @protected
+ */
+ protected function getSwitchEncodingCodeword($mode) {
+ switch ($mode) {
+ case ENC_ASCII: { // ASCII character 0 to 127
+ $cw = 254;
+ if ($this->last_enc == ENC_EDF) {
+ $cw = 124;
+ }
+ break;
+ }
+ case ENC_C40: { // Upper-case alphanumeric
+ $cw = 230;
+ break;
+ }
+ case ENC_TXT: { // Lower-case alphanumeric
+ $cw = 239;
+ break;
+ }
+ case ENC_X12: { // ANSI X12
+ $cw = 238;
+ break;
+ }
+ case ENC_EDF: { // ASCII character 32 to 94
+ $cw = 240;
+ break;
+ }
+ case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page)
+ $cw = 231;
+ break;
+ }
+ }
+ return $cw;
+ }
+
+ /**
+ * Choose the minimum matrix size and return the max number of data codewords.
+ * @param $numcw (int) Number of current codewords.
+ * @return number of data codewords in matrix
+ * @protected
+ */
+ protected function getMaxDataCodewords($numcw) {
+ foreach ($this->symbattr as $key => $matrix) {
+ if ($matrix[11] >= $numcw) {
+ return $matrix[11];
+ }
+ }
+ return 0;
+ }
+
+ /**
+ * Get high level encoding using the minimum symbol data characters for ECC 200
+ * @param $data (string) data to encode
+ * @return array of codewords
+ * @protected
+ */
+ protected function getHighLevelEncoding($data) {
+ // STEP A. Start in ASCII encodation.
+ $enc = ENC_ASCII; // current encoding mode
+ $pos = 0; // current position
+ $cw = array(); // array of codewords to be returned
+ $cw_num = 0; // number of data codewords
+ $data_lenght = strlen($data); // number of chars
+ while ($pos < $data_lenght) {
+ // set last used encoding
+ $this->last_enc = $enc;
+ switch ($enc) {
+ case ENC_ASCII: { // STEP B. While in ASCII encodation
+ if (($data_lenght > 1) AND ($pos < ($data_lenght - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) {
+ // 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode.
+ $cw[] = (intval(substr($data, $pos, 2)) + 130);
+ ++$cw_num;
+ $pos += 2;
+ } else {
+ // 2. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
+ } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) {
+ $temp_cw[] = 2; // shift 3
+ $shiftset = $this->chset['S3C'];
+ } elseif (($enc == ENC_TXT) AND isset($this->chset['S3T'][$chr])) {
+ $temp_cw[] = 2; // shift 3
+ $shiftset = $this->chset['S3T'];
+ } else {
+ return false;
+ }
+ $temp_cw[] = $shiftset[$chr];
+ $p += 2;
+ }
+ if ($p >= 3) {
+ $c1 = array_shift($temp_cw);
+ $c2 = array_shift($temp_cw);
+ $c3 = array_shift($temp_cw);
+ $p -= 3;
+ $tmp = ((1600 * $c1) + (40 * $c2) + $c3 + 1);
+ $cw[] = ($tmp >> 8);
+ $cw[] = ($tmp % 256);
+ $cw_num += 2;
+ $pos = $epos;
+ // 1. If the C40 encoding is at the point of starting a new double symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
+ * Class to create QR-code arrays for TCPDF class.
+ * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
+ * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
+ * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
+ * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
+ *
+ * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
+ * Please read comments on this class source file for full copyright and license information.
+ *
+ * @package com.tecnick.tcpdf
+ * @author Nicola Asuni
+ * @version 1.0.010
+ */
+
+// definitions
+if (!defined('QRCODEDEFS')) {
+
+ /**
+ * Indicate that definitions for this class are set
+ // Encoding modes (characters which can be encoded in QRcode)
+
+ /**
+ * Encoding mode
+ */
+ define('QR_MODE_NL', -1);
+
+ /**
+ * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode.
+ */
+ define('QR_MODE_NM', 0);
+
+ /**
+ * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode.
+ */
+ define('QR_MODE_AN', 1);
+
+ /**
+ * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode.
+ */
+ define('QR_MODE_8B', 2);
+
+ /**
+ * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode.
+ * Convert a string to an array (needed for PHP4 compatibility)
+ * @param $string (string) The input string.
+ * @param $split_length (int) Maximum length of the chunk.
+ * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.
+ */
+ function str_split($string, $split_length=1) {
+ if ((strlen($string) > $split_length) OR (!$split_length)) {
+ * Class to create QR-code arrays for TCPDF class.
+ * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
+ * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
+ * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
+ * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
+ *
+ * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
+ * Please read comments on this class source file for full copyright and license information.
+ *
+ * @package com.tecnick.tcpdf
+ * @author Nicola Asuni
+ * @version 1.0.010
+ */
+class QRcode {
+
+ /**
+ * Barcode array to be returned which is readable by TCPDF.
+ * @protected
+ */
+ protected $barcode_array = array();
+
+ /**
+ * QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.
+ * @protected
+ */
+ protected $version = 0;
+
+ /**
+ * Levels of error correction. See definitions for possible values.
+ * @protected
+ */
+ protected $level = QR_ECLEVEL_L;
+
+ /**
+ * Encoding mode.
+ * @protected
+ */
+ protected $hint = QR_MODE_8B;
+
+ /**
+ * Boolean flag, if true the input string will be converted to uppercase.
+ * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them.
+ * See Table 1 in Appendix E (pp.71) of JIS X0510:2004.
+ * @param $code (string) code to represent using QRcode
+ * @param $eclevel (string) error level: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul>
+ * @public
+ * @since 1.0.000
+ */
+ public function __construct($code, $eclevel = 'L') {
+ $barcode_array = array();
+ if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
+ // the size of input data is greater than QR capacity, try to lover the error correction mode
+ return -1;
+ }
+
+ /**
+ * Return the size of length indicator for the mode and version.
+ * @param $mode (int) encoding mode
+ * @param $version (int) version
+ * @return int the size of the appropriate length indicator (bits).
+ */
+ protected function lengthIndicator($mode, $version) {
+ if ($mode == QR_MODE_ST) {
+ return 0;
+ }
+ if ($version <= 9) {
+ $l = 0;
+ } elseif ($version <= 26) {
+ $l = 1;
+ } else {
+ $l = 2;
+ }
+ return $this->lengthTableBits[$mode][$l];
+ }
+
+ /**
+ * Return the maximum length for the mode and version.
+ * @param $mode (int) encoding mode
+ * @param $version (int) version
+ * @return int the maximum length (bytes)
+ */
+ protected function maximumWords($mode, $version) {
+ if ($mode == QR_MODE_ST) {
+ return 3;
+ }
+ if ($version <= 9) {
+ $l = 0;
+ } else if ($version <= 26) {
+ $l = 1;
+ } else {
+ $l = 2;
+ }
+ $bits = $this->lengthTableBits[$mode][$l];
+ $words = (1 << $bits) - 1;
+ if ($mode == QR_MODE_KJ) {
+ $words *= 2; // the number of bytes is required
+ }
+ return $words;
+ }
+
+ /**
+ * Return an array of ECC specification.
+ * @param $version (int) version
+ * @param $level (int) error correction level
+ * @param $spec (array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
+ * @return array spec
+ */
+ protected function getEccSpec($version, $level, $spec) {
+ if (count($spec) < 5) {
+ $spec = array(0, 0, 0, 0, 0);
+ }
+ $b1 = $this->eccTable[$version][$level][0];
+ $b2 = $this->eccTable[$version][$level][1];
+ $data = $this->getDataLength($version, $level);
+ $ecc = $this->getECCLength($version, $level);
+ if ($b2 == 0) {
+ $spec[0] = $b1;
+ $spec[1] = (int)($data / $b1);
+ $spec[2] = (int)($ecc / $b1);
+ $spec[3] = 0;
+ $spec[4] = 0;
+ } else {
+ $spec[0] = $b1;
+ $spec[1] = (int)($data / ($b1 + $b2));
+ $spec[2] = (int)($ecc / ($b1 + $b2));
+ $spec[3] = $b2;
+ $spec[4] = $spec[1] + 1;
+ }
+ return $spec;
+ }
+
+ /**
+ * Put an alignment marker.
+ * @param $frame (array) frame
+ * @param $ox (int) X center coordinate of the pattern
+ * @param $oy (int) Y center coordinate of the pattern
+ * @return array frame
+ */
+ protected function putAlignmentMarker($frame, $ox, $oy) {
+ * @param $pad (int) padding bytes at front of shortened block
+ * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
+ */
+ protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
+ foreach ($this->rsitems as $rs) {
+ if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize)
+ OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) {
+ * @param $pad (int) padding bytes at front of shortened block
+ * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
+ */
+ protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
+ // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2)
+ $rs = null;
+ // Check parameter ranges
+ if (($symsize < 0) OR ($symsize > 8)) {
+ return $rs;
+ }
+ if (($fcr < 0) OR ($fcr >= (1<<$symsize))) {
+ return $rs;
+ }
+ if (($prim <= 0) OR ($prim >= (1<<$symsize))) {
+ return $rs;
+ }
+ if (($nroots < 0) OR ($nroots >= (1<<$symsize))) {
+ return $rs;
+ }
+ if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) {
+ * Color keys must be in lowercase and without spaces.
+ * As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly.
+ * Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH.
+ * @public static
+ */
+ public static $spotcolor = array (
+ // special registration colors
+ 'none' => array( 0, 0, 0, 0, 'None'),
+ 'all' => array(100, 100, 100, 100, 'All'),
+ // standard CMYK colors
+ 'cyan' => array(100, 0, 0, 0, 'Cyan'),
+ 'magenta' => array( 0, 100, 0, 0, 'Magenta'),
+ 'yellow' => array( 0, 0, 100, 0, 'Yellow'),
+ 'key' => array( 0, 0, 0, 100, 'Key'),
+ // alias
+ 'white' => array( 0, 0, 0, 0, 'White'),
+ 'black' => array( 0, 0, 0, 100, 'Black'),
+ // standard RGB colors
+ 'red' => array( 0, 100, 100, 0, 'Red'),
+ 'green' => array(100, 0, 100, 0, 'Green'),
+ 'blue' => array(100, 100, 0, 0, 'Blue'),
+ // Add here standard spot colors or dynamically define them with AddSpotColor()
+ * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.
+ * @param $hcolor (string) HTML color.
+ * @param $spotc (array) Reference to an array of spot colors.
+ * @param $defcol (array) Color to return in case of error.
+ * @return array RGB or CMYK color, or false in case of error.
+ * @public static
+ */
+ public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) {
+ $color = preg_replace('/[\s]*/', '', $hcolor); // remove extra spaces
+ $color = strtolower($color);
+ // check for javascript color array syntax
+ if (strpos($color, '[') !== false) {
+ if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) {
+ * CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
+ * Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel).
+ * @param $data (string) Data to decode.
+ * @return Decoded data string.
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function decodeFilterCCITTFaxDecode($data) {
+ self::Error('~decodeFilterCCITTFaxDecode: this method has not been yet implemented');
+ //return $data;
+ }
+
+ /**
+ * JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION)
+ * Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data).
+ * @param $data (string) Data to decode.
+ * @return Decoded data string.
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function decodeFilterJBIG2Decode($data) {
+ self::Error('~decodeFilterJBIG2Decode: this method has not been yet implemented');
+ //return $data;
+ }
+
+ /**
+ * DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
+ * Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data.
+ * @param $data (string) Data to decode.
+ * @return Decoded data string.
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function decodeFilterDCTDecode($data) {
+ self::Error('~decodeFilterDCTDecode: this method has not been yet implemented');
+ //return $data;
+ }
+
+ /**
+ * JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
+ * Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data.
+ * @param $data (string) Data to decode.
+ * @return Decoded data string.
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function decodeFilterJPXDecode($data) {
+ self::Error('~decodeFilterJPXDecode: this method has not been yet implemented');
+ //return $data;
+ }
+
+ /**
+ * Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION)
+ * Decrypts data encrypted by a security handler, reproducing the data as it was before encryption.
+ * @param $data (string) Data to decode.
+ * @return Decoded data string.
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function decodeFilterCrypt($data) {
+ self::Error('~decodeFilterCrypt: this method has not been yet implemented');
+ //return $data;
+ }
+
+ // --- END FILTERS SECTION -------------------------------------------------
+
+ /**
+ * Throw an exception.
+ * @param $msg (string) The error message
+ * @since 1.0.000 (2011-05-23)
+ * @public static
+ */
+ public static function Error($msg) {
+ throw new Exception('TCPDF_PARSER ERROR: '.$msg);
+ * Static cache used for speed up uniord performances
+ * @protected
+ */
+ protected static $cache_uniord = array();
+
+ /**
+ * Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable).
+ * @param $fontfile (string) Font file (full path).
+ * @param $fonttype (string) Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional.
+ * @param $enc (string) Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.
+ * @param $flags (int) Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.
+ * @param $outpath (string) Output path for generated font files (must be writeable by the web server). Leave empty for default font folder.
+ * @param $platid (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
+ * @param $encid (int) Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4.
+ * @param $addcbbox (boolean) If true includes the character bounding box information on the php font file.
+ * @param $link (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
+ * @return (string) TCPDF font name or boolean false in case of error.
+ * @author Nicola Asuni
+ * @since 5.9.123 (2010-09-30)
+ * @public static
+ */
+ public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) {
+ if (preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $str)) {
+ $arabic = true;
+ } else {
+ $arabic = false;
+ }
+ // check if string contains RTL text
+ if (!($forcertl OR $arabic OR preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $str))) {
+ return $ta;
+ }
+
+ // get number of chars
+ $numchars = count($ta);
+
+ if ($forcertl == 'R') {
+ $pel = 1;
+ } elseif ($forcertl == 'L') {
+ $pel = 0;
+ } else {
+ // P2. In each paragraph, find the first character of type L, AL, or R.
+ // P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero.
+ for ($i=0; $i < $numchars; ++$i) {
+ $type = TCPDF_FONT_DATA::$uni_type[$ta[$i]];
+ if ($type == 'L') {
+ $pel = 0;
+ break;
+ } elseif (($type == 'AL') OR ($type == 'R')) {
+ $pel = 1;
+ break;
+ }
+ }
+ }
+
+ // Current Embedding Level
+ $cel = $pel;
+ // directional override status
+ $dos = 'N';
+ $remember = array();
+ // start-of-level-run
+ $sor = $pel % 2 ? 'R' : 'L';
+ $eor = $sor;
+
+ // Array of characters data
+ $chardata = Array();
+
+ // X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral. Process each character iteratively, applying rules X2 through X9. Only embedding levels from 0 to 61 are valid in this phase.
+ // In the resolution of levels in rules I1 and I2, the maximum embedding level of 62 can be reached.
+ for ($i=0; $i < $numchars; ++$i) {
+ if ($ta[$i] == TCPDF_FONT_DATA::$uni_RLE) {
+ // X2. With each RLE, compute the least greater odd embedding level.
+ // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral.
+ // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status.
+ // X3. With each LRE, compute the least greater even embedding level.
+ // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral.
+ // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status.
+ // X4. With each RLO, compute the least greater odd embedding level.
+ // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to right-to-left.
+ // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status.
+ // X5. With each LRO, compute the least greater even embedding level.
+ // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to left-to-right.
+ // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status.
+ // X7. With each PDF, determine the matching embedding or override code. If there was a valid matching code, restore (pop) the last remembered (pushed) embedding level and directional override.
+ if (count($remember)) {
+ $last = count($remember ) - 1;
+ if (($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLE) OR
+ ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_LRE) OR
+ ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLO) OR
+ // X8. All explicit directional embeddings and overrides are completely terminated at the end of each paragraph. Paragraph separators are not included in the embedding.
+ // X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes.
+ // X10. The remaining rules are applied to each run of characters at the same level. For each run, determine the start-of-level-run (sor) and end-of-level-run (eor) type, either L or R. This depends on the higher of the two levels on either side of the boundary (at the start or end of the paragraph, the level of the 'other' run is the base embedding level). If the higher level is odd, the type is R; otherwise, it is L.
+
+ // 3.3.3 Resolving Weak Types
+ // Weak types are now resolved one level run at a time. At level run boundaries where the type of the character on the other side of the boundary is required, the type assigned to sor or eor is used.
+ // Nonspacing marks are now resolved based on the previous characters.
+ $numchars = count($chardata);
+
+ // W1. Examine each nonspacing mark (NSM) in the level run, and change the type of the NSM to the type of the previous character. If the NSM is at the start of the level run, it will get the type of sor.
+ $prevlevel = -1; // track level changes
+ $levcount = 0; // counts consecutive chars at the same level
+ // W2. Search backward from each instance of a European number until the first strong type (R, L, AL, or sor) is found. If an AL is found, change the type of the European number to Arabic number.
+ // W4. A single European separator between two European numbers changes to a European number. A single common separator between two numbers of the same type changes to that type.
+ $prevlevel = -1;
+ $levcount = 0;
+ for ($i=0; $i < $numchars; ++$i) {
+ if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) {
+ if (($chardata[$i]['type'] == 'ES') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) {
+ $chardata[$i]['type'] = 'EN';
+ } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) {
+ $chardata[$i]['type'] = 'EN';
+ } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'AN') AND ($chardata[($i+1)]['type'] == 'AN')) {
+ $chardata[$i]['type'] = 'AN';
+ }
+ }
+ if ($chardata[$i]['level'] != $prevlevel) {
+ $levcount = 0;
+ } else {
+ ++$levcount;
+ }
+ $prevlevel = $chardata[$i]['level'];
+ }
+
+ // W5. A sequence of European terminators adjacent to European numbers changes to all European numbers.
+ $prevlevel = -1;
+ $levcount = 0;
+ for ($i=0; $i < $numchars; ++$i) {
+ if ($chardata[$i]['type'] == 'ET') {
+ if (($levcount > 0) AND ($chardata[($i-1)]['type'] == 'EN')) {
+ $chardata[$i]['type'] = 'EN';
+ } else {
+ $j = $i+1;
+ while (($j < $numchars) AND ($chardata[$j]['level'] == $prevlevel)) {
+ if ($chardata[$j]['type'] == 'EN') {
+ $chardata[$i]['type'] = 'EN';
+ break;
+ } elseif ($chardata[$j]['type'] != 'ET') {
+ break;
+ }
+ ++$j;
+ }
+ }
+ }
+ if ($chardata[$i]['level'] != $prevlevel) {
+ $levcount = 0;
+ } else {
+ ++$levcount;
+ }
+ $prevlevel = $chardata[$i]['level'];
+ }
+
+ // W6. Otherwise, separators and terminators change to Other Neutral.
+ $prevlevel = -1;
+ $levcount = 0;
+ for ($i=0; $i < $numchars; ++$i) {
+ if (($chardata[$i]['type'] == 'ET') OR ($chardata[$i]['type'] == 'ES') OR ($chardata[$i]['type'] == 'CS')) {
+ $chardata[$i]['type'] = 'ON';
+ }
+ if ($chardata[$i]['level'] != $prevlevel) {
+ $levcount = 0;
+ } else {
+ ++$levcount;
+ }
+ $prevlevel = $chardata[$i]['level'];
+ }
+
+ //W7. Search backward from each instance of a European number until the first strong type (R, L, or sor) is found. If an L is found, then change the type of the European number to L.
+ $prevlevel = -1;
+ $levcount = 0;
+ for ($i=0; $i < $numchars; ++$i) {
+ if ($chardata[$i]['char'] == 'EN') {
+ for ($j=$levcount; $j >= 0; $j--) {
+ if ($chardata[$j]['type'] == 'L') {
+ $chardata[$i]['type'] = 'L';
+ } elseif ($chardata[$j]['type'] == 'R') {
+ break;
+ }
+ }
+ }
+ if ($chardata[$i]['level'] != $prevlevel) {
+ $levcount = 0;
+ } else {
+ ++$levcount;
+ }
+ $prevlevel = $chardata[$i]['level'];
+ }
+
+ // N1. A sequence of neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. European and Arabic numbers act as if they were R in terms of their influence on neutrals. Start-of-level-run (sor) and end-of-level-run (eor) are used at level run boundaries.
+ $prevlevel = -1;
+ $levcount = 0;
+ for ($i=0; $i < $numchars; ++$i) {
+ if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) {
+ if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) {
+ $chardata[$i]['type'] = 'L';
+ } elseif (($chardata[$i]['type'] == 'N') AND
+ (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND
+ (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) {
+ $chardata[$i]['type'] = 'R';
+ } elseif ($chardata[$i]['type'] == 'N') {
+ // N2. Any remaining neutrals take the embedding direction
+ $chardata[$i]['type'] = $chardata[$i]['sor'];
+ }
+ } elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) {
+ // first char
+ if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) {
+ $chardata[$i]['type'] = 'L';
+ } elseif (($chardata[$i]['type'] == 'N') AND
+ (($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND
+ (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) {
+ $chardata[$i]['type'] = 'R';
+ } elseif ($chardata[$i]['type'] == 'N') {
+ // N2. Any remaining neutrals take the embedding direction
+ $chardata[$i]['type'] = $chardata[$i]['sor'];
+ }
+ } elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) {
+ //last char
+ if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) {
+ $chardata[$i]['type'] = 'L';
+ } elseif (($chardata[$i]['type'] == 'N') AND
+ (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND
+ (($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) {
+ $chardata[$i]['type'] = 'R';
+ } elseif ($chardata[$i]['type'] == 'N') {
+ // N2. Any remaining neutrals take the embedding direction
+ $chardata[$i]['type'] = $chardata[$i]['sor'];
+ }
+ } elseif ($chardata[$i]['type'] == 'N') {
+ // N2. Any remaining neutrals take the embedding direction
+ $chardata[$i]['type'] = $chardata[$i]['sor'];
+ }
+ if ($chardata[$i]['level'] != $prevlevel) {
+ $levcount = 0;
+ } else {
+ ++$levcount;
+ }
+ $prevlevel = $chardata[$i]['level'];
+ }
+
+ // I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels.
+ // I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level.
+ for ($i=0; $i < $numchars; ++$i) {
+ $odd = $chardata[$i]['level'] % 2;
+ if ($odd) {
+ if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) {
+ // L1. On each line, reset the embedding level of the following characters to the paragraph embedding level:
+ // 1. Segment separators,
+ // 2. Paragraph separators,
+ // 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and
+ // 4. Any sequence of white space characters at the end of the line.
+ for ($i=0; $i < $numchars; ++$i) {
+ if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) {
+ $chardata[$i]['level'] = $pel;
+ } elseif ($chardata[$i]['type'] == 'WS') {
+ $j = $i+1;
+ while ($j < $numchars) {
+ if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR
+ (($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) {
+ $chardata[$i]['level'] = $pel;
+ break;
+ } elseif ($chardata[$j]['type'] != 'WS') {
+ break;
+ }
+ ++$j;
+ }
+ }
+ }
+
+ // Arabic Shaping
+ // Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run.
+ // L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher.
+ for ($j=$maxlevel; $j > 0; $j--) {
+ $ordarray = Array();
+ $revarr = Array();
+ $onlevel = false;
+ for ($i=0; $i < $numchars; ++$i) {
+ if ($chardata[$i]['level'] >= $j) {
+ $onlevel = true;
+ if (isset(TCPDF_FONT_DATA::$uni_mirror[$chardata[$i]['char']])) {
+ // L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true.
+ * @param $type (string) valid values are: <ul><li>'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;</li><li>'CropBox' : the visible region of default user space;</li><li>'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;</li><li>'TrimBox' : the intended dimensions of the finished page after trimming;</li><li>'ArtBox' : the page's meaningful content (including potential white space).</li></ul>
+ * @param $llx (float) lower-left x coordinate in user units.
+ * @param $lly (float) lower-left y coordinate in user units.
+ * @param $urx (float) upper-right x coordinate in user units.
+ * @param $ury (float) upper-right y coordinate in user units.
+ * @param $points (boolean) If true uses user units as unit of measure, otherwise uses PDF points.
+ * @param $k (float) Scale factor (number of points in user unit).
+ * @param $pagedim (array) Array of page dimensions.
+ * @return pagedim array of page dimensions.
+ * @since 5.0.010 (2010-05-17)
+ * @public static
+ */
+ public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points=false, $k, $pagedim=array()) {
+ if (!isset($pagedim[$page])) {
+ // initialize array
+ $pagedim[$page] = array();
+ }
+ if (!in_array($type, self::$pageboxes)) {
+ return;
+ }
+ if ($points) {
+ $k = 1;
+ }
+ $pagedim[$page][$type]['llx'] = ($llx * $k);
+ $pagedim[$page][$type]['lly'] = ($lly * $k);
+ $pagedim[$page][$type]['urx'] = ($urx * $k);
+ $pagedim[$page][$type]['ury'] = ($ury * $k);
+ return $pagedim;
+ }
+
+ /**
+ * Swap X and Y coordinates of page boxes (change page boxes orientation).
+ * @param $page (int) page number
+ * @param $pagedim (array) Array of page dimensions.
+ * @return pagedim array of page dimensions.
+ * @since 5.0.010 (2010-05-17)
+ * @public static
+ */
+ public static function swapPageBoxCoordinates($page, $pagedim) {
+ * @param $layout (string) The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul>
+ * @return (string) Canonical page layout name.
+ * @public static
+ */
+ public static function getPageLayoutMode($layout='SinglePage') {
+ switch ($layout) {
+ case 'default':
+ case 'single':
+ case 'SinglePage': {
+ $layout_mode = 'SinglePage';
+ break;
+ }
+ case 'continuous':
+ case 'OneColumn': {
+ $layout_mode = 'OneColumn';
+ break;
+ }
+ case 'two':
+ case 'TwoColumnLeft': {
+ $layout_mode = 'TwoColumnLeft';
+ break;
+ }
+ case 'TwoColumnRight': {
+ $layout_mode = 'TwoColumnRight';
+ break;
+ }
+ case 'TwoPageLeft': {
+ $layout_mode = 'TwoPageLeft';
+ break;
+ }
+ case 'TwoPageRight': {
+ $layout_mode = 'TwoPageRight';
+ break;
+ }
+ default: {
+ $layout_mode = 'SinglePage';
+ }
+ }
+ return $layout_mode;
+ }
+
+ /**
+ * Get the canonical page layout mode.
+ * @param $mode (string) A name object specifying how the document should be displayed when opened:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul>
+ * @return (string) Canonical page mode name.
+ * @public static
+ */
+ public static function getPageMode($mode='UseNone') {
+ switch ($mode) {
+ case 'UseNone': {
+ $page_mode = 'UseNone';
+ break;
+ }
+ case 'UseOutlines': {
+ $page_mode = 'UseOutlines';
+ break;
+ }
+ case 'UseThumbs': {
+ $page_mode = 'UseThumbs';
+ break;
+ }
+ case 'FullScreen': {
+ $page_mode = 'FullScreen';
+ break;
+ }
+ case 'UseOC': {
+ $page_mode = 'UseOC';
+ break;
+ }
+ case '': {
+ $page_mode = 'UseAttachments';
+ break;
+ }
+ default: {
+ $page_mode = 'UseNone';
+ }
+ }
+ return $page_mode;
+ }
+
+ /**
+ * Check if the URL exist.
+ * @param $url (string) URL to check.
+ * @return Boolean true if the URl exist, false otherwise.
+ * @since 5.9.204 (2013-01-28)
+ * @public static
+ */
+ public static function isValidURL($url) {
+ $headers = @get_headers($url);
+ return (strpos($headers[0], '200') !== false);
+ }
+
+ /**
+ * Removes SHY characters from text.
+ * Unicode Data:<ul>
+ * <li>Name : SOFT HYPHEN, commonly abbreviated as SHY</li>
+ * <li>HTML Entity (decimal): "&#173;"</li>
+ * <li>HTML Entity (hex): "&#xad;"</li>
+ * <li>HTML Entity (named): "&shy;"</li>
+ * <li>How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]</li>
+ * <li>UTF-8 (hex): 0xC2 0xAD (c2ad)</li>
+ * <li>UTF-8 character: chr(194).chr(173)</li>
+ * </ul>
+ * @param $txt (string) input string
+ * @param $unicode (boolean) True if we are in unicode mode, false otherwise.
+ * @return string without SHY characters.
+ * @since (4.5.019) 2009-02-28
+ * @public static
+ */
+ public static function removeSHY($txt='', $unicode=true) {
+ * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages)
+ * @param $brd (mixed) Indicates if borders must be drawn around the cell block. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
+ * Get ULONG from string (Big Endian 32-bit unsigned integer).
+ * @param $str (string) string from where to extract value
+ * @param $offset (int) point from where to read the data
+ * @return int 32 bit value
+ * @author Nicola Asuni
+ * @since 5.2.000 (2010-06-02)
+ * @public static
+ */
+ public static function _getULONG($str, $offset) {
+ $v = unpack('Ni', substr($str, $offset, 4));
+ return $v['i'];
+ }
+
+ /**
+ * Get USHORT from string (Big Endian 16-bit unsigned integer).
+ * @param $str (string) string from where to extract value
+ * @param $offset (int) point from where to read the data
+ * @return int 16 bit value
+ * @author Nicola Asuni
+ * @since 5.2.000 (2010-06-02)
+ * @public static
+ */
+ public static function _getUSHORT($str, $offset) {
+ $v = unpack('ni', substr($str, $offset, 2));
+ return $v['i'];
+ }
+
+ /**
+ * Get SHORT from string (Big Endian 16-bit signed integer).
+ * @param $str (string) String from where to extract value.
+ * @param $offset (int) Point from where to read the data.
+ * @return int 16 bit value
+ * @author Nicola Asuni
+ * @since 5.2.000 (2010-06-02)
+ * @public static
+ */
+ public static function _getSHORT($str, $offset) {
+ $v = unpack('si', substr($str, $offset, 2));
+ return $v['i'];
+ }
+
+ /**
+ * Get FWORD from string (Big Endian 16-bit signed integer).
+ * @param $str (string) String from where to extract value.
+ * @param $offset (int) Point from where to read the data.
+ * @return int 16 bit value
+ * @author Nicola Asuni
+ * @since 5.9.123 (2011-09-30)
+ * @public static
+ */
+ public static function _getFWORD($str, $offset) {
+ $v = self::_getUSHORT($str, $offset);
+ if ($v > 0x7fff) {
+ $v -= 0x10000;
+ }
+ return $v;
+ }
+
+ /**
+ * Get UFWORD from string (Big Endian 16-bit unsigned integer).
+ * @param $str (string) string from where to extract value
+ * @param $offset (int) point from where to read the data
+ * @return int 16 bit value
+ * @author Nicola Asuni
+ * @since 5.9.123 (2011-09-30)
+ * @public static
+ */
+ public static function _getUFWORD($str, $offset) {
+ $v = self::_getUSHORT($str, $offset);
+ return $v;
+ }
+
+ /**
+ * Get FIXED from string (32-bit signed fixed-point number (16.16).
+ * @param $str (string) string from where to extract value
+ * @param $offset (int) point from where to read the data
+ * @return int 16 bit value
+ * @author Nicola Asuni
+ * @since 5.9.123 (2011-09-30)
+ * @public static
+ */
+ public static function _getFIXED($str, $offset) {
+ // mantissa
+ $m = self::_getFWORD($str, $offset);
+ // fraction
+ $f = self::_getUSHORT($str, ($offset + 2));
+ $v = floatval(''.$m.'.'.$f.'');
+ return $v;
+ }
+
+ /**
+ * Get BYTE from string (8-bit unsigned integer).
+ * @param $str (string) String from where to extract value.
+ * @param $offset (int) Point from where to read the data.
+ * @return int 8 bit value
+ * @author Nicola Asuni
+ * @since 5.2.000 (2010-06-02)
+ * @public static
+ */
+ public static function _getBYTE($str, $offset) {
+ $v = unpack('Ci', substr($str, $offset, 1));
+ return $v['i'];
+ }
+ /**
+ * 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 $handle (resource)
+ * @param $length (int)
+ * @return Returns the read string or FALSE in case of error.
+ * @author Nicola Asuni
+ * @since 4.5.027 (2009-03-16)
+ * @public static
+ */
+ public static function rfread($handle, $length) {
+ $data = fread($handle, $length);
+ if ($data === false) {
+ return false;
+ }
+ $rest = ($length - strlen($data));
+ if ($rest > 0) {
+ $data .= self::rfread($handle, $rest);
+ }
+ return $data;
+ }
+
+ /**
+ * Read a 4-byte (32 bit) integer from file.
+ * @param $f (string) file name.
+ * @return 4-byte integer
+ * @public static
+ */
+ public static function _freadint($f) {
+ $a = unpack('Ni', fread($f, 4));
+ return $a['i'];
+ }
+
+ /**
+ * Returns a string containing random data to be used as a seed for encryption methods.
+ * @param $seed (string) starting seed value
+ * @return string containing random data
+ * @author Nicola Asuni
+ * @since 5.9.006 (2010-10-19)
+ * @public static
+ */
+ public static function getRandomSeed($seed='') {
+ $seed .= microtime();
+ if (function_exists('openssl_random_pseudo_bytes') AND (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) {
+ // this is not used on windows systems because it is very slow for a know bug
+ $seed .= openssl_random_pseudo_bytes(512);
+ } else {
+ for ($i = 0; $i < 23; ++$i) {
+ $seed .= uniqid('', true);
+ }
+ }
+ $seed .= uniqid('', true);
+ $seed .= rand();
+ $seed .= __FILE__;
+ if (isset($_SERVER['REMOTE_ADDR'])) {
+ $seed .= $_SERVER['REMOTE_ADDR'];
+ }
+ if (isset($_SERVER['HTTP_USER_AGENT'])) {
+ $seed .= $_SERVER['HTTP_USER_AGENT'];
+ }
+ if (isset($_SERVER['HTTP_ACCEPT'])) {
+ $seed .= $_SERVER['HTTP_ACCEPT'];
+ }
+ if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
+ $seed .= $_SERVER['HTTP_ACCEPT_ENCODING'];
+ }
+ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ $seed .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ }
+ if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
+ $seed .= $_SERVER['HTTP_ACCEPT_CHARSET'];
+ }
+ $seed .= rand();
+ $seed .= uniqid('', true);
+ $seed .= microtime();
+ return $seed;
+ }
+
+ /**
+ * Encrypts a string using MD5 and returns it's value as a binary string.
+ * @param $str (string) input string
+ * @return String MD5 encrypted binary string
+ * @since 2.0.000 (2008-01-02)
+ * @public static
+ */
+ public static function _md5_16($str) {
+ return pack('H*', md5($str));
+ }
+
+ /**
+ * Returns the input text exrypted using AES algorithm and the specified key.
+ * This method requires mcrypt.
+ * @param $key (string) encryption key
+ * @param $text (String) input text to be encrypted
+ // rotation: The rotation of a widget in counterclockwise increments.
+ if (isset($prop['rotation'])) {
+ $opt['mk']['r'] = $prop['rotation'];
+ }
+ // charLimit: Limits the number of characters that a user can type into a text field.
+ if (isset($prop['charLimit'])) {
+ $opt['maxlen'] = intval($prop['charLimit']);
+ }
+ if (!isset($ff)) {
+ $ff = 0; // default value
+ }
+ // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it.
+ if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) {
+ $ff += 1 << 0;
+ }
+ // required: Specifies whether a field requires a value.
+ if (isset($prop['required']) AND ($prop['required'] == 'true')) {
+ $ff += 1 << 1;
+ }
+ // multiline: Controls how text is wrapped within the field.
+ if (isset($prop['multiline']) AND ($prop['multiline'] == 'true')) {
+ $ff += 1 << 12;
+ }
+ // password: Specifies whether the field should display asterisks when data is entered in the field.
+ if (isset($prop['password']) AND ($prop['password'] == 'true')) {
+ $ff += 1 << 13;
+ }
+ // NoToggleToOff: If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect.
+ if (isset($prop['NoToggleToOff']) AND ($prop['NoToggleToOff'] == 'true')) {
+ $ff += 1 << 14;
+ }
+ // Radio: If set, the field is a set of radio buttons.
+ if (isset($prop['Radio']) AND ($prop['Radio'] == 'true')) {
+ $ff += 1 << 15;
+ }
+ // Pushbutton: If set, the field is a pushbutton that does not retain a permanent value.
+ if (isset($prop['Pushbutton']) AND ($prop['Pushbutton'] == 'true')) {
+ $ff += 1 << 16;
+ }
+ // Combo: If set, the field is a combo box; if clear, the field is a list box.
+ if (isset($prop['Combo']) AND ($prop['Combo'] == 'true')) {
+ $ff += 1 << 17;
+ }
+ // editable: Controls whether a combo box is editable.
+ if (isset($prop['editable']) AND ($prop['editable'] == 'true')) {
+ $ff += 1 << 18;
+ }
+ // Sort: If set, the field's option items shall be sorted alphabetically.
+ if (isset($prop['Sort']) AND ($prop['Sort'] == 'true')) {
+ $ff += 1 << 19;
+ }
+ // fileSelect: If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection).
+ if (isset($prop['fileSelect']) AND ($prop['fileSelect'] == 'true')) {
+ $ff += 1 << 20;
+ }
+ // multipleSelection: If true, indicates that a list box allows a multiple selection of items.
+ if (isset($prop['multipleSelection']) AND ($prop['multipleSelection'] == 'true')) {
+ $ff += 1 << 21;
+ }
+ // doNotSpellCheck: If true, spell checking is not performed on this editable text field.
+ if (isset($prop['doNotSpellCheck']) AND ($prop['doNotSpellCheck'] == 'true')) {
+ $ff += 1 << 22;
+ }
+ // doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field.
+ if (isset($prop['doNotScroll']) AND ($prop['doNotScroll'] == 'true')) {
+ $ff += 1 << 23;
+ }
+ // comb: If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set.
+ if (isset($prop['comb']) AND ($prop['comb'] == 'true')) {
+ $ff += 1 << 24;
+ }
+ // radiosInUnison: If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons.
+ if (isset($prop['radiosInUnison']) AND ($prop['radiosInUnison'] == 'true')) {
+ $ff += 1 << 25;
+ }
+ // richText: If true, the field allows rich text formatting.
+ if (isset($prop['richText']) AND ($prop['richText'] == 'true')) {
+ $ff += 1 << 25;
+ }
+ // commitOnSelChange: Controls whether a field value is committed after a selection change.
+ if (isset($prop['commitOnSelChange']) AND ($prop['commitOnSelChange'] == 'true')) {
+ $ff += 1 << 26;
+ }
+ $opt['ff'] = $ff;
+ // defaultValue: The default value of a field - that is, the value that the field is set to when the form is reset.
+ if (isset($prop['defaultValue'])) {
+ $opt['dv'] = $prop['defaultValue'];
+ }
+ $f = 4; // default value for annotation flags
+ // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it.
+ if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) {
+ $f += 1 << 6;
+ }
+ // display: Controls whether the field is hidden or visible on screen and in print.
+ $a = 0; // the declaration is not from is a 'style' attribute
+ $b = intval(preg_match_all('/[\#]/', $selector, $matches)); // number of ID attributes
+ $c = intval(preg_match_all('/[\[\.]/', $selector, $matches)); // number of other attributes
+ $c += intval(preg_match_all('/[\:]link|visited|hover|active|focus|target|lang|enabled|disabled|checked|indeterminate|root|nth|first|last|only|empty|contains|not/i', $selector, $matches)); // number of pseudo-classes
+ $d = intval(preg_match_all('/[\>\+\~\s]{1}[a-zA-Z0-9]+/', ' '.$selector, $matches)); // number of element names
+ $d += intval(preg_match_all('/[\:][\:]/', $selector, $matches)); // number of pseudo-elements
+ $specificity = $a.$b.$c.$d;
+ // add specificity to the beginning of the selector
+ * Returns the angle in radiants between two vectors
+ * @param $x1 (int) X coordinate of first vector point
+ * @param $y1 (int) Y coordinate of first vector point
+ * @param $x2 (int) X coordinate of second vector point
+ * @param $y2 (int) Y coordinate of second vector point
+ * @author Nicola Asuni
+ * @since 5.0.000 (2010-05-04)
+ * @public static
+ */
+ public static function getVectorsAngle($x1, $y1, $x2, $y2) {
+ $dprod = ($x1 * $x2) + ($y1 * $y2);
+ $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1));
+ $dist2 = sqrt(($x2 * $x2) + ($y2 * $y2));
+ $angle = acos($dprod / ($dist1 * $dist2));
+ if (is_nan($angle)) {
+ $angle = M_PI;
+ }
+ if ((($x1 * $y2) - ($x2 * $y1)) < 0) {
+ $angle *= -1;
+ }
+ return $angle;
+ }
+
+ /**
+ * Split string by a regular expression.
+ * This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850
+ * @param $pattern (string) The regular expression pattern to search for without the modifiers, as a string.
+ * @param $modifiers (string) The modifiers part of the pattern,
+ * @param $subject (string) The input string.
+ * @param $limit (int) If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.
+ * @param $flags (int) The flags as specified on the preg_split PHP function.
+ * @return Returns an array containing substrings of subject split along boundaries matched by pattern.modifier
+ * @author Nicola Asuni
+ * @since 6.0.023
+ * @public static
+ */
+ public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL) {
+ // the bug only happens on PHP 5.2 when using the u modifier
+ if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) {
+ * RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index)
+ * RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service.
+ * @param $code (string) code to print
+ * @param $kix (boolean) if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code.
+ * @return array barcode representation.
+ * @protected
+ */
+ protected function barcode_rms4cc($code, $kix=false) {
+ * Intelligent Mail barcode is a 65-bar code for use on mail in the United States.
+ * The fields are described as follows:<ul><li>The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0–4. The allowable encoding ranges shall be 00–04, 10–14, 20–24, 30–34, 40–44, 50–54, 60–64, 70–74, 80–84, and 90–94.</li><li>The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000http://it2.php.net/manual/en/function.dechex.php–999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.</li><li>The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.</li><li>The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000–999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000–99999, 000000000–999999999, and 00000000000–99999999999.</li></ul>
+ * @param $code (string) code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode)
+ // if the reverse is less than count, we have already visited this pair before
+ if ($reverse >= $count) {
+ // If count is symmetric, place it at the first free slot from the end of the list.
+ // Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list
+ * PHP class to creates array representations for 2D barcodes to be used with TCPDF.
+ * @package com.tecnick.tcpdf
+ * @author Nicola Asuni
+ * @version 1.0.015
+ */
+
+/**
+ * @class TCPDF2DBarcode
+ * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).
+ * @package com.tecnick.tcpdf
+ * @version 1.0.015
+ * @author Nicola Asuni
+ */
+class TCPDF2DBarcode {
+
+ /**
+ * Array representation of barcode.
+ * @protected
+ */
+ protected $barcode_array = false;
+
+ /**
+ * This is the class constructor.
+ * Return an array representations for 2D barcodes:<ul>
+ * <li>$arrcode['code'] code to be printed on text label</li>
+ * <li>$arrcode['num_rows'] required number of rows</li>
+ * <li>$arrcode['num_cols'] required number of columns</li>
+ * <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul>
+ * @param $code (string) code to print
+ * @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
+ */
+ public function __construct($code, $type) {
+ $this->setBarcode($code, $type);
+ }
+
+ /**
+ * Return an array representations of barcode.
+ * @return array
+ */
+ public function getBarcodeArray() {
+ return $this->barcode_array;
+ }
+
+ /**
+ * Send barcode as SVG image object to the standard output.
+ * @param $w (int) Width of a single rectangle element in user units.
+ * @param $h (int) Height of a single rectangle element in user units.
+ * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent).
+ * @public
+ */
+ public function getBarcodeSVG($w=3, $h=3, $color='black') {
+ * @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
+ * @return array
+ */
+ public function setBarcode($code, $type) {
+ $mode = explode(',', $type);
+ $qrtype = strtoupper($mode[0]);
+ switch ($qrtype) {
+ case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022)