From f7d525858a807acb59a21857e78706917ae8dbf7 Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Tue, 22 Jan 2013 17:33:43 +0000 Subject: [PATCH] 5.9.203 (2013-01-22) - Horizontal position of radiobuttons and checkboxes was adjusted. --- CHANGELOG.TXT | 3 +++ README.TXT | 8 ++++---- composer.json | 2 +- tcpdf.php | 25 +++++++++++++------------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 9dd1e60..647962a 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.203 (2013-01-22) + - Horizontal position of radiobuttons and checkboxes was adjusted. + 5.9.202 (2012-12-16) - Vertical space problem after table was fixed. diff --git a/README.TXT b/README.TXT index 979cf53..c2eb497 100755 --- a/README.TXT +++ b/README.TXT @@ -8,11 +8,11 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.202 -Release date: 2012-12-16 +Version: 5.9.203 +Release date: 2013-01-22 Author: Nicola Asuni -Copyright (c) 2002-2012: +Copyright (c) 2002-2013: Nicola Asuni Tecnick.com LTD Manor Coach House, Church Hill @@ -68,7 +68,7 @@ Additional Documentation: http://www.tcpdf.org License - Copyright (C) 2002-2012 Nicola Asuni - Tecnick.com LTD + Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD TCPDF is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/composer.json b/composer.json index c085daf..0281074 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "5.9.202", + "version": "5.9.203", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/tcpdf.php b/tcpdf.php index a6d99cd..6afb779 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.202 + * @version 5.9.203 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -151,7 +151,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.202 + * @version 5.9.203 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -162,7 +162,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.202'; + private $tcpdf_version = '5.9.203'; // Protected properties @@ -17703,7 +17703,7 @@ class TCPDF { /** * Creates a RadioButton field. * @param $name (string) Field name. - * @param $w (int) Width or the radio button. + * @param $w (int) Width of the radio button. * @param $prop (array) Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. * @param $opt (array) Annotation parameters. Possible values are described on official PDF32000_2008 reference. * @param $onvalue (string) Value to be returned if selected. @@ -17771,9 +17771,10 @@ class TCPDF { // build appearance stream $popt['ap'] = array(); $popt['ap']['n'] = array(); + $fx = ((($w - $this->getAbsFontMeasure($tmpfont['cw'][108])) / 2) * $this->k); $fy = (($w - ((($tmpfont['desc']['Ascent'] - $tmpfont['desc']['Descent']) * $this->FontSizePt / 1000) / $this->k)) * $this->k); - $popt['ap']['n'][$onvalue] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(108).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, 0, $fy); - $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(109).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, 0, $fy); + $popt['ap']['n'][$onvalue] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(108).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(109).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); if (!isset($popt['mk'])) { $popt['mk'] = array(); } @@ -18025,10 +18026,10 @@ class TCPDF { // build appearance stream $popt['ap'] = array(); $popt['ap']['n'] = array(); - $fy = ((($tmpfont['desc']['Ascent'] + $tmpfont['desc']['Descent']) * $this->FontSizePt) / (1000 * $this->k)); + $fx = ((($w - $this->getAbsFontMeasure($tmpfont['cw'][110])) / 2) * $this->k); $fy = (($w - ((($tmpfont['desc']['Ascent'] - $tmpfont['desc']['Descent']) * $this->FontSizePt / 1000) / $this->k)) * $this->k); - $popt['ap']['n']['Yes'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(110).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, 0, $fy); - $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(111).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, 0, $fy); + $popt['ap']['n']['Yes'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(110).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(111).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); // merge options $opt = array_merge($popt, $opt); // set remaining annotation data