32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-26 14:26:28 +00:00
This commit is contained in:
nicolaasuni 2011-06-23 17:59:30 +02:00
parent ac09d91589
commit 5dadde0c61
3 changed files with 37 additions and 10 deletions

View File

@ -1,3 +1,6 @@
5.9.098 (2011-06-23)
- The Named Destination feature was fixed.
5.9.097 (2011-06-23) 5.9.097 (2011-06-23)
- The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd. - 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. - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant.

View File

@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.097 Version: 5.9.098
Release date: 2011-06-23 Release date: 2011-06-23
Author: Nicola Asuni Author: Nicola Asuni

View File

@ -1,7 +1,7 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.097 // Version : 5.9.098
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-06-23 // Last Update : 2011-06-23
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 5.9.097 * @version 5.9.098
*/ */
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. // 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.<br> * 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 * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.097 * @version 5.9.098
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.097'; private $tcpdf_version = '5.9.098';
// Protected properties // Protected properties
@ -1635,6 +1635,13 @@ class TCPDF {
*/ */
protected $dests = array(); protected $dests = array();
/**
* Object ID for Named Destinations
* @protected
* @since 5.9.097 (2011-06-23)
*/
protected $n_dests;
/** /**
* Directory used for the last SVG image. * Directory used for the last SVG image.
* @protected * @protected
@ -10913,6 +10920,7 @@ class TCPDF {
$this->_putspotcolors(); $this->_putspotcolors();
$this->_putshaders(); $this->_putshaders();
$this->_putresourcedict(); $this->_putresourcedict();
$this->_putdests();
$this->_putbookmarks(); $this->_putbookmarks();
$this->_putEmbeddedFiles(); $this->_putEmbeddedFiles();
$this->_putannotsobjs(); $this->_putannotsobjs();
@ -10988,11 +10996,7 @@ class TCPDF {
} }
$out .= ' >>'; $out .= ' >>';
if (!empty($this->dests)) { if (!empty($this->dests)) {
$out .= ' /Dests <<'; $out .= ' /Dests '.$this->n_dests.' 0 R';
foreach($this->dests as $name => $o) {
$out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($o['p'])], ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k)));
}
$out .= ' >>';
} }
$out .= $this->_putviewerpreferences(); $out .= $this->_putviewerpreferences();
if (isset($this->LayoutMode) AND (!$this->empty_string($this->LayoutMode))) { if (isset($this->LayoutMode) AND (!$this->empty_string($this->LayoutMode))) {
@ -14652,6 +14656,26 @@ class TCPDF {
return $this->dests; return $this->dests;
} }
/**
* Create a javascript PDF string.
* @protected
* @author Johannes Güntert, Nicola Asuni
* @since 5.9.098 (2011-06-23)
*/
protected function _putdests() {
if (empty($this->dests)) {
return;
}
$this->n_dests = $this->_newobj();
$out = ' <<';
foreach($this->dests as $name => $o) {
$out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($o['p'])], ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k)));
}
$out .= ' >>';
$out .= "\n".'endobj';
$this->_out($out);
}
/** /**
* Adds a bookmark - alias for Bookmark(). * Adds a bookmark - alias for Bookmark().
* @param $txt (string) Bookmark description. * @param $txt (string) Bookmark description.