Beginnings of PDF timetable renderer
--- /dev/null
+++ b/stop.pdf.php
@@ -1,1 +1,185 @@
+<?php
+include('common.inc.php');
+$url = $APIurl."/json/stop?stop_id=".$_REQUEST['stopid'];
+$stop = json_decode(getPage($url));
+$html .= '<div data-role="content" class="ui-content" role="main"><p>'.staticmap(Array(0 => Array($stop[2],$stop[3])), 0,"iconb", false).'</p>';
+$html .= ' <ul data-role="listview" data-inset="true">';
+$url = $APIurl."/json/stoptrips?stop=".$_REQUEST['stopid']."&time=".midnight_seconds()."&service_period=".service_period();
+$trips = json_decode(getPage($url));
+debug(print_r($trips,true));
+foreach ($trips as $row)
+{
+$html .= '<li>';
+$html .= '<h3><a href="trip.php?stopid='.$_REQUEST['stopid'].'&tripid='.$row[1][0].'">'.$row[1][1];
+if (isFastDevice()) {
+ $viaPoints = viaPointNames($row[1][0],$_REQUEST['stopid']);
+ if ($viaPoints != "") $html .= '<br><small>Via: '.$viaPoints.'</small> </a></h3>';
+}
+$html .= '<p class="ui-li-aside"><strong>'.midnight_seconds_to_time($row[0]).'</strong></p>';
+$html .= '</li>';
+}
+if (sizeof($trips) == 0) $html .= "<li> <center>No trips in the near future.</center> </li>";
+$html .= '</ul></div>';
+require_once('tcpdf/config/lang/eng.php');
+require_once('tcpdf/tcpdf.php');
+
+// create new PDF document
+class Custom_TCPDF extends TCPDF {
+ var $QRCodeURL;
+
+ function set_QRCodeURL ($url) {
+ $this->QRCodeURL = $url;
+ }
+
+/**
+ * This method is used to render the page header.
+ * It is automatically called by AddPage() and could be overwritten in your own inherited class.
+ * @public
+ */
+ public function Header() {
+ if ($this->header_xobjid < 0) {
+ // start a new XObject Template
+ $this->header_xobjid = $this->startTemplate($this->w, $this->tMargin+10);
+ $headerfont = $this->getHeaderFont();
+ $headerdata = $this->getHeaderData();
+ $this->y = $this->header_margin;
+ if ($this->rtl) {
+ $this->x = $this->w - $this->original_rMargin;
+ } else {
+ $this->x = $this->original_lMargin-10;
+ }
+ if (isset($this->QRCodeURL)) {
+// QRCODE,H : QR-CODE Best error correction
+$style = array(
+ 'border' => 1,
+ 'padding' => 0,
+ 'fgcolor' => array(0,0,0),
+ 'bgcolor' => false, //array(255,255,255)
+ 'module_width' => 1, // width of a single module in points
+ 'module_height' => 1 // height of a single module in points
+);
+$this->write2DBarcode($this->QRCodeURL, 'QRCODE,H', '', '', 25, 25, $style, 'T');
+$imgy = 50+20;
+ } elseif (($headerdata['logo']) AND ($headerdata['logo'] != K_BLANK_IMAGE)) {
+ $imgtype = $this->getImageFileType(K_PATH_IMAGES.$headerdata['logo']);
+ if (($imgtype == 'eps') OR ($imgtype == 'ai')) {
+ $this->ImageEps(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']);
+ } elseif ($imgtype == 'svg') {
+ $this->ImageSVG(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']);
+ } else {
+ $this->Image(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']);
+ }
+ $imgy = $this->getImageRBY();
+ } else {
+ $imgy = $this->y;
+ }
+ $cell_height = round(($this->cell_height_ratio * $headerfont[2]) / $this->k, 2);
+ // set starting margin for text data cell
+ if ($this->getRTL()) {
+ $header_x = $this->original_rMargin + ($headerdata['logo_width'] * 1.1);
+ } else {
+ $header_x = $this->original_lMargin + ($headerdata['logo_width'] * 1.1);
+ }
+ $cw = $this->w - $this->original_lMargin - $this->original_rMargin - ($headerdata['logo_width'] * 1.1);
+ $this->SetTextColor(0, 0, 0);
+ // header title
+ $this->SetFont($headerfont[0], 'B', $headerfont[2] + 1);
+ $this->SetX($header_x);
+ $this->Cell($cw, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0);
+ // header string
+ $this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]);
+ $this->SetX($header_x);
+ $this->MultiCell($cw, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false);
+ // print an ending header line
+ //$this->SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
+ //$this->SetY((2.835 / $this->k) + max($imgy, $this->y));
+ if ($this->rtl) {
+ $this->SetX($this->original_rMargin);
+ } else {
+ $this->SetX($this->original_lMargin);
+ }
+ //$this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C');
+ $this->endTemplate();
+ }
+ // print header template
+ $x = 0;
+ $dx = 0;
+ if ($this->booklet AND (($this->page % 2) == 0)) {
+ // adjust margins for booklet mode
+ $dx = ($this->original_lMargin - $this->original_rMargin);
+ }
+ if ($this->rtl) {
+ $x = $this->w + $dx;
+ } else {
+ $x = 0 + $dx;
+ }
+ $this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);
+ }
+
+
+}
+$pdf = new Custom_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
+
+// set document information
+$pdf->SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('bus.lambdacomplex.org');
+$pdf->SetTitle($stop[1]);
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $stop[1] . " Timetable", "Some description of customization like Weekdays, 9am-10am");
+$pdf->set_QRCodeURL(curPageURL()."stop.php?stopid=".$_REQUEST['stopid']);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+//set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+//set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+//set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+//set some language-dependent strings
+$pdf->setLanguageArray($l);
+
+// ---------------------------------------------------------
+
+// set default font subsetting mode
+$pdf->setFontSubsetting(true);
+
+// Set font
+// dejavusans is a UTF-8 Unicode font, if you only need to
+// print standard ASCII chars, you can use core fonts like
+// helvetica or times to reduce file size.
+$pdf->SetFont('helvetica', '', 14, '', true);
+
+// Add a page
+// This method has several options, check the source code documentation for more information.
+$pdf->AddPage();
+
+
+// Print text using writeHTMLCell()
+$pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
+
+
+
+// ---------------------------------------------------------
+
+// Close and output PDF document
+// This method has several options, check the source code documentation for more information.
+$pdf->Output('example_001.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
+?>
+
--- /dev/null
+++ b/tcpdf/2dbarcodes.php
@@ -1,1 +1,173 @@
+<?php
+//============================================================+
+// File name : 2dbarcodes.php
+// Version : 1.0.007
+// Begin : 2009-04-07
+// Last Update : 2010-12-16
+// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
+// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
+// -------------------------------------------------------------------
+// Copyright (C) 2009-2010 Nicola Asuni - Tecnick.com S.r.l.
+//
+// This file is part of TCPDF software library.
+//
+// TCPDF is free software: you can redistribute it and/or modify it
+// under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// TCPDF is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
+//
+// See LICENSE.TXT file for more information.
+// -------------------------------------------------------------------
+//
+// Description : PHP class to creates array representations for
+// 2D barcodes to be used with TCPDF.
+//
+//============================================================+
+/**
+ * @file
+ * PHP class to creates array representations for 2D barcodes to be used with TCPDF.
+ * @package com.tecnick.tcpdf
+ * @author Nicola Asuni
+ * @version 1.0.007
+ */
+
+/**
+ * @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.007
+ * @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>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</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></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;
+ }
+
+ /**
+ * Set the barcode.
+ * @param $code (string) code to print
+ * @param $type (string) type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</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></ul>
+ * @return array
+ */
+ public function setBarcode($code, $type) {
+ $mode = explode(',', $type);
+ $qrtype = strtoupper($mode[0]);
+ switch ($qrtype) {
+ case 'QRCODE': { // QR-CODE
+ require_once(dirname(__FILE__).'/qrcode.php');
+ if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) {
+ $mode[1] = 'L'; // Ddefault: Low error correction
+ }
+ $qrcode = new QRcode($code, strtoupper($mode[1]));
+ $this->barcode_array = $qrcode->getBarcodeArray();
+ break;
+ }
+ case 'PDF417': { // PDF417 (ISO/IEC 15438:2006)
+ require_once(dirname(__FILE__).'/pdf417.php');
+ if (!isset($mode[1]) OR ($mode[1] === '')) {
+ $aspectratio = 2; // default aspect ratio (width / height)
+ } else {
+ $aspectratio = floatval($mode[1]);
+ }
+ if (!isset($mode[2]) OR ($mode[2] === '')) {
+ $ecl = -1; // default error correction level (auto)
+ } else {
+ $ecl = intval($mode[2]);
+ }
+ // set macro block
+ $macro = array();
+ if (isset($mode[3]) AND ($mode[3] !== '') AND isset($mode[4]) AND ($mode[4] !== '') AND isset($mode[5]) AND ($mode[5] !== '')) {
+ $macro['segment_total'] = intval($mode[3]);
+ $macro['segment_index'] = intval($mode[4]);
+ $macro['file_id'] = strtr($mode[5], "\xff", ',');
+ for ($i = 0; $i < 7; ++$i) {
+ $o = $i + 6;
+ if (isset($mode[$o]) AND ($mode[$o] !== '')) {
+ // add option
+ $macro['option_'.$i] = strtr($mode[$o], "\xff", ',');
+ }
+ }
+ }
+ $qrcode = new PDF417($code, $ecl, $aspectratio, $macro);
+ $this->barcode_array = $qrcode->getBarcodeArray();
+ break;
+ }
+ case 'RAW':
+ case 'RAW2': { // RAW MODE
+ // remove spaces
+ $code = preg_replace('/[\s]*/si', '', $code);
+ if (strlen($code) < 3) {
+ break;
+ }
+ if ($qrtype == 'RAW') {
+ // comma-separated rows
+ $rows = explode(',', $code);
+ } else { // RAW2
+ // rows enclosed in square parentheses
+ $code = substr($code, 1, -1);
+ $rows = explode('][', $code);
+ }
+ $this->barcode_array['num_rows'] = count($rows);
+ $this->barcode_array['num_cols'] = strlen($rows[0]);
+ $this->barcode_array['bcode'] = array();
+ foreach ($rows as $r) {
+ $this->barcode_array['bcode'][] = str_split($r, 1);
+ }
+ break;
+ }
+ case 'TEST': { // TEST MODE
+ $this->barcode_array['num_rows'] = 5;
+ $this->barcode_array['num_cols'] = 15;
+ $this->barcode_array['bcode'] = array(
+ array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1),
+ array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0),
+ array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0),
+ array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0),
+ array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0));
+ break;
+ }
+ default: {
+ $this->barcode_array = false;
+ }
+ }
+ }
+} // end of class
+
+//============================================================+
+// END OF FILE
+//============================================================+
+
--- /dev/null
+++ b/tcpdf/CHANGELOG.TXT
@@ -1,1 +1,1957 @@
-
+5.9.059 (2011-02-27)
+ - Default Header() method was improved to reduce document size.
+
+5.9.058 (2011-02-25)
+ - Image() method was improved to cache images with transparency layers (thanks to Korneliusz Jarzębski for reporting this problem).
+
+5.9.057 (2011-02-24)
+ - A problem with image caching system was fixed (thanks to Korneliusz Jarzębski for reporting this problem).
+
+5.9.056 (2011-02-22)
+ - A bug on fixHTMLCode() method was fixed.
+ - Automatic line break for HTML was fixed.
+
+5.9.055 (2011-02-17)
+ - Another bug related to HTML table page break was fixed.
+
+5.9.054 (2011-02-16)
+ - A bug related to HTML table page break was fixed.
+
+5.9.053 (2011-02-16)
+ - Support for HTMl attribute display="none" was added.
+
+5.9.052 (2011-02-15)
+ - A bug related to HTML automatic newlines was fixed.
+
+5.9.051 (2011-02-12)
+ - "Commas at beginning of new lines" problem was fixed.
+
+5.9.050 (2011-02-11)
+ - Bug #3177606 "SVG Bar chart error" was fixed.
+
+5.9.049 (2011-02-03)
+ - Bug #3170777 "TCPDF creates a new page after a single line in writeHTML" was fixed.
+
+5.9.048 (2011-02-02)
+ - No changes. Just released to override previous release that was not uploaded correctly.
+
+5.9.047 (2011-01-28)
+ - Bug #3167115 "PDF error in <table> (example 48)" was fixed (was introduced in 5.8.046).
+
+5.9.046 (2011-01-18)
+ - PDF view/print layers are now automatically turned off if not used (see setVisibility() method).
+
+5.9.045 (2011-01-17)
+ - HTML list support were improved.
+
+5.9.044 (2011-01-15)
+ - Bug #3158422 "writeHTMLCell Loop" was fixed.
+ - Some HTML image alignment problems were fixed.
+
+5.9.043 (2011-01-14)
+ - Bug #3158178 "PHP Notice" was fixed.
+ - Bug #3158193 "Endless loop in writeHTML" was fixed.
+ - Bug #3157764 "SVG Pie chart incorrectly rendered2".
+
+5.9.042 (2011-01-14)
+ - Some problems of the PHP4 version were fixed.
+
+5.9.041 (2011-01-13)
+ - A problem with SVG elliptical arc path was fixed (ref. bug #3156574).
+ - A problem related to font weight on HTML table headers was fixed.
+
+5.9.040 (2011-01-12)
+ - A bug related to empty pages after table was fixed.
+
+5.9.039 (2011-01-12)
+ - Bug item #3155759 "openssl_random_pseudo_bytes() slow under Windows" was fixed.
+
+5.9.038 (2011-01-11)
+ - Minor bugs were fixed.
+
+5.9.037 (2011-01-09)
+ - An alignment problem for HTML texts was fixed.
+
+5.9.036 (2011-01-07)
+ - A bug related to HTML tables on header was fixed.
+
+5.9.035 (2011-01-03)
+ - A problem related to HTML table border alignment was fixed.
+ - Bug #2996366 "FastCGI and Header Problems" was fixed.
+
+5.9.034 (2010-12-19)
+ - DejaVu and GNU Free fonts were updated.
+
+5.9.033 (2010-12-18)
+ - Source code documetnation was improved.
+
+5.9.032 (2010-12-18)
+ - Default font stretching and spacing values are now inherited by HTML methods.
+
+5.9.031 (2010-12-16)
+ - Source code documentation errors were fixed.
+
+5.9.030 (2010-12-16)
+ - Several source code documentation errors were fixed.
+ - Source code style was changed for Doxygen.
+ - Source code documentation was moved online to http://www.tcpdf.org
+
+5.9.029 (2010-12-04)
+ - The $fitbox parameter on Image() method was extended to specify image alignment inside the box (check the example n. 9).
+
+5.9.028 (2010-12-03)
+ - Font utils makefont.php and makeallttffonts.php were updated.
+
+5.9.027 (2010-12-01)
+ - Spot Colors are now better integrated with HTML mode.
+ - Method SetDocInfoUnicode() was added to turn on/off Unicode mode for document information dictionary (meta tags) - check the example n. 19.
+
+5.9.026 (2010-12-01)
+ - A problem with mixed text directions on HTML was fixed.
+
+5.9.025 (2010-12-01)
+ - The AddSpotColor() now automatically fills the spotcolor array (defined on spotcolors.php file).
+
+5.9.024 (2010-11-30)
+ - Bug item #3123612 "SVG not use gradientTransform in percentage mode" was fixed.
+
+5.9.023 (2010-11-25)
+ - A potential bug on SVG transcoder was fixed.
+
+5.9.022 (2010-11-21)
+ - Method ImageEPS includes support for EPS/AI Spot colors.
+ - Method ImageEPS includes a new parameter $fixoutvals to remove values outside the bounding box.
+
+5.9.021 (2010-11-20)
+ - Support for custom bullet points images was added (check the example n.6)
+ - Examples n. 6 and 61 were update (check the comments inside).
+
+5.9.020 (2010-11-19)
+ - A problem related to additional page when using multicolumn mode was fixed.
+
+5.9.019 (2010-11-19)
+ - An SVG bug was fixed.
+ - ImageSVG() and ImageEPS() methods now accepts image data streams (put the string on the $file parameter preceded by '@' character).
+ - Option 'E' was added to the $dest parameter of Output() method to return the document as base64 mime multi-part email attachment (RFC 2045).
+
+5.9.018 (2010-11-19)
+ - An SVG bug was fixed.
+
+5.9.017 (2010-11-16)
+ - Tagline color was set to transparent.
+ - The method fixHTMLCode() was added to automatically clean up HTML code (requires HTML Tidy).
+
+5.9.016 (2010-11-16)
+ - Bug item #3109705 "list item page break hanging bullet" was fixed.
+
+5.9.015 (2010-11-16)
+ - Bug item affecting QRCode was fixed.
+ - Some bugs affecting HTML lists were 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 (kerning) 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.
+ - Example n. 57 was updated.
+
+// -------------------------------------------------------------------
+
+5.8.034 (2010-09-27)
+ - 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().
+ - HTML alignments were improved.
+
+------------------------------------------------------------
+
+5.7.003 (2010-08-08)
+ - Bug #3041263 "php source ending is bad" was fixed (all PHP files were updated, including fonts).
+
+5.7.002 (2010-08-06)
+ - Methods copyPage(), movePage() and deletePage() were changed to account for internal markings.
+
+5.7.001 (2010-08-05)
+ - Bug #3040105 "Broken PDF when using TOC (example 45)" was fixed.
+
+5.7.000 (2010-08-03)
+ - CSS borders are now supported for HTML tables and other block tags (see example n. 61);
+ - Cell borders were improved (see example n. 57);
+ - Minor bugs were fixed.
+
+------------------------------------------------------------
+
+5.6.000 (2010-07-31)
+ - A bug with object IDs was fixes.
+ - Performances were improved.
+
+------------------------------------------------------------
+
+5.5.015 (2010-07-29)
+ - Automatic fix for unclosed self-closing tag.
+ - Support for deprecated 's' and 'strike' tags was added.
+ - Empty list items problem was fixed.
+
+5.5.014 (2010-07-15)
+ - Support for external images was improved.
+
+5.5.013 (2010-07-14)
+ - Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong).
+
+5.5.012 (2010-07-14)
+ - Bug #3029310 "Font baseline inconsistencies with line-height and font-size" was fixed.
+ - Bug #3029338 "FI and FO output destination filename bug" was fixed.
+
+5.5.011 (2010-07-09)
+ - Support for multiple CSS classes was added.
+ - The method getColumn() was added to return the current column number.
+ - Some regular Expressions were fixed to be more compatible with UTF-8.
+
+5.5.010 (2010-07-06)
+ - Bug item #3025772 "Borders in all image functions are still flawed" was fixed.
+
+5.5.009 (2010-07-05)
+ - A problem related to last page footer was fixed.
+ - Image alignments and fit-on-page features were improved.
+
+5.5.008 (2010-07-02)
+ - A problem on table header alignment in booklet mode was fixed.
+ - Default graphic vars are now applied for setHeader();
+
+5.5.007 (2010-07-02)
+ - Attribute "readonly" was added to input and textarea form fields.
+ - Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5).
+ - Text-Fit feature was added on MultiCell() method on