32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2025-01-25 13:28:24 +00:00
This commit is contained in:
nicolaasuni 2011-01-18 11:05:36 +01:00
parent c1aff22db2
commit eab13851f7
3 changed files with 35 additions and 17 deletions

View File

@ -1,3 +1,6 @@
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) 5.9.045 (2011-01-17)
- HTML list support were improved. - HTML list support were improved.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.045 Version: 5.9.046
Release date: 2011-01-17 Release date: 2011-01-18
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2011: Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.045 // Version : 5.9.046
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-01-17 // Last Update : 2011-01-18
// 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
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS. // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -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.045 * @version 5.9.046
*/ */
// 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.045 * @version 5.9.046
* @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.045'; private $tcpdf_version = '5.9.046';
// Protected properties // Protected properties
@ -1579,6 +1579,13 @@ class TCPDF {
*/ */
protected $spotcolor = array(); protected $spotcolor = array();
/**
* Boolean value true when PDF layers are used.
* @protected
* @since 5.9.046 (2011-01-18)
*/
protected $pdflayers = false;
/** /**
* Directory used for the last SVG image. * Directory used for the last SVG image.
* @protected * @protected
@ -1812,6 +1819,7 @@ class TCPDF {
$this->FillColor = '0 g'; $this->FillColor = '0 g';
$this->TextColor = '0 g'; $this->TextColor = '0 g';
$this->ColorFlag = false; $this->ColorFlag = false;
$this->pdflayers = false;
// encryption values // encryption values
$this->encrypted = false; $this->encrypted = false;
$this->last_enc_key = ''; $this->last_enc_key = '';
@ -10435,7 +10443,9 @@ class TCPDF {
$out .= $this->_getxobjectdict(); $out .= $this->_getxobjectdict();
$out .= ' >>'; $out .= ' >>';
// visibility // visibility
if ($this->pdflayers) {
$out .= ' /Properties <</OC1 '.$this->n_ocg_print.' 0 R /OC2 '.$this->n_ocg_view.' 0 R>>'; $out .= ' /Properties <</OC1 '.$this->n_ocg_print.' 0 R /OC2 '.$this->n_ocg_view.' 0 R>>';
}
// transparency // transparency
$out .= ' /ExtGState <<'; $out .= ' /ExtGState <<';
foreach ($this->extgstates as $k => $extgstate) { foreach ($this->extgstates as $k => $extgstate) {
@ -10583,10 +10593,12 @@ class TCPDF {
$out .= ' /PageMode /UseOutlines'; $out .= ' /PageMode /UseOutlines';
} }
$out .= ' '.$this->_putviewerpreferences(); $out .= ' '.$this->_putviewerpreferences();
if ($this->pdflayers) {
$p = $this->n_ocg_print.' 0 R'; $p = $this->n_ocg_print.' 0 R';
$v = $this->n_ocg_view.' 0 R'; $v = $this->n_ocg_view.' 0 R';
$as = '<< /Event /Print /OCGs ['.$p.' '.$v.'] /Category [/Print] >> << /Event /View /OCGs ['.$p.' '.$v.'] /Category [/View] >>'; $as = '<< /Event /Print /OCGs ['.$p.' '.$v.'] /Category [/Print] >> << /Event /View /OCGs ['.$p.' '.$v.'] /Category [/View] >>';
$out .= ' /OCProperties << /OCGs ['.$p.' '.$v.'] /D << /ON ['.$p.'] /OFF ['.$v.'] /AS ['.$as.'] >> >>'; $out .= ' /OCProperties << /OCGs ['.$p.' '.$v.'] /D << /ON ['.$p.'] /OFF ['.$v.'] /AS ['.$as.'] >> >>';
}
// AcroForm // AcroForm
if (!empty($this->form_obj_id) OR ($this->sign AND isset($this->signature_data['cert_type']))) { if (!empty($this->form_obj_id) OR ($this->sign AND isset($this->signature_data['cert_type']))) {
$out .= ' /AcroForm <<'; $out .= ' /AcroForm <<';
@ -15645,11 +15657,13 @@ class TCPDF {
* @since 3.0.000 (2008-03-27) * @since 3.0.000 (2008-03-27)
*/ */
protected function _putocg() { protected function _putocg() {
if ($this->pdflayers) {
$this->n_ocg_print = $this->_newobj(); $this->n_ocg_print = $this->_newobj();
$this->_out('<< /Type /OCG /Name '.$this->_textstring('print', $this->n_ocg_print).' /Usage << /Print <</PrintState /ON>> /View <</ViewState /OFF>> >> >>'."\n".'endobj'); $this->_out('<< /Type /OCG /Name '.$this->_textstring('print', $this->n_ocg_print).' /Usage << /Print <</PrintState /ON>> /View <</ViewState /OFF>> >> >>'."\n".'endobj');
$this->n_ocg_view = $this->_newobj(); $this->n_ocg_view = $this->_newobj();
$this->_out('<< /Type /OCG /Name '.$this->_textstring('view', $this->n_ocg_view).' /Usage << /Print <</PrintState /OFF>> /View <</ViewState /ON>> >> >>'."\n".'endobj'); $this->_out('<< /Type /OCG /Name '.$this->_textstring('view', $this->n_ocg_view).' /Usage << /Print <</PrintState /OFF>> /View <</ViewState /ON>> >> >>'."\n".'endobj');
} }
}
/** /**
* Set the visibility of the successive elements. * Set the visibility of the successive elements.
@ -15669,15 +15683,16 @@ class TCPDF {
case 'print': { case 'print': {
$this->_out('/OC /OC1 BDC'); $this->_out('/OC /OC1 BDC');
$this->openMarkedContent = true; $this->openMarkedContent = true;
$this->pdflayers = true;
break; break;
} }
case 'screen': { case 'screen': {
$this->_out('/OC /OC2 BDC'); $this->_out('/OC /OC2 BDC');
$this->openMarkedContent = true; $this->openMarkedContent = true;
$this->pdflayers = true;
break; break;
} }
case 'all': { case 'all': {
$this->_out('');
break; break;
} }
default: { default: {