From 93cd554f3fae8b3923375854b8e99866c63625df Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 4 Oct 2011 18:37:28 +0200 Subject: [PATCH] 5.9.127 --- CHANGELOG.TXT | 3 +++ README.TXT | 4 ++-- tcpdf.php | 24 ++++++++++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index a4e0941..2137f07 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.127 (2011-10-04) + - Readonly mode option was activated for radiobuttons. + 5.9.126 (2011-10-03) - Bug item #3417989 "Graphics State operator in form XObject fails to render" was fixed. - Xobjects problems with transparency, gradients and spot colors were fixed. diff --git a/README.TXT b/README.TXT index f2edde8..c1279bc 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.126 -Release date: 2011-10-03 +Version: 5.9.127 +Release date: 2011-10-04 Author: Nicola Asuni Copyright (c) 2002-2011: diff --git a/tcpdf.php b/tcpdf.php index 6566404..59cae44 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.126 + * @version 5.9.127 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -149,7 +149,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.126 + * @version 5.9.127 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -160,7 +160,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.126'; + private $tcpdf_version = '5.9.127'; // Protected properties @@ -9020,13 +9020,19 @@ class TCPDF { $annots .= ' /Type /Annot'; $annots .= ' /Subtype /Widget'; $annots .= ' /Rect [0 0 0 0]'; - $annots .= ' /F 4'; // default print for PDF/A + if ($this->radiobutton_groups[$n][$pl['txt']]['#readonly#']) { + // read only + $annots .= ' /F 68'; + $annots .= ' /Ff 49153'; + } else { + $annots .= ' /F 4'; // default print for PDF/A + $annots .= ' /Ff 49152'; + } $annots .= ' /T '.$this->_datastring($pl['txt'], $radio_button_obj_id); $annots .= ' /FT /Btn'; - $annots .= ' /Ff 49152'; $annots .= ' /Kids ['; foreach ($this->radiobutton_groups[$n][$pl['txt']] as $key => $data) { - if ($key !== 'n') { + if (($key !== 'n') AND ($key != '#readonly#')) { $annots .= ' '.$data['kid'].' 0 R'; if ($data['def'] !== 'Off') { $defval = $data['def']; @@ -16969,6 +16975,8 @@ class TCPDF { } else { $opt['as'] = 'Off'; } + // store flags + $this->radiobutton_groups[$this->page][$name]['#readonly#'] = ($opt['f'] & 64); $this->Annotation($x, $y, $w, $w, $name, $opt, 0); if ($this->rtl) { $this->x -= $w;