diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 211b1ac..2c5ff2e 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.106 (2011-08-04) + - This version includes transparency groups: check the new parameter on printTemplate() method and example 62. + 5.9.105 (2011-08-04) - Bug item #3386153 "Check Box not ticked when set to true" was fixed. diff --git a/README.TXT b/README.TXT index 720460a..9bbf2eb 100755 --- a/README.TXT +++ b/README.TXT @@ -8,7 +8,7 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.105 +Version: 5.9.106 Release date: 2011-08-04 Author: Nicola Asuni diff --git a/examples/example_062.php b/examples/example_062.php index f511265..26b7458 100755 --- a/examples/example_062.php +++ b/examples/example_062.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_062.php // Begin : 2010-08-25 -// Last Update : 2010-08-25 +// Last Update : 2011-08-04 // // Description : Example 062 for TCPDF class // XObject Template @@ -75,18 +75,18 @@ $pdf->AddPage(); $pdf->Write(0, 'XObject Templates', '', 0, 'C', 1, 0, false, false, 0); /* - * An XObject Template is a PDF block that is a self-contained - * description of any sequence of graphics objects (including path + * An XObject Template is a PDF block that is a self-contained + * description of any sequence of graphics objects (including path * objects, text objects, and sampled images). - * An XObject Template may be painted multiple times, either on + * An XObject Template may be painted multiple times, either on * several pages or at several locations on the same page and produces - * the same results each time, subject only to the graphics state at + * the same results each time, subject only to the graphics state at * the time it is invoked. */ -// start a new XObject Template -$template_id = $pdf->startTemplate(60, 60); +// start a new XObject Template and set transparency group option +$template_id = $pdf->startTemplate(60, 60, true); // create Template content // ................................................................... @@ -112,18 +112,22 @@ $pdf->SetTextColor(255, 0, 0); $pdf->Cell(60, 60, 'Template', 0, 0, 'C', false, '', 0, false, 'T', 'M'); // ................................................................... - // end the current Template $pdf->endTemplate(); -// print the selected Template various times +// print the selected Template various times using various transparencies + +$pdf->SetAlpha(0.4); $pdf->printTemplate($template_id, 15, 50, 20, 20, '', '', false); +$pdf->SetAlpha(0.6); $pdf->printTemplate($template_id, 27, 62, 40, 40, '', '', false); +$pdf->SetAlpha(0.8); $pdf->printTemplate($template_id, 55, 85, 60, 60, '', '', false); +$pdf->SetAlpha(1); $pdf->printTemplate($template_id, 95, 125, 80, 80, '', '', false); // --------------------------------------------------------- @@ -132,5 +136,5 @@ $pdf->printTemplate($template_id, 95, 125, 80, 80, '', '', false); $pdf->Output('example_062.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ diff --git a/tcpdf.php b/tcpdf.php index 2f08017..c6318dc 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,7 +1,7 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.105 + * @version 5.9.106 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -148,7 +148,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.105 + * @version 5.9.106 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -159,7 +159,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.105'; + private $tcpdf_version = '5.9.106'; // Protected properties @@ -10925,7 +10925,23 @@ class TCPDF { } $out .= ' >>'; } - $out .= ' >>'; + $out .= ' >>'; //end resources + if (isset($data['group']) AND ($data['group'] !== false)) { + // set transparency group + $out .= ' /Group << /Type /Group /S /Transparency'; + if (is_array($data['group'])) { + if (isset($data['group']['CS']) AND !empty($data['group']['CS'])) { + $out .= ' /CS /'.$data['group']['CS']; + } + if (isset($data['group']['I'])) { + $out .= ' /I /'.($data['group']['I']===true?'true':'false'); + } + if (isset($data['group']['K'])) { + $out .= ' /K /'.($data['group']['K']===true?'true':'false'); + } + } + $out .= ' >>'; + } $stream = $this->_getrawstream($stream, $data['n']); $out .= ' /Length '.strlen($stream); $out .= ' >>'; @@ -25143,15 +25159,16 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. * Note: X,Y coordinates will be reset to 0,0. - * @param $w (int) Template width in user units (empty string or zero = page width less margins) - * @param $h (int) Template height in user units (empty string or zero = page height less margins) + * @param $w (int) Template width in user units (empty string or zero = page width less margins). + * @param $h (int) Template height in user units (empty string or zero = page height less margins). + * @param $group (mixed) Set transparency group. Can be a boolean value or an array specifying optional parameters: 'CS' (solour space name), 'I' (boolean flag to indicate isolated group) and 'K' (boolean flag to indicate knockout group). * @return int the XObject Template ID in case of success or false in case of error. * @author Nicola Asuni * @public * @since 5.8.017 (2010-08-24) * @see endTemplate(), printTemplate() */ - public function startTemplate($w=0, $h=0) { + public function startTemplate($w=0, $h=0, $group=false) { if ($this->inxobj) { // we are already inside an XObject template return false; @@ -25198,6 +25215,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $this->rMargin = 0; $this->tMargin = 0; $this->bMargin = 0; + // set group mode + $this->xobjects[$this->xobjid]['group'] = $group; return $this->xobjid; } @@ -25234,7 +25253,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: * @param $h (int) Height in user units (zero = remaining page height) * @param $align (string) Indicates the alignment of the pointer next to template insertion relative to template height. The value can be: * @param $palign (string) Allows to center or align the template on the current line. Possible values are: - * @param $fitonpage (boolean) if true the template is resized to not exceed page dimensions. + * @param $fitonpage (boolean) If true the template is resized to not exceed page dimensions. * @author Nicola Asuni * @public * @since 5.8.017 (2010-08-24)