30
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-06-05 23:30:47 +00:00
This commit is contained in:
Nick 2011-09-13 17:52:00 +02:00
parent 1fb14f22f3
commit 24ff632241
6 changed files with 142 additions and 70 deletions

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : 2dbarcodes.php
// Version : 1.0.009
// Version : 1.0.011
// Begin : 2009-04-07
// Last Update : 2011-06-01
// Last Update : 2011-09-13
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -37,14 +37,14 @@
* PHP class to creates array representations for 2D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @version 1.0.011
*/
/**
* @class TCPDF2DBarcode
* PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).
* @package com.tecnick.tcpdf
* @version 1.0.009
* @version 1.0.011
* @author Nicola Asuni
*/
class TCPDF2DBarcode {
@ -63,7 +63,7 @@ class TCPDF2DBarcode {
* <li>$arrcode['num_cols'] required number of columns</li>
* <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul>
* @param $code (string) code to print
* @param $type (string) type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li></ul>
* @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
*/
public function __construct($code, $type) {
$this->setBarcode($code, $type);
@ -84,7 +84,7 @@ class TCPDF2DBarcode {
* @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent).
* @public
*/
public function getBarcodeSVG($w=2, $h=3, $color='black') {
public function getBarcodeSVG($w=3, $h=3, $color='black') {
// send XML headers
$code = $this->getBarcodeSVGcode($w, $h, $color);
header('Content-Type: application/svg+xml');
@ -134,22 +134,50 @@ class TCPDF2DBarcode {
return $svg;
}
/**
* Return an HTML representation of barcode.
* @param $w (int) Width of a single rectangle element in pixels.
* @param $h (int) Height of a single rectangle element in pixels.
* @param $color (string) Foreground color for bar elements (background is transparent).
* @return string HTML code.
* @public
*/
public function getBarcodeHTML($w=10, $h=10, $color='black') {
// replace table for special characters
$html = '<div style="font-size:0;position:relative;">'."\n";
// print barcode elements
$xstart = 0;
$y = 0;
// for each row
for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) {
$x = $xstart;
// for each column
for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) {
if ($this->barcode_array['bcode'][$r][$c] == 1) {
// draw a single barcode cell
$html .= '<div style="background-color:'.$color.';width:'.$w.'px;height:'.$h.'px;position:absolute;left:'.$x.'px;top:'.$y.'px;">&nbsp;</div>'."\n";
}
$x += $w;
}
$y += $h;
}
$html .= '</div>'."\n";
return $html;
}
/**
* Set the barcode.
* @param $code (string) code to print
* @param $type (string) type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li></ul>
* @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
* @return array
*/
public function setBarcode($code, $type) {
$mode = explode(',', $type);
$qrtype = strtoupper($mode[0]);
switch ($qrtype) {
case 'QRCODE': { // QR-CODE
require_once(dirname(__FILE__).'/qrcode.php');
if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) {
$mode[1] = 'L'; // Ddefault: Low error correction
}
$qrcode = new QRcode($code, strtoupper($mode[1]));
case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022)
require_once(dirname(__FILE__).'/datamatrix.php');
$qrcode = new Datamatrix($code);
$this->barcode_array = $qrcode->getBarcodeArray();
$this->barcode_array['code'] = $code;
break;
@ -185,6 +213,16 @@ class TCPDF2DBarcode {
$this->barcode_array['code'] = $code;
break;
}
case 'QRCODE': { // QR-CODE
require_once(dirname(__FILE__).'/qrcode.php');
if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) {
$mode[1] = 'L'; // Ddefault: Low error correction
}
$qrcode = new QRcode($code, strtoupper($mode[1]));
$this->barcode_array = $qrcode->getBarcodeArray();
$this->barcode_array['code'] = $code;
break;
}
case 'RAW':
case 'RAW2': { // RAW MODE
// remove spaces

View File

@ -1,3 +1,9 @@
5.9.115 (2011-09-13)
- Datamatrix barcode support was added (a new datamatrix.php file was added) - check example n. 50.
- getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode.
- cURL options on Image() method were improved.
- A bug on write2DBarcode() was fixed.
5.9.114 (2011-09-04)
- A bug related to column position was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.114
Release date: 2011-09-04
Version: 5.9.115
Release date: 2011-09-13
Author: Nicola Asuni
Copyright (c) 2002-2011:
@ -36,7 +36,7 @@ Main Features:
* methods to publish some XHTML + CSS code, Javascript and Forms;
* images, graphic (geometric figures) and transformation methods;
* supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http: www.imagemagick.org/www/formats.html)
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;
* JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
* automatic page header and footer management;
* document encryption up to 256 bit and digital signature certifications;

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : barcodes.php
// Version : 1.0.019
// Version : 1.0.020
// Begin : 2008-06-09
// Last Update : 2011-08-17
// Last Update : 2011-09-13
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -37,14 +37,14 @@
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.019
* @version 1.0.020
*/
/**
* @class TCPDFBarcode
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
* @package com.tecnick.tcpdf
* @version 1.0.019
* @version 1.0.020
* @author Nicola Asuni
*/
class TCPDFBarcode {
@ -136,6 +136,33 @@ class TCPDFBarcode {
return $svg;
}
/**
* Return an HTML representation of barcode.
* @param $w (int) Width of a single bar element in pixels.
* @param $h (int) Height of a single bar element in pixels.
* @param $color (string) Foreground color for bar elements (background is transparent).
* @return string HTML code.
* @public
*/
public function getBarcodeHTML($w=2, $h=30, $color='black') {
// replace table for special characters
$html = '<div style="font-size:0;position:relative;">'."\n";
// print bars
$x = 0;
foreach ($this->barcode_array['bcode'] as $k => $v) {
$bw = round(($v['w'] * $w), 3);
$bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3);
if ($v['t']) {
$y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3);
// draw a vertical bar
$html .= '<div style="background-color:'.$color.';width:'.$bw.'px;height:'.$bh.'px;position:absolute;left:'.$x.'px;top:'.$y.'px;">&nbsp;</div>'."\n";
}
$x += $bw;
}
$html .= '</div>'."\n";
return $html;
}
/**
* Set the barcode.
* @param $code (string) code to print

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : example_050.php
// Begin : 2009-04-09
// Last Update : 2010-08-08
// Last Update : 2010-09-13
//
// Description : Example 050 for TCPDF class
// 2D Barcodes
@ -88,14 +88,13 @@ $style = array(
);
// write RAW 2D Barcode
$pdf->SetXY(30, 30);
$code = '111011101110111,010010001000010,010011001110010,010010000010010,010011101110010';
$pdf->write2DBarcode($code, 'RAW', '', '', 30, 20, $style, 'N');
$pdf->SetXY(100, 30);
$code = '111011101110111,010010001000010,010011001110010,010010000010010,010011101110010';
$pdf->write2DBarcode($code, 'RAW', 80, 30, 30, 20, $style, 'N');
// write RAW2 2D Barcode
$code = '[111011101110111][010010001000010][010011001110010][010010000010010][010011101110010]';
$pdf->write2DBarcode($code, 'RAW2', '', '', 30, 20, $style, 'N');
$pdf->write2DBarcode($code, 'RAW2', 80, 60, 30, 20, $style, 'N');
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -111,43 +110,38 @@ $style = array(
);
// QRCODE,L : QR-CODE Low error correction
$pdf->SetXY(30, 60);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,L', '', '', 50, 50, $style, 'N');
$pdf->Text(30, 55, 'QRCODE L');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,L', 20, 30, 50, 50, $style, 'N');
$pdf->Text(20, 25, 'QRCODE L');
// QRCODE,M : QR-CODE Medium error correction
$pdf->SetXY(100, 60);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,M', '', '', 50, 50, $style, 'N');
$pdf->Text(100, 55, 'QRCODE M');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,M', 20, 90, 50, 50, $style, 'N');
$pdf->Text(20, 85, 'QRCODE M');
// QRCODE,Q : QR-CODE Better error correction
$pdf->SetXY(30, 120);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,Q', '', '', 50, 50, $style, 'N');
$pdf->Text(30, 115, 'QRCODE Q');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,Q', 20, 150, 50, 50, $style, 'N');
$pdf->Text(20, 145, 'QRCODE Q');
// QRCODE,H : QR-CODE Best error correction
$pdf->SetXY(100, 120);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', '', '', 50, 50, $style, 'N');
$pdf->Text(100, 115, 'QRCODE H');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 20, 210, 50, 50, $style, 'N');
$pdf->Text(20, 205, 'QRCODE H');
// -------------------------------------------------------------------
// PDF417 (ISO/IEC 15438:2006)
/*
The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
number of comma-separated options:
'PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6'
Possible options are:
a = aspect ratio (width/height);
e = error correction level (0-8);
Macro Control Block options:
t = total number of macro segments;
s = macro segment index (0-99998);
f = file ID;
@ -158,17 +152,23 @@ $pdf->Text(100, 115, 'QRCODE H');
o4 = Addressee (text);
o5 = File Size (numeric);
o6 = Checksum (numeric).
Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional.
To use a comma character ',' on text options, replace it with the character 255: "\xff".
*/
$pdf->SetXY(30, 180);
$pdf->write2DBarcode('www.tcpdf.org', 'PDF417', '', '', 0, 30, $style, 'N');
$pdf->Text(30, 175, 'PDF417 (ISO/IEC 15438:2006)');
$pdf->write2DBarcode('www.tcpdf.org', 'PDF417', 80, 90, 0, 30, $style, 'N');
$pdf->Text(80, 85, 'PDF417 (ISO/IEC 15438:2006)');
// -------------------------------------------------------------------
// DATAMATRIX (ISO/IEC 16022:2006)
$pdf->write2DBarcode('http://www.tcpdf.org', 'DATAMATRIX', 80, 150, 50, 50, $style, 'N');
$pdf->Text(80, 145, 'DATAMATRIX (ISO/IEC 16022:2006)');
// -------------------------------------------------------------------
// new style
$style = array(
'border' => 2,
@ -178,9 +178,8 @@ $style = array(
);
// QRCODE,H : QR-CODE Best error correction
$pdf->SetXY(30, 220);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', '', '', 50, 50, $style, 'N');
$pdf->Text(30, 215, 'QRCODE H - COLORED');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 80, 210, 50, 50, $style, 'N');
$pdf->Text(80, 205, 'QRCODE H - COLORED');
// new style
$style = array(
@ -191,9 +190,8 @@ $style = array(
);
// QRCODE,H : QR-CODE Best error correction
$pdf->SetXY(100, 220);
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', '', '', 50, 50, $style, 'N');
$pdf->Text(100, 215, 'QRCODE H - NO PADDING');
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 140, 210, 50, 50, $style, 'N');
$pdf->Text(140, 205, 'QRCODE H - NO PADDING');
// ---------------------------------------------------------

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.114
// Version : 5.9.115
// Begin : 2002-08-03
// Last Update : 2011-09-04
// Last Update : 2011-09-13
// 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.
// -------------------------------------------------------------------
@ -48,7 +48,7 @@
// * methods to publish some XHTML + CSS code, Javascript and Forms;
// * images, graphic (geometric figures) and transformation methods;
// * supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)
// * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;
// * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;
// * JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
// * automatic page header and footer management;
// * document encryption up to 256 bit and digital signature certifications;
@ -114,7 +114,7 @@
* <li>methods to publish some XHTML + CSS code, Javascript and Forms;</li>
* <li>images, graphic (geometric figures) and transformation methods;
* <li>supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)</li>
* <li>1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;</li>
* <li>1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;</li>
* <li>JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li>
* <li>automatic page header and footer management;</li>
* <li>document encryption up to 256 bit and digital signature certifications;</li>
@ -136,7 +136,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 5.9.114
* @version 5.9.115
*/
// 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.<br>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.114
* @version 5.9.115
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -159,7 +159,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.114';
private $tcpdf_version = '5.9.115';
// Protected properties
@ -6144,11 +6144,11 @@ class TCPDF {
* @param $y (float) y position in user units
* @param $reseth (boolean) if true reset the last cell height (default true).
* @param $stretch (int) font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible.
* @param $ishtml (boolean) set to true if $txt is HTML content (default = false).
* @param $ishtml (boolean) INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.
* @param $autopadding (boolean) if true, uses internal padding and automatically adjust it to account for line width.
* @param $maxh (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.
* @param $valign (string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:<ul><li>T: TOP</li><li>M: middle</li><li>B: bottom</li></ul>. This feature works only when $ishtml=false.
* @param $fitcell (boolean) if true attempt to fit all the text within the cell by reducing the font size.
* @param $valign (string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:<ul><li>T: TOP</li><li>M: middle</li><li>B: bottom</li></ul>. This feature works only when $ishtml=false and the cell must fit in a single page.
* @param $fitcell (boolean) if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode).
* @return int Return the number of cells or 1 for html mode.
* @public
* @since 1.3
@ -7375,6 +7375,9 @@ class TCPDF {
curl_setopt($cs, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($cs, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($cs, CURLOPT_TIMEOUT, 30);
curl_setopt($cs, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($cs, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($cs, CURLOPT_USERAGENT, 'TCPDF');
$imgdata = curl_exec($cs);
curl_close($cs);
if ($imgdata !== FALSE) {
@ -18168,6 +18171,8 @@ class TCPDF {
} elseif ($style['vpadding'] === 'auto') {
$style['vpadding'] = 4;
}
$hpad = (2 * $style['hpadding']);
$vpad = (2 * $style['vpadding']);
// cell (module) dimension
if (!isset($style['module_width'])) {
$style['module_width'] = 1; // width of a single module in points
@ -18196,8 +18201,8 @@ class TCPDF {
$maxw = $this->w - $this->rMargin - $x;
}
$maxh = ($this->h - $this->tMargin - $this->bMargin);
$ratioHW = ($rows * $mh) / ($cols * $mw);
$ratioWH = ($cols * $mw) / ($rows * $mh);
$ratioHW = ((($rows * $mh) + $hpad) / (($cols * $mw) + $vpad));
$ratioWH = ((($cols * $mw) + $vpad) / (($rows * $mh) + $hpad));
if (!$distort) {
if (($maxw * $ratioHW) > $maxh) {
$maxw = $maxh * $ratioWH;
@ -18213,8 +18218,6 @@ class TCPDF {
if ($h > $maxh) {
$h = $maxh;
}
$hpad = (2 * $style['hpadding']);
$vpad = (2 * $style['vpadding']);
// set dimensions
if ((($w === '') OR ($w <= 0)) AND (($h === '') OR ($h <= 0))) {
$w = ($cols + $hpad) * ($mw / $this->k);
@ -24664,7 +24667,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$listindent = ($this->listindentlevel * $this->listindent);
// calculate column X position
$colpos = 0;
for ($i=0; $i < $col; ++$i) {
for ($i = 0; $i < $col; ++$i) {
$colpos += ($this->columns[$i]['w'] + $this->columns[$i]['s']);
}
if ($this->rtl) {