32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-22 04:45:17 +00:00

6.0.085 (2014-06-19)

- Some example images were replaced.
- A race condition bug was fixed.
- Bug item #938 "Hyphenation-dash extends outside of cell" was fixed.
This commit is contained in:
nicolaasuni 2014-06-20 00:25:52 +01:00
parent 5f4c7a6440
commit 32868f3304
13 changed files with 467 additions and 93 deletions

View File

@ -1,3 +1,8 @@
6.0.085 (2014-06-19)
- Some example images were replaced.
- A race condition bug was fixed.
- Bug item #938 "Hyphenation-dash extends outside of cell" was fixed.
6.0.084 (2014-06-13)
- A bug related to MultiCell fitcell feature was fixed.
- Bug item #931 "Documentation error for setPageFormat()" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 6.0.084
Release date: 2014-06-13
Version: 6.0.085
Release date: 2014-06-19
Author: Nicola Asuni
Copyright (c) 2002-2014:

View File

@ -1,6 +1,6 @@
{
"name": "tecnick.com/tcpdf",
"version": "6.0.084",
"version": "6.0.085",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.",

View File

@ -109,7 +109,7 @@ List example:
<dd>White cold drink</dd>
</dl>
<div style="text-align:center">IMAGES<br />
<img src="images/logo_example.png" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/logo_example.jpg" alt="test alt attribute" width="100" height="100" border="0" />
<img src="images/logo_example.png" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/tcpdf_box.svg" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/logo_example.jpg" alt="test alt attribute" width="100" height="100" border="0" />
</div>';
// output the HTML content

View File

@ -2,7 +2,7 @@
//============================================================+
// File name : example_032.php
// Begin : 2008-06-09
// Last Update : 2013-05-14
// Last Update : 2013-06-19
//
// Description : Example 032 for TCPDF class
// EPS/AI image
@ -71,17 +71,15 @@ $pdf->SetFont('helvetica', '', 12);
$pdf->AddPage();
$pdf->Write(0, 'Example of ImageEPS() method for AI and EPS images');
$html = <<<EOD
Example of ImageEPS() method for AI and EPS images<br />
NOTE: <i>Please use SVG format for a better vector support</i>.
EOD;
$pdf->ImageEps($file='images/tiger.ai', $x=10, $y=50, $w=190, $h=190, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false);
// Print text using writeHTMLCell()
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$pdf->AddPage();
$pdf->ImageEps('images/bug.eps', 0, 25, 0, 240, "http://www.tcpdf.org", true, 'T', 'C');
$pdf->AddPage();
$pdf->ImageEps('images/pelican.ai', 15, 70, 180);
$pdf->ImageEps('images/tcpdf_box.ai', 10, 40, 150, '', 'http://www.tcpdf.org', true, '', '', 0, false);
// ---------------------------------------------------------

View File

@ -75,7 +75,7 @@ $pdf->SetFont('helvetica', 'B', 20);
$pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0);
// create some HTML content
$html = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl (abcdef) abcdefg <b>abcdefghi</b> a ((abc)) abcd <img src="images/logo_example.png" border="0" height="41" width="41" /> <img src="images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc \(abcd\) abcdef abcdefg <b>abcdefghi</b> a abc \\\(abcd\\\) abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>';
$html = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl (abcdef) abcdefg <b>abcdefghi</b> a ((abc)) abcd <img src="images/logo_example.png" border="0" height="41" width="41" /> <img src="images/tcpdf_box.svg" alt="test alt attribute" width="80" height="60" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc \(abcd\) abcdef abcdefg <b>abcdefghi</b> a abc \\\(abcd\\\) abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>';
// set core font
$pdf->SetFont('helvetica', '', 10);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -0,0 +1,214 @@
%!PS-Adobe-3.0 EPSF
%%Creator: Adobe Illustrator
%%BoundingBox: -7 0 487 327
%%HiResBoundingBox: -6.66162 2.44007e-05 486.662 326.648
%AI5_FileFormat 3
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
%%EndSetup
1 XR
%AI5_BeginLayer
1 1 1 1 0 0 -1 49 80 161 Lb
(New Layer) Ln
0.620000 0.580000 0.435000 0.996000 K
[] 0 d
1.402287 w
0 j
0 J
0.263000 0.290000 0.898000 0.263000 k
72.7885 255.643 m
277.08 286.778 L
425.478 260.993 L
408.269 190.301 L
113.504 181.247 L
113.504 181.247 72.9813 241.769 72.7885 255.643 C
b
0.620000 0.580000 0.435000 0.996000 K
1 j
0.094000 0.102000 0.369000 0.016000 k
423.247 259.914 m
240.217 207.097 L
240.635 0.701168 L
397.776 116.053 L
423.247 259.914 L
b
0.620000 0.580000 0.435000 0.996000 K
0.133000 0.141000 0.541000 0.035000 k
72.1745 254.207 m
240.217 207.097 L
240.561 0.783816 L
101.054 87.946 L
72.1745 254.207 L
b
0.047000 0.059000 0.184000 0.004000 k
423.247 259.914 m
308.187 51.1553 L
396.862 116.972 L
423.247 259.914 L
f
0.620000 0.580000 0.435000 0.996000 K
0 j
0.047000 0.059000 0.184000 0.004000 k
479.312 250.415 m
423.613 260.243 L
240.385 206.966 L
314.061 186.394 L
479.312 250.415 L
b
0.620000 0.580000 0.435000 0.996000 K
0.047000 0.059000 0.184000 0.004000 k
69.9121 254.273 m
237.965 207.131 L
163.618 164.537 L
0.687544 234.686 L
69.9121 254.273 L
b
0.620000 0.580000 0.435000 0.996000 K
0.047000 0.059000 0.184000 0.004000 k
242.971 319.299 m
275.613 286.233 L
72.5703 254.295 L
16.555 296.161 L
242.971 319.299 L
b
0.620000 0.580000 0.435000 0.996000 K
0.133000 0.141000 0.541000 0.035000 k
423.496 260.684 m
275.426 286.441 L
307.326 316.69 L
462.053 292.606 L
423.496 260.684 L
b
0.196000 0.227000 0.871000 0.106000 k
75.26 254.037 m
274.806 285.371 L
227.928 211.257 L
163.396 228.836 130.937 238.701 75.26 254.037 C
f
0.620000 0.580000 0.435000 0.996000 K
1 j
0.169000 0.314000 0.424000 0.094000 k
275.528 286.329 m
274.75 216.78 L
275.528 286.329 L
b
0.031000 0.949000 0.745000 0.729000 k
285.929 160.982 m
285.929 160.982 285.078 139.734 285.078 139.734 C
285.078 139.734 275.378 135.096 275.378 135.096 C
275.378 135.096 273.058 57.6061 273.058 57.6061 C
273.058 57.6061 257.133 47.3536 257.133 47.3536 C
257.133 47.3536 258.059 126.816 258.059 126.816 C
258.059 126.816 247.186 121.618 247.186 121.618 C
247.186 121.618 247.186 144.26 247.186 144.26 C
247.186 144.26 285.929 160.982 285.929 160.982 C
F
0.031000 0.949000 0.745000 0.729000 k
320.884 135.342 m
320.884 135.342 307.279 128.129 307.279 128.129 C
307.279 128.129 308.36 144.944 308.36 144.944 C
308.681 149.948 308.724 153.011 308.483 154.097 C
308.268 155.24 307.632 155.567 306.572 155.073 C
305.368 154.512 304.553 153.381 304.135 151.687 C
303.718 149.995 303.36 146.608 303.063 141.565 C
303.063 141.565 300.477 97.6864 300.477 97.6864 C
300.22 93.3298 300.208 90.6032 300.439 89.4791 C
300.668 88.3599 301.318 88.1316 302.385 88.7881 C
303.403 89.4149 304.103 90.4684 304.487 91.9528 C
304.894 93.4524 305.253 96.6211 305.567 101.497 C
305.567 101.497 306.297 112.86 306.297 112.86 C
306.297 112.86 319.718 120.438 319.718 120.438 C
319.718 120.438 319.446 116.964 319.446 116.964 C
318.734 107.862 317.873 101.293 316.856 97.1389 C
315.864 93.0164 314.026 88.8059 311.329 84.474 C
308.636 80.1307 305.421 76.743 301.646 74.2975 C
297.651 71.7096 294.365 70.7251 291.812 71.3887 C
289.213 72.064 287.545 74.2699 286.838 78.0362 C
286.121 81.8925 285.954 88.3297 286.349 97.4441 C
286.349 97.4441 287.575 125.751 287.575 125.751 C
287.89 133.007 288.277 138.586 288.737 142.421 C
289.202 146.323 290.251 150.369 291.883 154.544 C
293.54 158.732 295.716 162.4 298.394 165.529 C
301.078 168.689 304.052 170.959 307.296 172.342 C
311.621 174.188 315.02 174.154 317.521 172.296 C
319.974 170.473 321.427 167.541 321.911 163.514 C
322.39 159.578 322.275 153.119 321.579 144.225 C
321.579 144.225 320.884 135.342 320.884 135.342 C
F
0.031000 0.949000 0.745000 0.729000 k
*u
329.084 179.607 m
329.084 179.607 342.074 185.214 342.074 185.214 C
345.446 186.669 347.94 187.235 349.586 186.932 C
351.233 186.642 352.374 185.695 353.019 184.1 C
353.677 182.527 353.999 180.418 353.991 177.777 C
354.005 175.2 353.703 171.072 353.088 165.429 C
353.088 165.429 352.244 157.683 352.244 157.683 C
351.634 152.084 350.908 147.89 350.063 145.056 C
349.22 142.228 347.957 139.718 346.265 137.514 C
344.583 135.308 342.474 133.487 339.919 132.046 C
339.919 132.046 336.736 130.25 336.736 130.25 C
336.736 130.25 333.512 96.527 333.512 96.527 C
333.512 96.527 321.545 88.8222 321.545 88.8222 C
321.545 88.8222 329.084 179.607 329.084 179.607 C
F
340.42 168.795 m
340.42 168.795 338.184 145.407 338.184 145.407 C
338.526 145.552 338.82 145.69 339.068 145.822 C
340.172 146.404 340.98 147.319 341.498 148.568 C
342.038 149.863 342.473 152.174 342.805 155.518 C
342.805 155.518 343.55 163.014 343.55 163.014 C
343.863 166.167 343.82 168.111 343.416 168.832 C
343.011 169.557 342.015 169.547 340.42 168.795 C
F
*U
0.031000 0.949000 0.745000 0.729000 k
*u
359.204 192.607 m
359.204 192.607 367.556 196.212 367.556 196.212 C
372.753 198.454 376.114 199.414 377.734 199.14 C
379.351 198.877 380.446 197.777 381.03 195.854 C
381.608 193.948 381.815 191.642 381.655 188.934 C
381.502 186.28 380.88 180.934 379.804 172.981 C
379.804 172.981 375.968 144.653 375.968 144.653 C
375.021 137.654 374.236 132.926 373.604 130.399 C
372.993 127.921 372.216 125.786 371.268 123.986 C
370.323 122.215 369.243 120.698 368.023 119.43 C
366.801 118.187 365.012 116.807 362.638 115.279 C
362.638 115.279 349.593 106.88 349.593 106.88 C
349.593 106.88 359.204 192.607 359.204 192.607 C
F
368.395 181.985 m
368.395 181.985 361.644 126.918 361.644 126.918 C
363.113 127.815 364.084 128.947 364.566 130.32 C
365.053 131.727 365.629 135.077 366.301 140.416 C
366.301 140.416 370.368 172.752 370.368 172.752 C
370.86 176.666 371.12 179.163 371.145 180.223 C
371.168 181.285 371.006 181.972 370.654 182.282 C
370.306 182.629 369.555 182.531 368.395 181.985 C
F
*U
0.031000 0.949000 0.745000 0.729000 k
387.58 204.854 m
387.58 204.854 403.348 211.659 403.348 211.659 C
403.348 211.659 400.803 195.062 400.803 195.062 C
400.803 195.062 394.579 192.087 394.579 192.087 C
394.579 192.087 392.296 176.619 392.296 176.619 C
392.296 176.619 397.801 179.482 397.801 179.482 C
397.801 179.482 395.533 164.634 395.533 164.634 C
395.533 164.634 390.075 161.574 390.075 161.574 C
390.075 161.574 385.406 129.937 385.406 129.937 C
385.406 129.937 376.374 124.122 376.374 124.122 C
376.374 124.122 387.58 204.854 387.58 204.854 C
F
LB
%AI5_EndLayer--
%AI5_BeginLayer
1 1 1 1 0 0 -1 49 80 161 Lb
(MasterLayer 1) Ln
LB
%AI5_EndLayer--
%%Trailer
%%EOF

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="600"
height="400"
id="tcpdf_box">
<path
d="M 90.985619,80.446426 346.35007,41.527969 531.84796,73.758171 510.33606,162.12434 141.88004,173.44107 c 0,0 -50.653416,-75.65219 -50.894421,-92.994643 z"
id="path3233"
style="fill:#a0892c;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-miterlimit:4" />
<path
d="M 529.05896,75.10788 300.27124,141.12856 300.79367,399.12354 497.22012,254.93323 529.05896,75.10788 z"
id="path2459"
style="fill:#e9ddaf;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-linejoin:round;stroke-miterlimit:4" />
<path
d="M 90.218147,82.241417 300.27124,141.12855 300.7012,399.02023 126.31743,290.06747 90.218147,82.241417 z"
id="path3231"
style="fill:#decd87;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-linejoin:round;stroke-miterlimit:4" />
<path
d="M 529.05896,75.10788 385.23331,336.05582 496.07782,253.785 529.05896,75.10788 z"
id="path3204"
style="fill:#f4eed7;fill-rule:evenodd" />
<path
d="M 599.14056,86.981453 529.51617,74.695641 300.48178,141.29306 392.57645,167.00775 599.14056,86.981453 z"
id="path3243"
style="fill:#f4eed7;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-miterlimit:4" />
<path
d="M 87.390083,82.159248 297.45667,141.08572 204.52271,194.32928 0.85943,106.64266 87.390083,82.159248 z"
id="path3245"
style="fill:#f4eed7;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-miterlimit:4" />
<path
d="M 303.71381,0.87646 344.51688,42.208691 90.712837,82.130967 20.69376,29.79868 303.71381,0.876461 z"
id="path3247"
style="fill:#f4eed7;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-miterlimit:4" />
<path
d="M 529.36993,74.145378 344.28207,41.9492 384.15726,4.13702 577.56598,34.24292 529.36993,74.145378 z"
id="path3263"
style="fill:#decd87;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-miterlimit:4" />
<path
d="M 94.075058,82.454048 343.50751,43.286419 284.91046,135.92899 C 204.24522,113.95545 163.67139,101.62348 94.075058,82.454049 z"
id="path3206"
style="fill:#c8ab37;fill-rule:evenodd" />
<path
d="m 344.40955,42.08839 -0.97239,86.93644 0.97239,-86.93644 z"
id="path2426"
style="fill:#caa98d;fill-rule:evenodd;stroke:#000000;stroke-width:1.752859;stroke-linejoin:round;stroke-miterlimit:4" />
<path
d="m 357.41141,198.77278 c 0,0 -1.06345,26.55933 -1.06345,26.55933 0,0 -12.12588,5.79739 -12.12588,5.79739 0,0 -2.89969,96.8629 -2.89969,96.8629 0,0 -19.9061,12.81561 -19.9061,12.81561 0,0 1.15698,-99.32809 1.15698,-99.32809 0,0 -13.59121,6.49803 -13.59121,6.49803 0,0 0,-28.30334 0,-28.30334 0,0 48.42935,-20.90183 48.42935,-20.90183"
id="path5441"
style="fill:#550000" />
<path
d="m 401.10504,230.8226 c 0,0 -17.00665,9.0165 -17.00665,9.0165 0,0 1.3512,-21.019 1.3512,-21.019 0.402,-6.2545 0.45517,-10.08344 0.15475,-11.44165 -0.26965,-1.42879 -1.06461,-1.83763 -2.3894,-1.22009 -1.50556,0.70219 -2.52317,2.11514 -3.04563,4.2332 -0.52157,2.11482 -0.96939,6.34812 -1.34085,12.65235 0,0 -3.23221,54.84809 -3.23221,54.84809 -0.32101,5.44577 -0.33578,8.85397 -0.048,10.25909 0.28671,1.39908 1.09888,1.68448 2.43259,0.86377 1.27319,-0.78342 2.14758,-2.10034 2.62838,-3.95581 0.50837,-1.87454 0.95707,-5.83545 1.34897,-11.93002 0,0 0.91309,-14.20398 0.91309,-14.20398 0,0 16.77621,-9.47276 16.77621,-9.47276 0,0 -0.33963,4.34254 -0.33963,4.34254 -0.89019,11.37775 -1.9667,19.58865 -3.23806,24.78162 -1.24018,5.15307 -3.53693,10.4162 -6.90912,15.83102 -3.36563,5.4292 -7.3844,9.66376 -12.10367,12.72073 -4.99368,3.23487 -9.10043,4.46546 -12.29227,3.63599 -3.24878,-0.84418 -5.33295,-3.60156 -6.21771,-8.30939 -0.89523,-4.8204 -1.10458,-12.86691 -0.61096,-24.25988 0,0 1.53271,-35.38347 1.53271,-35.38347 0.3931,-9.07071 0.87778,-16.0441 1.45276,-20.83719 0.58109,-4.87754 1.8923,-9.93605 3.93183,-15.15415 2.07186,-5.235 4.79159,-9.82054 8.13882,-13.73193 3.35501,-3.94881 7.07321,-6.78658 11.12744,-8.51622 5.4072,-2.30643 9.65549,-2.2641 12.78149,0.0581 3.06675,2.27881 4.88321,5.94397 5.48707,10.97809 0.5997,4.91933 0.45568,12.99251 -0.41431,24.11017 0,0 -0.86871,11.10411 -0.86871,11.10411"
id="path5443"
style="fill:#550000" />
<path
d="m 411.35443,175.49126 c 0,0 16.23862,-7.00843 16.23862,-7.00843 4.21411,-1.81866 7.33169,-2.52597 9.38946,-2.14839 2.05817,0.3633 3.48441,1.54648 4.29062,3.53996 0.82251,1.9665 1.22608,4.60317 1.21613,7.90484 0.0169,3.22044 -0.36075,8.38028 -1.12943,15.43508 0,0 -1.05478,9.68189 -1.05478,9.68189 -0.76248,6.99831 -1.66961,12.24153 -2.72592,15.78421 -1.05399,3.53464 -2.6333,6.67149 -4.74774,9.42722 -2.10278,2.75729 -4.73932,5.03327 -7.93247,6.83464 0,0 -3.97955,2.24502 -3.97955,2.24502 0,0 -4.02936,42.15401 -4.02936,42.15401 0,0 -14.95935,9.63092 -14.95935,9.63092 0,0 9.42377,-113.48097 9.42377,-113.48097 m 14.17023,13.51561 c 0,0 -2.79438,29.23405 -2.79438,29.23405 0.42658,-0.18139 0.79483,-0.35402 1.10511,-0.5179 1.37976,-0.72847 2.39001,-1.87172 3.03671,-3.4328 0.67474,-1.61934 1.21869,-4.50798 1.63415,-8.6878 0,0 0.93119,-9.36968 0.93119,-9.36968 0.39178,-3.9412 0.33706,-6.37085 -0.16742,-7.27288 -0.50681,-0.90578 -1.75189,-0.89307 -3.74564,0.0468"
id="path5445"
style="fill:#550000" />
<path
d="m 449.00479,159.24159 c 0,0 10.44077,-4.5061 10.44077,-4.5061 6.49575,-2.80348 10.69668,-4.00293 12.72158,-3.6608 2.0213,0.32964 3.39048,1.7039 4.12034,4.10832 0.72277,2.38149 0.98129,5.26491 0.78176,8.64975 -0.19201,3.31783 -0.96899,9.99964 -2.31472,19.94068 0,0 -4.79395,35.41017 -4.79395,35.41017 -1.18439,8.74899 -2.16592,14.65866 -2.95572,17.8175 -0.76312,3.09777 -1.73532,5.76644 -2.91974,8.01586 -1.18118,2.21374 -2.5317,4.11101 -4.05642,5.69523 -1.52753,1.55346 -3.76374,3.27924 -6.73096,5.18953 0,0 -16.30603,10.49793 -16.30603,10.49793 0,0 12.01309,-107.15807 12.01309,-107.15807 m 11.48944,13.27721 c 0,0 -8.43966,68.83415 -8.43966,68.83415 1.83639,-1.12169 3.05044,-2.53693 3.65325,-4.25322 0.60837,-1.758 1.3288,-5.94594 2.16813,-12.61931 0,0 5.08401,-40.4202 5.08401,-40.4202 0.61536,-4.89276 0.94013,-8.01438 0.9708,-9.3384 0.0297,-1.32778 -0.17337,-2.18634 -0.61277,-2.57413 -0.43551,-0.43419 -1.37487,-0.31191 -2.82376,0.37111"
id="path5447"
style="fill:#550000" />
<path
d="m 484.47485,143.93306 c 0,0 19.70978,-8.50664 19.70978,-8.50664 0,0 -3.18149,20.74545 -3.18149,20.74545 0,0 -7.77993,3.71959 -7.77993,3.71959 0,0 -2.85361,19.33512 -2.85361,19.33512 0,0 6.88156,-3.57958 6.88156,-3.57958 0,0 -2.83499,18.56089 -2.83499,18.56089 0,0 -6.82193,3.82412 -6.82193,3.82412 0,0 -5.83667,39.54715 -5.83667,39.54715 0,0 -11.29004,7.26862 -11.29004,7.26862 0,0 14.00732,-100.91472 14.00732,-100.91472"
id="path5449"
style="fill:#550000" />
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
private static $tcpdf_version = '6.0.084';
private static $tcpdf_version = '6.0.085';
/**
* String alias for total number of pages.

144
tcpdf.php
View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.0.084
// Version : 6.0.085
// Begin : 2002-08-03
// Last Update : 2014-05-29
// Last Update : 2014-06-19
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.0.084
* @version 6.0.085
*/
// TCPDF configuration
@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.084
* @version 6.0.085
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -1288,6 +1288,20 @@ class TCPDF {
*/
protected $empty_signature_appearance = array();
/**
* Boolean flag to enable document timestamping with TSA.
* @protected
* @since 6.0.085 (2014-06-19)
*/
protected $tsa_timestamp = false;
/**
* Timestamping data.
* @protected
* @since 6.0.085 (2014-06-19)
*/
protected $tsa_data = array();
/**
* Regular expression used to find blank characters (required for word-wrapping).
* @protected
@ -1932,8 +1946,13 @@ class TCPDF {
$this->bgcolor = array('R' => 255, 'G' => 255, 'B' => 255);
$this->extgstates = array();
$this->setTextShadow();
// user's rights
// signature
$this->sign = false;
$this->tsa_timestamp = false;
$this->tsa_data = array();
$this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0', 'name' => 'Signature');
$this->empty_signature_appearance = array();
// user's rights
$this->ur['enabled'] = false;
$this->ur['document'] = '/FullSave';
$this->ur['annots'] = '/Create/Delete/Modify/Copy/Import/Export';
@ -1941,8 +1960,6 @@ class TCPDF {
$this->ur['signature'] = '/Modify';
$this->ur['ef'] = '/Create/Delete/Modify/Import';
$this->ur['formex'] = '';
$this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0', 'name' => 'Signature');
$this->empty_signature_appearance = array();
// set default JPEG quality
$this->jpeg_quality = 75;
// initialize some settings
@ -6346,6 +6363,7 @@ class TCPDF {
$i = 0; // character position
$j = 0; // current starting position
$sep = -1; // position of the last blank space
$prevsep = $sep; // previous separator
$shy = false; // true if the last blank is a soft hypen (SHY)
$l = 0; // current string length
$nl = 0; //number of lines
@ -6405,6 +6423,7 @@ class TCPDF {
$j = $i + 1;
$l = 0;
$sep = -1;
$prevsep = $sep;
$shy = false;
// account for margin changes
if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) {
@ -6436,6 +6455,7 @@ class TCPDF {
)
) {
// update last blank space position
$prevsep = $sep;
$sep = $i;
// check if is a SHY
if (($c == 173) OR ($c == 45)) {
@ -6459,7 +6479,10 @@ class TCPDF {
} else {
$l += $this->GetCharWidth($c);
}
if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) ) {
if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) >= $wmax))) {
if (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) {
$sep = $prevsep;
}
// we have reached the end of column
if ($sep == -1) {
// check if the line was already started
@ -7614,6 +7637,8 @@ class TCPDF {
unset($tmparr);
// decode signature
$signature = base64_decode(trim($signature));
// add TSA timestamp to signature
$signature = $this->applyTSA($signature);
// convert signature to hex
$signature = current(unpack('H*', $signature));
$signature = str_pad($signature, $this->signature_max_length, '0');
@ -7771,19 +7796,22 @@ class TCPDF {
}
unset($this->cached_files);
}
$preserve = array(
'internal_encoding',
'state',
'bufferlen',
'buffer',
'diskcache',
'cached_files',
'sign',
'signature_data',
'signature_max_length',
'byterange_string',
'tsa_timestamp',
'tsa_data'
);
foreach (array_keys(get_object_vars($this)) as $val) {
if ($destroyall OR (
($val != 'internal_encoding')
AND ($val != 'state')
AND ($val != 'bufferlen')
AND ($val != 'buffer')
AND ($val != 'diskcache')
AND ($val != 'cached_files')
AND ($val != 'sign')
AND ($val != 'signature_data')
AND ($val != 'signature_max_length')
AND ($val != 'byterange_string')
)) {
if ($destroyall OR !in_array($val, $preserve)) {
if ((!$preserve_objcopy OR ($val != 'objcopy')) AND isset($this->$val)) {
unset($this->$val);
}
@ -7958,7 +7986,9 @@ class TCPDF {
$out = '<<';
$out .= ' /Type /Page';
$out .= ' /Parent 1 0 R';
if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) {
$out .= ' /LastModified '.$this->_datestring(0, $this->doc_modification_timestamp);
}
$out .= ' /Resources 2 0 R';
foreach ($this->page_boxes as $box) {
$out .= ' /'.$box;
@ -9804,7 +9834,9 @@ class TCPDF {
}
$out .= ' /Fields ['.$objrefs.']';
// It's better to turn off this value and set the appearance stream for each annotation (/AP) to avoid conflicts with signature fields.
if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) {
$out .= ' /NeedAppearances false';
}
if ($this->sign AND isset($this->signature_data['cert_type'])) {
if ($this->signature_data['cert_type'] > 0) {
$out .= ' /SigFlags 3';
@ -9827,7 +9859,8 @@ class TCPDF {
//$out .= ' /XFA ';
$out .= ' >>';
// signatures
if ($this->sign AND isset($this->signature_data['cert_type'])) {
if ($this->sign AND isset($this->signature_data['cert_type'])
AND (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A'))) {
if ($this->signature_data['cert_type'] > 0) {
$out .= ' /Perms << /DocMDP '.($this->sig_obj_id + 1).' 0 R >>';
} else {
@ -13370,6 +13403,7 @@ class TCPDF {
$out .= ' /SubFilter /adbe.pkcs7.detached';
$out .= ' '.TCPDF_STATIC::$byterange_string;
$out .= ' /Contents<'.str_repeat('0', $this->signature_max_length).'>';
if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) {
$out .= ' /Reference ['; // array of signature reference dictionaries
$out .= ' << /Type /SigRef';
if ($this->signature_data['cert_type'] > 0) {
@ -13410,6 +13444,7 @@ class TCPDF {
//$out .= ' /DigestValue<********************************>';
$out .= ' >>';
$out .= ' ]'; // end of reference
}
if (isset($this->signature_data['info']['Name']) AND !TCPDF_STATIC::empty_string($this->signature_data['info']['Name'])) {
$out .= ' /Name '.$this->_textstring($this->signature_data['info']['Name'], $sigobjid);
}
@ -13477,11 +13512,12 @@ class TCPDF {
* @param $extracerts (string) specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
* @param $cert_type (int) The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.
* @param $info (array) array of option information: Name, Location, Reason, ContactInfo.
* @param $approval (string) Enable approval signature eg. for PDF incremental update
* @public
* @author Nicola Asuni
* @since 4.6.005 (2009-04-24)
*/
public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array()) {
public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array(), $approval='') {
// to create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
// to export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
// to convert pfx certificate to pem: openssl
@ -13503,6 +13539,7 @@ class TCPDF {
$this->signature_data['extracerts'] = $extracerts;
$this->signature_data['cert_type'] = $cert_type;
$this->signature_data['info'] = $info;
$this->signature_data['approval'] = $approval;
}
/**
@ -13571,6 +13608,54 @@ class TCPDF {
return $sigapp;
}
/**
* Enable document timestamping (requires the OpenSSL Library).
* The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded.
* Use with digital signature only!
* @param $tsa_host (string) Time Stamping Authority (TSA) server (prefixed with 'https://')
* @param $tsa_username (string) Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional)
* @param $tsa_password (string) Specifies the password for TSA authorization (optional)
* @param $tsa_cert (string) Specifies the location of TSA certificate for authorization (optional for cURL)
* @public
* @author Richard Stockinger
* @since 6.0.085 (2014-06-16)
*/
public function setTimeStamp($tsa_host='', $tsa_username='', $tsa_password='', $tsa_cert='') {
$this->tsa_data = array();
if (!function_exists('curl_init')) {
$this->Error('Please enable cURL PHP extension!');
}
if (strlen($tsa_host) == 0) {
$this->Error('Please specify the host of Time Stamping Authority (TSA)!');
}
$this->tsa_data['tsa_host'] = $tsa_host;
if (is_file($tsa_username)) {
$this->tsa_data['tsa_auth'] = $tsa_username;
} else {
$this->tsa_data['tsa_username'] = $tsa_username;
}
$this->tsa_data['tsa_password'] = $tsa_password;
$this->tsa_data['tsa_cert'] = $tsa_cert;
$this->tsa_timestamp = true;
}
/**
* NOT YET IMPLEMENTED
* Request TSA for a timestamp
* @param $signature (string) Digital signature as binary string
* @return (string) Timestamped digital signature
* @protected
* @author Richard Stockinger
* @since 6.0.085 (2014-06-16)
*/
protected function applyTSA($signature) {
if (!$this->tsa_timestamp) {
return $signature;
}
//@TODO: implement this feature
return $signature;
}
/**
* Create a new page group.
* NOTE: call this function before calling AddPage()
@ -17724,22 +17809,25 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$spacew = ($spacewidth * $ns);
}
$offset = $strpiece[2][1] + strlen($strpiece[2][0]);
$epsposend = strpos($pmid, $this->epsmarker.'Q', $offset);
if ($epsposend !== null) {
$epsposend += strlen($this->epsmarker.'Q');
$epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset);
$epsposend = strpos($pmid, $this->epsmarker.'Q', $offset) + strlen($this->epsmarker.'Q');
if ((($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend))
OR (($epsposbeg === false) AND ($epsposend > 0) AND ($offset < $epsposend))) {
if ($epsposbeg === null) {
$epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6));
$prev_epsposbeg = $epsposbeg;
}
if (($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend)) {
// shift EPS images
$trx = sprintf('1 0 0 1 %F 0 cm', $spacew);
$epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6));
$pmid_b = substr($pmid, 0, $epsposbeg);
$pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg));
$pmid_e = substr($pmid, $epsposend);
$pmid = $pmid_b."\nq\n".$trx."\n".$pmid_m."\nQ\n".$pmid_e;
$offset = $epsposend;
continue;
}
$prev_epsposbeg = $epsposbeg;
}
$currentxpos = 0;
// shift blocks of code
switch ($strpiece[2][0]) {