diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index f148902..8f8408b 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +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. diff --git a/README.TXT b/README.TXT index d55754d..3f6a8bd 100755 --- a/README.TXT +++ b/README.TXT @@ -8,11 +8,11 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.034 -Release date: 2010-12-19 +Version: 5.9.035 +Release date: 2011-01-03 Author: Nicola Asuni -Copyright (c) 2002-2010: +Copyright (c) 2002-2011: Nicola Asuni Tecnick.com s.r.l. Via Della Pace, 11 @@ -67,7 +67,7 @@ For Additional Documentation: http: www.tcpdf.org License - Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. + Copyright (C) 2002-2011 Nicola Asuni - Tecnick.com S.r.l. TCPDF is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/examples/example_055.php b/examples/example_055.php index c00deb2..e18462a 100644 --- a/examples/example_055.php +++ b/examples/example_055.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_055.php // Begin : 2009-10-21 -// Last Update : 2010-08-08 +// Last Update : 2010-12-27 // // Description : Example 055 for TCPDF class // Display all characters available on core fonts. @@ -67,38 +67,44 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 10); +$pdf->SetFont('helvetica', '', 14); -// add a page -$pdf->AddPage(); - -// array of core font names +// array of font names $core_fonts = array('courier', 'helvetica', 'times', 'symbol', 'zapfdingbats'); -$html = '

Core Fonts Dump

'; +// set fill color +$pdf->SetFillColor(221,238,255); // create one HTML table for each core font foreach($core_fonts as $font) { - // create HTML content - $html .= ''; - $html .= ''; + // add a page + $pdf->AddPage(); + + // Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') + + // set font for title + $pdf->SetFont('helvetica', 'B', 16); + + // print font name + $pdf->Cell(0, 10, 'FONT: '.$font, 1, 1, 'C', true, '', 0, false, 'T', 'M'); + + // set font for chars + $pdf->SetFont($font, '', 16); + // print each character for ($i = 0; $i < 256; ++$i) { if (($i > 0) AND (($i % 16) == 0)) { - $html .= ''; + $pdf->Ln(); } - $chr = $pdf->unichr($i); - // replace special characters - $trans = array('<' => '<', '>' => '>'); - $chr = strtr($chr, $trans); - $html .= ''; + $pdf->Cell(11.25, 11.25, $pdf->unichr($i), 1, 0, 'C', false, '', 0, false, 'T', 'M'); } - $html .= '
'.strtoupper($font).'
'.$chr.'

 
'; + + $pdf->Ln(20); + + // print a pangram + $pdf->Cell(0, 0, 'The quick brown fox jumps over the lazy dog', 0, 1, 'C', false, '', 0, false, 'T', 'M'); } -// output the HTML content -$pdf->writeHTML($html, true, false, true, false, ''); - // --------------------------------------------------------- //Close and output PDF document diff --git a/tcpdf.php b/tcpdf.php index cd42b20..2c05f00 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.034 + * @version 5.9.035 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -146,7 +146,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.034 + * @version 5.9.035 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -157,7 +157,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.034'; + private $tcpdf_version = '5.9.035'; // Protected properties @@ -4208,6 +4208,11 @@ class TCPDF { if (!isset($this->theadMargins['top'])) { $this->theadMargins['top'] = $this->tMargin; } + // store end of header position + if (!isset($this->columns[0]['th'])) { + $this->columns[0]['th'] = array(); + } + $this->columns[0]['th']['\''.$this->page.'\''] = $this->y; $this->tMargin = $this->y; $this->pagedim[$this->page]['tm'] = $this->tMargin; $this->lasth = 0; @@ -8085,10 +8090,14 @@ class TCPDF { header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // force download dialog - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream', false); - header('Content-Type: application/download', false); - header('Content-Type: application/pdf', false); + if (strpos(php_sapi_name(), 'cgi') === false) { + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream', false); + header('Content-Type: application/download', false); + header('Content-Type: application/pdf', false); + } else { + header('Content-Type: application/pdf'); + } // use the Content-Disposition header to supply a recommended filename header('Content-Disposition: attachment; filename="'.basename($name).'";'); header('Content-Transfer-Encoding: binary'); @@ -8135,10 +8144,14 @@ class TCPDF { header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // force download dialog - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream', false); - header('Content-Type: application/download', false); - header('Content-Type: application/pdf', false); + if (strpos(php_sapi_name(), 'cgi') === false) { + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream', false); + header('Content-Type: application/download', false); + header('Content-Type: application/pdf', false); + } else { + header('Content-Type: application/pdf'); + } // use the Content-Disposition header to supply a recommended filename header('Content-Disposition: attachment; filename="'.basename($name).'";'); header('Content-Transfer-Encoding: binary');