6.0.034 (2013-09-24)

- Bug #839 "Error in xref parsing in mixed newline chars" was fixed.
This commit is contained in:
nicolaasuni 2013-09-24 23:52:36 +01:00
parent 10c933f3b8
commit f66b3e1ce7
6 changed files with 27 additions and 21 deletions

View File

@ -1,3 +1,6 @@
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.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 6.0.033
Release date: 2013-09-23
Version: 6.0.034
Release date: 2013-09-24
Author: Nicola Asuni
Copyright (c) 2002-2013:

View File

@ -1,6 +1,6 @@
{
"name": "tecnick.com/tcpdf",
"version": "6.0.033",
"version": "6.0.034",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.",

View File

@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
private static $tcpdf_version = '6.0.033';
private static $tcpdf_version = '6.0.034';
/**
* String alias for total number of pages.

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.033
// Version : 6.0.034
// Begin : 2002-08-03
// Last Update : 2013-09-23
// Last Update : 2013-09-24
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.033
* @version 6.0.034
*/
// TCPDF configuration
@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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.<br>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 6.0.033
* @version 6.0.034
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf_parser.php
// Version : 1.0.008
// Version : 1.0.009
// Begin : 2011-05-23
// Last Update : 2013-09-18
// Last Update : 2013-09-24
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
// -------------------------------------------------------------------
@ -37,7 +37,7 @@
* This is a PHP class for parsing PDF documents.<br>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.008
* @version 1.0.009
*/
// include class for decoding filters
@ -48,7 +48,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
* This is a PHP class for parsing PDF documents.<br>
* @package com.tecnick.tcpdf
* @brief This is a PHP class for parsing PDF documents..
* @version 1.0.005
* @version 1.0.009
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF_PARSER {
@ -188,20 +188,25 @@ class TCPDF_PARSER {
/**
* Decode the Cross-Reference section
* @param $startxref (int) Offset at which the xref section starts.
* @param $startxref (int) Offset at which the xref section starts (position of the 'xref' keyword).
* @param $xref (array) Previous xref array (if any).
* @return Array containing xref and trailer data.
* @protected
* @since 1.0.000 (2011-06-20)
*/
protected function decodeXref($startxref, $xref=array()) {
// extract xref data (object indexes and offsets)
$xoffset = $startxref + 5;
$startxref += 4; // 4 is the lenght of the word 'xref'
// skip initial white space chars: \x00 null (NUL), \x09 horizontal tab (HT), \x0A line feed (LF), \x0C form feed (FF), \x0D carriage return (CR), \x20 space (SP)
$offset = $startxref + strspn($this->pdfdata, "\x00\x09\x0a\x0c\x0d\x20", $startxref);
// initialize object number
$obj_num = 0;
$offset = $xoffset;
while (preg_match('/^([0-9]+)[\s]([0-9]+)[\s]?([nf]?)/im', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
$offset = (strlen($matches[0][0]) + $matches[0][1]);
// search for cross-reference entries or subsection
while (preg_match('/([0-9]+)[\x20]([0-9]+)[\x20]?([nf]?)(\r\n|[\x20]?[\r\n])/', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
if ($matches[0][1] != $offset) {
// we are on another section
break;
}
$offset += strlen($matches[0][0]);
if ($matches[3][0] == 'n') {
// create unique object index: [object number]_[generation number]
$index = $obj_num.'_'.intval($matches[2][0]);
@ -211,17 +216,15 @@ class TCPDF_PARSER {
$xref['xref'][$index] = intval($matches[1][0]);
}
++$obj_num;
$offset += 2;
} elseif ($matches[3][0] == 'f') {
++$obj_num;
$offset += 2;
} else {
// object number (index)
$obj_num = intval($matches[1][0]);
}
}
// get trailer data
if (preg_match('/trailer[\s]*<<(.*)>>[\s]*[\r\n]+startxref[\s]*[\r\n]+/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $xoffset) > 0) {
if (preg_match('/trailer[\s]*<<(.*)>>[\s]*[\r\n]+startxref[\s]*[\r\n]+/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
$trailer_data = $matches[1][0];
if (!isset($xref['trailer']) OR empty($xref['trailer'])) {
// get only the last updated version