PageRenderTime 65ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 2ms

/htdocs/includes/tcpdf/tcpdf.php

https://bitbucket.org/speedealing/speedealing
PHP | 11722 lines | 7221 code | 447 blank | 4054 comment | 1322 complexity | 9193fd2ec123c86131319bf50134a328 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. //============================================================+
  3. // File name : tcpdf.php
  4. // Version : 5.9.203
  5. // Begin : 2002-08-03
  6. // Last Update : 2013-01-22
  7. // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
  8. // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
  9. // -------------------------------------------------------------------
  10. // Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD
  11. //
  12. // This file is part of TCPDF software library.
  13. //
  14. // TCPDF is free software: you can redistribute it and/or modify it
  15. // under the terms of the GNU Lesser General Public License as
  16. // published by the Free Software Foundation, either version 3 of the
  17. // License, or (at your option) any later version.
  18. //
  19. // TCPDF is distributed in the hope that it will be useful, but
  20. // WITHOUT ANY WARRANTY; without even the implied warranty of
  21. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  22. // See the GNU Lesser General Public License for more details.
  23. //
  24. // You should have received a copy of the License
  25. // along with TCPDF. If not, see
  26. // <http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT>.
  27. //
  28. // See LICENSE.TXT file for more information.
  29. // -------------------------------------------------------------------
  30. //
  31. // Description :
  32. // This is a PHP class for generating PDF documents without requiring external extensions.
  33. //
  34. // NOTE:
  35. // This class was originally derived in 2002 from the Public
  36. // Domain FPDF class by Olivier Plathey (http://www.fpdf.org),
  37. // but now is almost entirely rewritten and contains thousands of
  38. // new lines of code and hundreds new features.
  39. //
  40. // Main features:
  41. // * no external libraries are required for the basic functions;
  42. // * all standard page formats, custom page formats, custom margins and units of measure;
  43. // * UTF-8 Unicode and Right-To-Left languages;
  44. // * TrueTypeUnicode, TrueType, Type1 and CID-0 fonts;
  45. // * font subsetting;
  46. // * methods to publish some XHTML + CSS code, Javascript and Forms;
  47. // * images, graphic (geometric figures) and transformation methods;
  48. // * 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)
  49. // * 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;
  50. // * JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
  51. // * automatic page header and footer management;
  52. // * document encryption up to 256 bit and digital signature certifications;
  53. // * transactions to UNDO commands;
  54. // * PDF annotations, including links, text and file attachments;
  55. // * text rendering modes (fill, stroke and clipping);
  56. // * multiple columns mode;
  57. // * no-write page regions;
  58. // * bookmarks, named destinations and table of content;
  59. // * text hyphenation;
  60. // * text stretching and spacing (tracking);
  61. // * automatic page break, line break and text alignments including justification;
  62. // * automatic page numbering and page groups;
  63. // * move and delete pages;
  64. // * page compression (requires php-zlib extension);
  65. // * XOBject Templates;
  66. // * Layers and object visibility.
  67. // * PDF/A-1b support.
  68. //
  69. // -----------------------------------------------------------
  70. // THANKS TO:
  71. //
  72. // Olivier Plathey (http://www.fpdf.org) for original FPDF.
  73. // Efthimios Mavrogeorgiadis (emavro@yahoo.com) for suggestions on RTL language support.
  74. // Klemen Vodopivec (http://www.fpdf.de/downloads/addons/37/) for Encryption algorithm.
  75. // Warren Sherliker (wsherliker@gmail.com) for better image handling.
  76. // dullus for text Justification.
  77. // Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute.
  78. // Patrick Benny for text stretch suggestion on Cell().
  79. // Johannes G�ntert for JavaScript support.
  80. // Denis Van Nuffelen for Dynamic Form.
  81. // Jacek Czekaj for multibyte justification
  82. // Anthony Ferrara for the reintroduction of legacy image methods.
  83. // Sourceforge user 1707880 (hucste) for line-trough mode.
  84. // Larry Stanbery for page groups.
  85. // Martin Hall-May for transparency.
  86. // Aaron C. Spike for Polycurve method.
  87. // Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support.
  88. // Moritz Wagner and Andreas Wurmser for graphic functions.
  89. // Andrew Whitehead for core fonts support.
  90. // Esteban Jo�l Mar�n for OpenType font conversion.
  91. // Teus Hagen for several suggestions and fixes.
  92. // Yukihiro Nakadaira for CID-0 CJK fonts fixes.
  93. // Kosmas Papachristos for some CSS improvements.
  94. // Marcel Partap for some fixes.
  95. // Won Kyu Park for several suggestions, fixes and patches.
  96. // Dominik Dzienia for QR-code support.
  97. // Laurent Minguet for some suggestions.
  98. // Christian Deligant for some suggestions and fixes.
  99. // Travis Harris for crop mark suggestion.
  100. // Aleksey Kuznetsov for some suggestions and text shadows.
  101. // Jim Hanlon for several suggestions and patches.
  102. // Anyone else that has reported a bug or sent a suggestion.
  103. //============================================================+
  104. /**
  105. * @file
  106. * This is a PHP class for generating PDF documents without requiring external extensions.<br>
  107. * TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
  108. * <h3>TCPDF main features are:</h3>
  109. * <ul>
  110. * <li>no external libraries are required for the basic functions;</li>
  111. * <li>all standard page formats, custom page formats, custom margins and units of measure;</li>
  112. * <li>UTF-8 Unicode and Right-To-Left languages;</li>
  113. * <li>TrueTypeUnicode, TrueType, Type1 and CID-0 fonts;</li>
  114. * <li>font subsetting;</li>
  115. * <li>methods to publish some XHTML + CSS code, Javascript and Forms;</li>
  116. * <li>images, graphic (geometric figures) and transformation methods;
  117. * <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>
  118. * <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>
  119. * <li>JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li>
  120. * <li>automatic page header and footer management;</li>
  121. * <li>document encryption up to 256 bit and digital signature certifications;</li>
  122. * <li>transactions to UNDO commands;</li>
  123. * <li>PDF annotations, including links, text and file attachments;</li>
  124. * <li>text rendering modes (fill, stroke and clipping);</li>
  125. * <li>multiple columns mode;</li>
  126. * <li>no-write page regions;</li>
  127. * <li>bookmarks, named destinations and table of content;</li>
  128. * <li>text hyphenation;</li>
  129. * <li>text stretching and spacing (tracking);</li>
  130. * <li>automatic page break, line break and text alignments including justification;</li>
  131. * <li>automatic page numbering and page groups;</li>
  132. * <li>move and delete pages;</li>
  133. * <li>page compression (requires php-zlib extension);</li>
  134. * <li>XOBject Templates;</li>
  135. * <li>Layers and object visibility;</li>
  136. * <li>PDF/A-1b support.</li>
  137. * </ul>
  138. * Tools to encode your unicode fonts are on fonts/utils directory.</p>
  139. * @package com.tecnick.tcpdf
  140. * @author Nicola Asuni
  141. * @version 5.9.203
  142. */
  143. // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
  144. require_once(dirname(__FILE__) . '/config/tcpdf_config.php');
  145. /**
  146. * @class TCPDF
  147. * PHP class for generating PDF documents without requiring external extensions.
  148. * 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>
  149. * @package com.tecnick.tcpdf
  150. * @brief PHP class for generating PDF documents without requiring external extensions.
  151. * @version 5.9.203
  152. * @author Nicola Asuni - info@tecnick.com
  153. */
  154. class TCPDF {
  155. // private properties
  156. /**
  157. * Current TCPDF version.
  158. * @private
  159. */
  160. private $tcpdf_version = '5.9.203';
  161. // Protected properties
  162. /**
  163. * Current page number.
  164. * @protected
  165. */
  166. protected $page;
  167. /**
  168. * Current object number.
  169. * @protected
  170. */
  171. protected $n;
  172. /**
  173. * Array of object offsets.
  174. * @protected
  175. */
  176. protected $offsets = array();
  177. /**
  178. * Array of object IDs for each page.
  179. * @protected
  180. */
  181. protected $pageobjects = array();
  182. /**
  183. * Buffer holding in-memory PDF.
  184. * @protected
  185. */
  186. protected $buffer;
  187. /**
  188. * Array containing pages.
  189. * @protected
  190. */
  191. protected $pages = array();
  192. /**
  193. * Current document state.
  194. * @protected
  195. */
  196. protected $state;
  197. /**
  198. * Compression flag.
  199. * @protected
  200. */
  201. protected $compress;
  202. /**
  203. * Current page orientation (P = Portrait, L = Landscape).
  204. * @protected
  205. */
  206. protected $CurOrientation;
  207. /**
  208. * Page dimensions.
  209. * @protected
  210. */
  211. protected $pagedim = array();
  212. /**
  213. * Scale factor (number of points in user unit).
  214. * @protected
  215. */
  216. protected $k;
  217. /**
  218. * Width of page format in points.
  219. * @protected
  220. */
  221. protected $fwPt;
  222. /**
  223. * Height of page format in points.
  224. * @protected
  225. */
  226. protected $fhPt;
  227. /**
  228. * Current width of page in points.
  229. * @protected
  230. */
  231. protected $wPt;
  232. /**
  233. * Current height of page in points.
  234. * @protected
  235. */
  236. protected $hPt;
  237. /**
  238. * Current width of page in user unit.
  239. * @protected
  240. */
  241. protected $w;
  242. /**
  243. * Current height of page in user unit.
  244. * @protected
  245. */
  246. protected $h;
  247. /**
  248. * Left margin.
  249. * @protected
  250. */
  251. protected $lMargin;
  252. /**
  253. * Right margin.
  254. * @protected
  255. */
  256. protected $rMargin;
  257. /**
  258. * Cell left margin (used by regions).
  259. * @protected
  260. */
  261. protected $clMargin;
  262. /**
  263. * Cell right margin (used by regions).
  264. * @protected
  265. */
  266. protected $crMargin;
  267. /**
  268. * Top margin.
  269. * @protected
  270. */
  271. protected $tMargin;
  272. /**
  273. * Page break margin.
  274. * @protected
  275. */
  276. protected $bMargin;
  277. /**
  278. * Array of cell internal paddings ('T' => top, 'R' => right, 'B' => bottom, 'L' => left).
  279. * @since 5.9.000 (2010-10-03)
  280. * @protected
  281. */
  282. protected $cell_padding = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0);
  283. /**
  284. * Array of cell margins ('T' => top, 'R' => right, 'B' => bottom, 'L' => left).
  285. * @since 5.9.000 (2010-10-04)
  286. * @protected
  287. */
  288. protected $cell_margin = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0);
  289. /**
  290. * Current horizontal position in user unit for cell positioning.
  291. * @protected
  292. */
  293. protected $x;
  294. /**
  295. * Current vertical position in user unit for cell positioning.
  296. * @protected
  297. */
  298. protected $y;
  299. /**
  300. * Height of last cell printed.
  301. * @protected
  302. */
  303. protected $lasth;
  304. /**
  305. * Line width in user unit.
  306. * @protected
  307. */
  308. protected $LineWidth;
  309. /**
  310. * Array of standard font names.
  311. * @protected
  312. */
  313. protected $CoreFonts;
  314. /**
  315. * Array of used fonts.
  316. * @protected
  317. */
  318. protected $fonts = array();
  319. /**
  320. * Array of font files.
  321. * @protected
  322. */
  323. protected $FontFiles = array();
  324. /**
  325. * Array of encoding differences.
  326. * @protected
  327. */
  328. protected $diffs = array();
  329. /**
  330. * Array of used images.
  331. * @protected
  332. */
  333. protected $images = array();
  334. /**
  335. * Array of cached files.
  336. * @protected
  337. */
  338. protected $cached_files = array();
  339. /**
  340. * Array of Annotations in pages.
  341. * @protected
  342. */
  343. protected $PageAnnots = array();
  344. /**
  345. * Array of internal links.
  346. * @protected
  347. */
  348. protected $links = array();
  349. /**
  350. * Current font family.
  351. * @protected
  352. */
  353. protected $FontFamily;
  354. /**
  355. * Current font style.
  356. * @protected
  357. */
  358. protected $FontStyle;
  359. /**
  360. * Current font ascent (distance between font top and baseline).
  361. * @protected
  362. * @since 2.8.000 (2007-03-29)
  363. */
  364. protected $FontAscent;
  365. /**
  366. * Current font descent (distance between font bottom and baseline).
  367. * @protected
  368. * @since 2.8.000 (2007-03-29)
  369. */
  370. protected $FontDescent;
  371. /**
  372. * Underlining flag.
  373. * @protected
  374. */
  375. protected $underline;
  376. /**
  377. * Overlining flag.
  378. * @protected
  379. */
  380. protected $overline;
  381. /**
  382. * Current font info.
  383. * @protected
  384. */
  385. protected $CurrentFont;
  386. /**
  387. * Current font size in points.
  388. * @protected
  389. */
  390. protected $FontSizePt;
  391. /**
  392. * Current font size in user unit.
  393. * @protected
  394. */
  395. protected $FontSize;
  396. /**
  397. * Commands for drawing color.
  398. * @protected
  399. */
  400. protected $DrawColor;
  401. /**
  402. * Commands for filling color.
  403. * @protected
  404. */
  405. protected $FillColor;
  406. /**
  407. * Commands for text color.
  408. * @protected
  409. */
  410. protected $TextColor;
  411. /**
  412. * Indicates whether fill and text colors are different.
  413. * @protected
  414. */
  415. protected $ColorFlag;
  416. /**
  417. * Automatic page breaking.
  418. * @protected
  419. */
  420. protected $AutoPageBreak;
  421. /**
  422. * Threshold used to trigger page breaks.
  423. * @protected
  424. */
  425. protected $PageBreakTrigger;
  426. /**
  427. * Flag set when processing page header.
  428. * @protected
  429. */
  430. protected $InHeader = false;
  431. /**
  432. * Flag set when processing page footer.
  433. * @protected
  434. */
  435. protected $InFooter = false;
  436. /**
  437. * Zoom display mode.
  438. * @protected
  439. */
  440. protected $ZoomMode;
  441. /**
  442. * Layout display mode.
  443. * @protected
  444. */
  445. protected $LayoutMode;
  446. /**
  447. * If true set the document information dictionary in Unicode.
  448. * @protected
  449. */
  450. protected $docinfounicode = true;
  451. /**
  452. * Document title.
  453. * @protected
  454. */
  455. protected $title = '';
  456. /**
  457. * Document subject.
  458. * @protected
  459. */
  460. protected $subject = '';
  461. /**
  462. * Document author.
  463. * @protected
  464. */
  465. protected $author = '';
  466. /**
  467. * Document keywords.
  468. * @protected
  469. */
  470. protected $keywords = '';
  471. /**
  472. * Document creator.
  473. * @protected
  474. */
  475. protected $creator = '';
  476. /**
  477. * Starting page number.
  478. * @protected
  479. */
  480. protected $starting_page_number = 1;
  481. /**
  482. * String alias for total number of pages.
  483. * @protected
  484. */
  485. protected $alias_tot_pages = '{:ptp:}';
  486. /**
  487. * String alias for page number.
  488. * @protected
  489. */
  490. protected $alias_num_page = '{:pnp:}';
  491. /**
  492. * String alias for total number of pages in a single group.
  493. * @protected
  494. */
  495. protected $alias_group_tot_pages = '{:ptg:}';
  496. /**
  497. * String alias for group page number.
  498. * @protected
  499. */
  500. protected $alias_group_num_page = '{:png:}';
  501. /**
  502. * String alias for right shift compensation used to correctly align page numbers on the right.
  503. * @protected
  504. */
  505. protected $alias_right_shift = '{rsc:';
  506. /**
  507. * The right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image.
  508. * @since 2002-07-31
  509. * @author Nicola Asuni
  510. * @protected
  511. */
  512. protected $img_rb_x;
  513. /**
  514. * The right-bottom corner Y coordinate of last inserted image.
  515. * @since 2002-07-31
  516. * @author Nicola Asuni
  517. * @protected
  518. */
  519. protected $img_rb_y;
  520. /**
  521. * Adjusting factor to convert pixels to user units.
  522. * @since 2004-06-14
  523. * @author Nicola Asuni
  524. * @protected
  525. */
  526. protected $imgscale = 1;
  527. /**
  528. * Boolean flag set to true when the input text is unicode (require unicode fonts).
  529. * @since 2005-01-02
  530. * @author Nicola Asuni
  531. * @protected
  532. */
  533. protected $isunicode = false;
  534. /**
  535. * Object containing unicode data.
  536. * @since 5.9.004 (2010-10-18)
  537. * @author Nicola Asuni
  538. * @protected
  539. */
  540. protected $unicode;
  541. /**
  542. * Object containing font encoding maps.
  543. * @since 5.9.123 (2011-10-01)
  544. * @author Nicola Asuni
  545. * @protected
  546. */
  547. protected $encmaps;
  548. /**
  549. * PDF version.
  550. * @since 1.5.3
  551. * @protected
  552. */
  553. protected $PDFVersion = '1.7';
  554. /**
  555. * ID of the stored default header template (-1 = not set).
  556. * @protected
  557. */
  558. protected $header_xobjid = -1;
  559. /**
  560. * If true reset the Header Xobject template at each page
  561. * @protected
  562. */
  563. protected $header_xobj_autoreset = false;
  564. /**
  565. * Minimum distance between header and top page margin.
  566. * @protected
  567. */
  568. protected $header_margin;
  569. /**
  570. * Minimum distance between footer and bottom page margin.
  571. * @protected
  572. */
  573. protected $footer_margin;
  574. /**
  575. * Original left margin value.
  576. * @protected
  577. * @since 1.53.0.TC013
  578. */
  579. protected $original_lMargin;
  580. /**
  581. * Original right margin value.
  582. * @protected
  583. * @since 1.53.0.TC013
  584. */
  585. protected $original_rMargin;
  586. /**
  587. * Default font used on page header.
  588. * @protected
  589. */
  590. protected $header_font;
  591. /**
  592. * Default font used on page footer.
  593. * @protected
  594. */
  595. protected $footer_font;
  596. /**
  597. * Language templates.
  598. * @protected
  599. */
  600. protected $l;
  601. /**
  602. * Barcode to print on page footer (only if set).
  603. * @protected
  604. */
  605. protected $barcode = false;
  606. /**
  607. * Boolean flag to print/hide page header.
  608. * @protected
  609. */
  610. protected $print_header = true;
  611. /**
  612. * Boolean flag to print/hide page footer.
  613. * @protected
  614. */
  615. protected $print_footer = true;
  616. /**
  617. * Header image logo.
  618. * @protected
  619. */
  620. protected $header_logo = '';
  621. /**
  622. * Width of header image logo in user units.
  623. * @protected
  624. */
  625. protected $header_logo_width = 30;
  626. /**
  627. * Title to be printed on default page header.
  628. * @protected
  629. */
  630. protected $header_title = '';
  631. /**
  632. * String to pring on page header after title.
  633. * @protected
  634. */
  635. protected $header_string = '';
  636. /**
  637. * Color for header text (RGB array).
  638. * @since 5.9.174 (2012-07-25)
  639. * @protected
  640. */
  641. protected $header_text_color = array(0, 0, 0);
  642. /**
  643. * Color for header line (RGB array).
  644. * @since 5.9.174 (2012-07-25)
  645. * @protected
  646. */
  647. protected $header_line_color = array(0, 0, 0);
  648. /**
  649. * Color for footer text (RGB array).
  650. * @since 5.9.174 (2012-07-25)
  651. * @protected
  652. */
  653. protected $footer_text_color = array(0, 0, 0);
  654. /**
  655. * Color for footer line (RGB array).
  656. * @since 5.9.174 (2012-07-25)
  657. * @protected
  658. */
  659. protected $footer_line_color = array(0, 0, 0);
  660. /**
  661. * Text shadow data array.
  662. * @since 5.9.174 (2012-07-25)
  663. * @protected
  664. */
  665. protected $txtshadow = array('enabled' => false, 'depth_w' => 0, 'depth_h' => 0, 'color' => false, 'opacity' => 1, 'blend_mode' => 'Normal');
  666. /**
  667. * Default number of columns for html table.
  668. * @protected
  669. */
  670. protected $default_table_columns = 4;
  671. // variables for html parser
  672. /**
  673. * HTML PARSER: array to store current link and rendering styles.
  674. * @protected
  675. */
  676. protected $HREF = array();
  677. /**
  678. * List of available fonts on filesystem.
  679. * @protected
  680. */
  681. protected $fontlist = array();
  682. /**
  683. * Current foreground color.
  684. * @protected
  685. */
  686. protected $fgcolor;
  687. /**
  688. * HTML PARSER: array of boolean values, true in case of ordered list (OL), false otherwise.
  689. * @protected
  690. */
  691. protected $listordered = array();
  692. /**
  693. * HTML PARSER: array count list items on nested lists.
  694. * @protected
  695. */
  696. protected $listcount = array();
  697. /**
  698. * HTML PARSER: current list nesting level.
  699. * @protected
  700. */
  701. protected $listnum = 0;
  702. /**
  703. * HTML PARSER: indent amount for lists.
  704. * @protected
  705. */
  706. protected $listindent = 0;
  707. /**
  708. * HTML PARSER: current list indententation level.
  709. * @protected
  710. */
  711. protected $listindentlevel = 0;
  712. /**
  713. * Current background color.
  714. * @protected
  715. */
  716. protected $bgcolor;
  717. /**
  718. * Temporary font size in points.
  719. * @protected
  720. */
  721. protected $tempfontsize = 10;
  722. /**
  723. * Spacer string for LI tags.
  724. * @protected
  725. */
  726. protected $lispacer = '';
  727. /**
  728. * Default encoding.
  729. * @protected
  730. * @since 1.53.0.TC010
  731. */
  732. protected $encoding = 'UTF-8';
  733. /**
  734. * PHP internal encoding.
  735. * @protected
  736. * @since 1.53.0.TC016
  737. */
  738. protected $internal_encoding;
  739. /**
  740. * Boolean flag to indicate if the document language is Right-To-Left.
  741. * @protected
  742. * @since 2.0.000
  743. */
  744. protected $rtl = false;
  745. /**
  746. * Boolean flag used to force RTL or LTR string direction.
  747. * @protected
  748. * @since 2.0.000
  749. */
  750. protected $tmprtl = false;
  751. // --- Variables used for document encryption:
  752. /**
  753. * IBoolean flag indicating whether document is protected.
  754. * @protected
  755. * @since 2.0.000 (2008-01-02)
  756. */
  757. protected $encrypted;
  758. /**
  759. * Array containing encryption settings.
  760. * @protected
  761. * @since 5.0.005 (2010-05-11)
  762. */
  763. protected $encryptdata = array();
  764. /**
  765. * Last RC4 key encrypted (cached for optimisation).
  766. * @protected
  767. * @since 2.0.000 (2008-01-02)
  768. */
  769. protected $last_enc_key;
  770. /**
  771. * Last RC4 computed key.
  772. * @protected
  773. * @since 2.0.000 (2008-01-02)
  774. */
  775. protected $last_enc_key_c;
  776. /**
  777. * Encryption padding string.
  778. * @protected
  779. */
  780. protected $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
  781. /**
  782. * File ID (used on document trailer).
  783. * @protected
  784. * @since 5.0.005 (2010-05-12)
  785. */
  786. protected $file_id;
  787. // --- bookmark ---
  788. /**
  789. * Outlines for bookmark.
  790. * @protected
  791. * @since 2.1.002 (2008-02-12)
  792. */
  793. protected $outlines = array();
  794. /**
  795. * Outline root for bookmark.
  796. * @protected
  797. * @since 2.1.002 (2008-02-12)
  798. */
  799. protected $OutlineRoot;
  800. // --- javascript and form ---
  801. /**
  802. * Javascript code.
  803. * @protected
  804. * @since 2.1.002 (2008-02-12)
  805. */
  806. protected $javascript = '';
  807. /**
  808. * Javascript counter.
  809. * @protected
  810. * @since 2.1.002 (2008-02-12)
  811. */
  812. protected $n_js;
  813. /**
  814. * line trough state
  815. * @protected
  816. * @since 2.8.000 (2008-03-19)
  817. */
  818. protected $linethrough;
  819. /**
  820. * Array with additional document-wide usage rights for the document.
  821. * @protected
  822. * @since 5.8.014 (2010-08-23)
  823. */
  824. protected $ur = array();
  825. /**
  826. * DPI (Dot Per Inch) Document Resolution (do not change).
  827. * @protected
  828. * @since 3.0.000 (2008-03-27)
  829. */
  830. protected $dpi = 72;
  831. /**
  832. * Array of page numbers were a new page group was started (the page numbers are the keys of the array).
  833. * @protected
  834. * @since 3.0.000 (2008-03-27)
  835. */
  836. protected $newpagegroup = array();
  837. /**
  838. * Array that contains the number of pages in each page group.
  839. * @protected
  840. * @since 3.0.000 (2008-03-27)
  841. */
  842. protected $pagegroups = array();
  843. /**
  844. * Current page group number.
  845. * @protected
  846. * @since 3.0.000 (2008-03-27)
  847. */
  848. protected $currpagegroup = 0;
  849. /**
  850. * Array of transparency objects and parameters.
  851. * @protected
  852. * @since 3.0.000 (2008-03-27)
  853. */
  854. protected $extgstates;
  855. /**
  856. * Set the default JPEG compression quality (1-100).
  857. * @protected
  858. * @since 3.0.000 (2008-03-27)
  859. */
  860. protected $jpeg_quality;
  861. /**
  862. * Default cell height ratio.
  863. * @protected
  864. * @since 3.0.014 (2008-05-23)
  865. */
  866. protected $cell_height_ratio = K_CELL_HEIGHT_RATIO;
  867. /**
  868. * PDF viewer preferences.
  869. * @protected
  870. * @since 3.1.000 (2008-06-09)
  871. */
  872. protected $viewer_preferences;
  873. /**
  874. * A name object specifying how the document should be displayed when opened.
  875. * @protected
  876. * @since 3.1.000 (2008-06-09)
  877. */
  878. protected $PageMode;
  879. /**
  880. * Array for storing gradient information.
  881. * @protected
  882. * @since 3.1.000 (2008-06-09)
  883. */
  884. protected $gradients = array();
  885. /**
  886. * Array used to store positions inside the pages buffer (keys are the page numbers).
  887. * @protected
  888. * @since 3.2.000 (2008-06-26)
  889. */
  890. protected $intmrk = array();
  891. /**
  892. * Array used to store positions inside the pages buffer (keys are the page numbers).
  893. * @protected
  894. * @since 5.7.000 (2010-08-03)
  895. */
  896. protected $bordermrk = array();
  897. /**
  898. * Array used to store page positions to track empty pages (keys are the page numbers).
  899. * @protected
  900. * @since 5.8.007 (2010-08-18)
  901. */
  902. protected $emptypagemrk = array();
  903. /**
  904. * Array used to store content positions inside the pages buffer (keys are the page numbers).
  905. * @protected
  906. * @since 4.6.021 (2009-07-20)
  907. */
  908. protected $cntmrk = array();
  909. /**
  910. * Array used to store footer positions of each page.
  911. * @protected
  912. * @since 3.2.000 (2008-07-01)
  913. */
  914. protected $footerpos = array();
  915. /**
  916. * Array used to store footer length of each page.
  917. * @protected
  918. * @since 4.0.014 (2008-07-29)
  919. */
  920. protected $footerlen = array();
  921. /**
  922. * Boolean flag to indicate if a new line is created.
  923. * @protected
  924. * @since 3.2.000 (2008-07-01)
  925. */
  926. protected $newline = true;
  927. /**
  928. * End position of the latest inserted line.
  929. * @protected
  930. * @since 3.2.000 (2008-07-01)
  931. */
  932. protected $endlinex = 0;
  933. /**
  934. * PDF string for width value of the last line.
  935. * @protected
  936. * @since 4.0.006 (2008-07-16)
  937. */
  938. protected $linestyleWidth = '';
  939. /**
  940. * PDF string for CAP value of the last line.
  941. * @protected
  942. * @since 4.0.006 (2008-07-16)
  943. */
  944. protected $linestyleCap = '0 J';
  945. /**
  946. * PDF string for join value of the last line.
  947. * @protected
  948. * @since 4.0.006 (2008-07-16)
  949. */
  950. protected $linestyleJoin = '0 j';
  951. /**
  952. * PDF string for dash value of the last line.
  953. * @protected
  954. * @since 4.0.006 (2008-07-16)
  955. */
  956. protected $linestyleDash = '[] 0 d';
  957. /**
  958. * Boolean flag to indicate if marked-content sequence is open.
  959. * @protected
  960. * @since 4.0.013 (2008-07-28)
  961. */
  962. protected $openMarkedContent = false;
  963. /**
  964. * Count the latest inserted vertical spaces on HTML.
  965. * @protected
  966. * @since 4.0.021 (2008-08-24)
  967. */
  968. protected $htmlvspace = 0;
  969. /**
  970. * Array of Spot colors.
  971. * @protected
  972. * @since 4.0.024 (2008-09-12)
  973. */
  974. protected $spot_colors = array();
  975. /**
  976. * Symbol used for HTML unordered list items.
  977. * @protected
  978. * @since 4.0.028 (2008-09-26)
  979. */
  980. protected $lisymbol = '';
  981. /**
  982. * String used to mark the beginning and end of EPS image blocks.
  983. * @protected
  984. * @since 4.1.000 (2008-10-18)
  985. */
  986. protected $epsmarker = 'x#!#EPS#!#x';
  987. /**
  988. * Array of transformation matrix.
  989. * @protected
  990. * @since 4.2.000 (2008-10-29)
  991. */
  992. protected $transfmatrix = array();
  993. /**
  994. * Current key for transformation matrix.
  995. * @protected
  996. * @since 4.8.005 (2009-09-17)
  997. */
  998. protected $transfmatrix_key = 0;
  999. /**
  1000. * Booklet mode for double-sided pages.
  1001. * @protected
  1002. * @since 4.2.000 (2008-10-29)
  1003. */
  1004. protected $booklet = false;
  1005. /**
  1006. * Epsilon value used for float calculations.
  1007. * @protected
  1008. * @since 4.2.000 (2008-10-29)
  1009. */
  1010. protected $feps = 0.005;
  1011. /**
  1012. * Array used for custom vertical spaces for HTML tags.
  1013. * @protected
  1014. * @since 4.2.001 (2008-10-30)
  1015. */
  1016. protected $tagvspaces = array();
  1017. /**
  1018. * HTML PARSER: custom indent amount for lists. Negative value means disabled.
  1019. * @protected
  1020. * @since 4.2.007 (2008-11-12)
  1021. */
  1022. protected $customlistindent = -1;
  1023. /**
  1024. * Boolean flag to indicate if the border of the cell sides that cross the page should be removed.
  1025. * @protected
  1026. * @since 4.2.010 (2008-11-14)
  1027. */
  1028. protected $opencell = true;
  1029. /**
  1030. * Array of files to embedd.
  1031. * @protected
  1032. * @since 4.4.000 (2008-12-07)
  1033. */
  1034. protected $embeddedfiles = array();
  1035. /**
  1036. * Boolean flag to indicate if we are inside a PRE tag.
  1037. * @protected
  1038. * @since 4.4.001 (2008-12-08)
  1039. */
  1040. protected $premode = false;
  1041. /**
  1042. * Array used to store positions of graphics transformation blocks inside the page buffer.
  1043. * keys are the page numbers
  1044. * @protected
  1045. * @since 4.4.002 (2008-12-09)
  1046. */
  1047. protected $transfmrk = array();
  1048. /**
  1049. * Default color for html links.
  1050. * @protected
  1051. * @since 4.4.003 (2008-12-09)
  1052. */
  1053. protected $htmlLinkColorArray = array(0, 0, 255);
  1054. /**
  1055. * Default font style to add to html links.
  1056. * @protected
  1057. * @since 4.4.003 (2008-12-09)
  1058. */
  1059. protected $htmlLinkFontStyle = 'U';
  1060. /**
  1061. * Counts the number of pages.
  1062. * @protected
  1063. * @since 4.5.000 (2008-12-31)
  1064. */
  1065. protected $numpages = 0;
  1066. /**
  1067. * Array containing page lengths in bytes.
  1068. * @protected
  1069. * @since 4.5.000 (2008-12-31)
  1070. */
  1071. protected $pagelen = array();
  1072. /**
  1073. * Counts the number of pages.
  1074. * @protected
  1075. * @since 4.5.000 (2008-12-31)
  1076. */
  1077. protected $numimages = 0;
  1078. /**
  1079. * Store the image keys.
  1080. * @protected
  1081. * @since 4.5.000 (2008-12-31)
  1082. */
  1083. protected $imagekeys = array();
  1084. /**
  1085. * Length of the buffer in bytes.
  1086. * @protected
  1087. * @since 4.5.000 (2008-12-31)
  1088. */
  1089. protected $bufferlen = 0;
  1090. /**
  1091. * If true enables disk caching.
  1092. * @protected
  1093. * @since 4.5.000 (2008-12-31)
  1094. */
  1095. protected $diskcache = false;
  1096. /**
  1097. * Counts the number of fonts.
  1098. * @protected
  1099. * @since 4.5.000 (2009-01-02)
  1100. */
  1101. protected $numfonts = 0;
  1102. /**
  1103. * Store the font keys.
  1104. * @protected
  1105. * @since 4.5.000 (2009-01-02)
  1106. */
  1107. protected $fontkeys = array();
  1108. /**
  1109. * Store the font object IDs.
  1110. * @protected
  1111. * @since 4.8.001 (2009-09-09)
  1112. */
  1113. protected $font_obj_ids = array();
  1114. /**
  1115. * Store the fage status (true when opened, false when closed).
  1116. * @protected
  1117. * @since 4.5.000 (2009-01-02)
  1118. */
  1119. protected $pageopen = array();
  1120. /**
  1121. * Default monospace font.
  1122. * @protected
  1123. * @since 4.5.025 (2009-03-10)
  1124. */
  1125. protected $default_monospaced_font = 'courier';
  1126. /**
  1127. * Cloned copy of the current class object.
  1128. * @protected
  1129. * @since 4.5.029 (2009-03-19)
  1130. */
  1131. protected $objcopy;
  1132. /**
  1133. * Array used to store the lengths of cache files.
  1134. * @protected
  1135. * @since 4.5.029 (2009-03-19)
  1136. */
  1137. protected $cache_file_length = array();
  1138. /**
  1139. * Table header content to be repeated on each new page.
  1140. * @protected
  1141. * @since 4.5.030 (2009-03-20)
  1142. */
  1143. protected $thead = '';
  1144. /**
  1145. * Margins used for table header.
  1146. * @protected
  1147. * @since 4.5.030 (2009-03-20)
  1148. */
  1149. protected $theadMargins = array();
  1150. /**
  1151. * Cache array for UTF8StringToArray() method.
  1152. * @protected
  1153. * @since 4.5.037 (2009-04-07)
  1154. */
  1155. protected $cache_UTF8StringToArray = array();
  1156. /**
  1157. * Maximum size of cache array used for UTF8StringToArray() method.
  1158. * @protected
  1159. * @since 4.5.037 (2009-04-07)
  1160. */
  1161. protected $cache_maxsize_UTF8StringToArray = 8;
  1162. /**
  1163. * Current size of cache array used for UTF8StringToArray() method.
  1164. * @protected
  1165. * @since 4.5.037 (2009-04-07)
  1166. */
  1167. protected $cache_size_UTF8StringToArray = 0;
  1168. /**
  1169. * Boolean flag to enable document digital signature.
  1170. * @protected
  1171. * @since 4.6.005 (2009-04-24)
  1172. */
  1173. protected $sign = false;
  1174. /**
  1175. * Digital signature data.
  1176. * @protected
  1177. * @since 4.6.005 (2009-04-24)
  1178. */
  1179. protected $signature_data = array();
  1180. /**
  1181. * Digital signature max length.
  1182. * @protected
  1183. * @since 4.6.005 (2009-04-24)
  1184. */
  1185. protected $signature_max_length = 11742;
  1186. /**
  1187. * Data for digital signature appearance.
  1188. * @protected
  1189. * @since 5.3.011 (2010-06-16)
  1190. */
  1191. protected $signature_appearance = array('page' => 1, 'rect' => '0 0 0 0');
  1192. /**
  1193. * Array of empty digital signature appearances.
  1194. * @protected
  1195. * @since 5.9.101 (2011-07-06)
  1196. */
  1197. protected $empty_signature_appearance = array();
  1198. /**
  1199. * Regular expression used to find blank characters (required for word-wrapping).
  1200. * @protected
  1201. * @since 4.6.006 (2009-04-28)
  1202. */
  1203. protected $re_spaces = '/[^\S\xa0]/';
  1204. /**
  1205. * Array of $re_spaces parts.
  1206. * @protected
  1207. * @since 5.5.011 (2010-07-09)
  1208. */
  1209. protected $re_space = array('p' => '[^\S\xa0]', 'm' => '');
  1210. /**
  1211. * Digital signature object ID.
  1212. * @protected
  1213. * @since 4.6.022 (2009-06-23)
  1214. */
  1215. protected $sig_obj_id = 0;
  1216. /**
  1217. * ByteRange placemark used during digital signature process.
  1218. * @protected
  1219. * @since 4.6.028 (2009-08-25)
  1220. */
  1221. protected $byterange_string = '/ByteRange[0 ********** ********** **********]';
  1222. /**
  1223. * Placemark used during digital signature process.
  1224. * @protected
  1225. * @since 4.6.028 (2009-08-25)
  1226. */
  1227. protected $sig_annot_ref = '***SIGANNREF*** 0 R';
  1228. /**
  1229. * ID of page objects.
  1230. * @protected
  1231. * @since 4.7.000 (2009-08-29)
  1232. */
  1233. protected $page_obj_id = array();
  1234. /**
  1235. * List of form annotations IDs.
  1236. * @protected
  1237. * @since 4.8.000 (2009-09-07)
  1238. */
  1239. protected $form_obj_id = array();
  1240. /**
  1241. * Deafult Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. Annotation options can be directly specified using the 'aopt' entry.
  1242. * @protected
  1243. * @since 4.8.000 (2009-09-07)
  1244. */
  1245. protected $default_form_prop = array('lineWidth' => 1, 'borderStyle' => 'solid', 'fillColor' => array(255, 255, 255), 'strokeColor' => array(128, 128, 128));
  1246. /**
  1247. * Javascript objects array.
  1248. * @protected
  1249. * @since 4.8.000 (2009-09-07)
  1250. */
  1251. protected $js_objects = array();
  1252. /**
  1253. * Current form action (used during XHTML rendering).
  1254. * @protected
  1255. * @since 4.8.000 (2009-09-07)
  1256. */
  1257. protected $form_action = '';
  1258. /**
  1259. * Current form encryption type (used during XHTML rendering).
  1260. * @protected
  1261. * @since 4.8.000 (2009-09-07)
  1262. */
  1263. protected $form_enctype = 'application/x-www-form-urlencoded';
  1264. /**
  1265. * Current method to submit forms.
  1266. * @protected
  1267. * @since 4.8.000 (2009-09-07)
  1268. */
  1269. protected $form_mode = 'post';
  1270. /**
  1271. * List of fonts used on form fields (fontname => fontkey).
  1272. * @protected
  1273. * @since 4.8.001 (2009-09-09)
  1274. */
  1275. protected $annotation_fonts = array();
  1276. /**
  1277. * List of radio buttons parent objects.
  1278. * @protected
  1279. * @since 4.8.001 (2009-09-09)
  1280. */
  1281. protected $radiobutton_groups = array();
  1282. /**
  1283. * List of radio group objects IDs.
  1284. * @protected
  1285. * @since 4.8.001 (2009-09-09)
  1286. */
  1287. protected $radio_groups = array();
  1288. /**
  1289. * Text indentation value (used for text-indent CSS attribute).
  1290. * @protected
  1291. * @since 4.8.006 (2009-09-23)
  1292. */
  1293. protected $textindent = 0;
  1294. /**
  1295. * Store page number when startTransaction() is called.
  1296. * @protected
  1297. * @since 4.8.006 (2009-09-23)
  1298. */
  1299. protected $start_transaction_page = 0;
  1300. /**
  1301. * Store Y position when startTransaction() is called.
  1302. * @protected
  1303. * @since 4.9.001 (2010-03-28)
  1304. */
  1305. protected $start_transaction_y = 0;
  1306. /**
  1307. * True when we are printing the thead section on a new page.
  1308. * @protected
  1309. * @since 4.8.027 (2010-01-25)
  1310. */
  1311. protected $inthead = false;
  1312. /**
  1313. * Array of column measures (width, space, starting Y position).
  1314. * @protected
  1315. * @since 4.9.001 (2010-03-28)
  1316. */
  1317. protected $columns = array();
  1318. /**
  1319. * Number of colums.
  1320. * @protected
  1321. * @since 4.9.001 (2010-03-28)
  1322. */
  1323. protected $num_columns = 1;
  1324. /**
  1325. * Current column number.
  1326. * @protected
  1327. * @since 4.9.001 (2010-03-28)
  1328. */
  1329. protected $current_column = 0;
  1330. /**
  1331. * Starting page for columns.
  1332. * @protected
  1333. * @since 4.9.001 (2010-03-28)
  1334. */
  1335. protected $column_start_page = 0;
  1336. /**
  1337. * Maximum page and column selected.
  1338. * @protected
  1339. * @since 5.8.000 (2010-08-11)
  1340. */
  1341. protected $maxselcol = array('page' => 0, 'column' => 0);
  1342. /**
  1343. * Array of: X difference between table cell x start and starting page margin, cellspacing, cellpadding.
  1344. * @protected
  1345. * @since 5.8.000 (2010-08-11)
  1346. */
  1347. protected $colxshift = array('x' => 0, 's' => array('H' => 0, 'V' => 0), 'p' => array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0));
  1348. /**
  1349. * Text rendering mode: 0 = Fill text; 1 = Stroke text; 2 = Fill, then stroke text; 3 = Neither fill nor stroke text (invisible); 4 = Fill text and add to path for clipping; 5 = Stroke text and add to path for clipping; 6 = Fill, then stroke text and add to path for clipping; 7 = Add text to path for clipping.
  1350. * @protected
  1351. * @since 4.9.008 (2010-04-03)
  1352. */
  1353. protected $textrendermode = 0;
  1354. /**
  1355. * Text stroke width in doc units.
  1356. * @protected
  1357. * @since 4.9.008 (2010-04-03)
  1358. */
  1359. protected $textstrokewidth = 0;
  1360. /**
  1361. * Current stroke color.
  1362. * @protected
  1363. * @since 4.9.008 (2010-04-03)
  1364. */
  1365. protected $strokecolor;
  1366. /**
  1367. * Default unit of measure for document.
  1368. * @protected
  1369. * @since 5.0.000 (2010-04-22)
  1370. */
  1371. protected $pdfunit = 'mm';
  1372. /**
  1373. * Boolean flag true when we are on TOC (Table Of Content) page.
  1374. * @protected
  1375. */
  1376. protected $tocpage = false;
  1377. /**
  1378. * Boolean flag: if true convert vector images (SVG, EPS) to raster image using GD or ImageMagick library.
  1379. * @protected
  1380. * @since 5.0.000 (2010-04-26)
  1381. */
  1382. protected $rasterize_vector_images = false;
  1383. /**
  1384. * Boolean flag: if true enables font subsetting by default.
  1385. * @protected
  1386. * @since 5.3.002 (2010-06-07)
  1387. */
  1388. protected $font_subsetting = true;
  1389. /**
  1390. * Array of default graphic settings.
  1391. * @protected
  1392. * @since 5.5.008 (2010-07-02)
  1393. */
  1394. protected $default_graphic_vars = array();
  1395. /**
  1396. * Array of XObjects.
  1397. * @protected
  1398. * @since 5.8.014 (2010-08-23)
  1399. */
  1400. protected $xobjects = array();
  1401. /**
  1402. * Boolean value true when we are inside an XObject.
  1403. * @protected
  1404. * @since 5.8.017 (2010-08-24)
  1405. */
  1406. protected $inxobj = false;
  1407. /**
  1408. * Current XObject ID.
  1409. * @protected
  1410. * @since 5.8.017 (2010-08-24)
  1411. */
  1412. protected $xobjid = '';
  1413. /**
  1414. * Percentage of character stretching.
  1415. * @protected
  1416. * @since 5.9.000 (2010-09-29)
  1417. */
  1418. protected $font_stretching = 100;
  1419. /**
  1420. * Increases or decreases the space between characters in a text by the specified amount (tracking).
  1421. * @protected
  1422. * @since 5.9.000 (2010-09-29)
  1423. */
  1424. protected $font_spacing = 0;
  1425. /**
  1426. * Array of no-write regions.
  1427. * ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right)
  1428. * @protected
  1429. * @since 5.9.003 (2010-10-14)
  1430. */
  1431. protected $page_regions = array();
  1432. /**
  1433. * Boolean value true when page region check is active.
  1434. * @protected
  1435. */
  1436. protected $check_page_regions = true;
  1437. /**
  1438. * Array containing HTML color names and values.
  1439. * @protected
  1440. * @since 5.9.004 (2010-10-18)
  1441. */
  1442. protected $webcolor = array();
  1443. /**
  1444. * Array containing spot color names and values.
  1445. * @protected
  1446. * @since 5.9.012 (2010-11-11)
  1447. */
  1448. protected $spotcolor = array();
  1449. /**
  1450. * Array of PDF layers data.
  1451. * @protected
  1452. * @since 5.9.102 (2011-07-13)
  1453. */
  1454. protected $pdflayers = array();
  1455. /**
  1456. * A dictionary of names and corresponding destinations (Dests key on document Catalog).
  1457. * @protected
  1458. * @since 5.9.097 (2011-06-23)
  1459. */
  1460. protected $dests = array();
  1461. /**
  1462. * Object ID for Named Destinations
  1463. * @protected
  1464. * @since 5.9.097 (2011-06-23)
  1465. */
  1466. protected $n_dests;
  1467. /**
  1468. * Directory used for the last SVG image.
  1469. * @protected
  1470. * @since 5.0.000 (2010-05-05)
  1471. */
  1472. protected $svgdir = '';
  1473. /**
  1474. * Deafult unit of measure for SVG.
  1475. * @protected
  1476. * @since 5.0.000 (2010-05-02)
  1477. */
  1478. protected $svgunit = 'px';
  1479. /**
  1480. * Array of SVG gradients.
  1481. * @protected
  1482. * @since 5.0.000 (2010-05-02)
  1483. */
  1484. protected $svggradients = array();
  1485. /**
  1486. * ID of last SVG gradient.
  1487. * @protected
  1488. * @since 5.0.000 (2010-05-02)
  1489. */
  1490. protected $svggradientid = 0;
  1491. /**
  1492. * Boolean value true when in SVG defs group.
  1493. * @protected
  1494. * @since 5.0.000 (2010-05-02)
  1495. */
  1496. protected $svgdefsmode = false;
  1497. /**
  1498. * Array of SVG defs.
  1499. * @protected
  1500. * @since 5.0.000 (2010-05-02)
  1501. */
  1502. protected $svgdefs = array();
  1503. /**
  1504. * Boolean value true when in SVG clipPath tag.
  1505. * @protected
  1506. * @since 5.0.000 (2010-04-26)
  1507. */
  1508. protected $svgclipmode = false;
  1509. /**
  1510. * Array of SVG clipPath commands.
  1511. * @protected
  1512. * @since 5.0.000 (2010-05-02)
  1513. */
  1514. protected $svgclippaths = array();
  1515. /**
  1516. * Array of SVG clipPath tranformation matrix.
  1517. * @protected
  1518. * @since 5.8.022 (2010-08-31)
  1519. */
  1520. protected $svgcliptm = array();
  1521. /**
  1522. * ID of last SVG clipPath.
  1523. * @protected
  1524. * @since 5.0.000 (2010-05-02)
  1525. */
  1526. protected $svgclipid = 0;
  1527. /**
  1528. * SVG text.
  1529. * @protected
  1530. * @since 5.0.000 (2010-05-02)
  1531. */
  1532. protected $svgtext = '';
  1533. /**
  1534. * SVG text properties.
  1535. * @protected
  1536. * @since 5.8.013 (2010-08-23)
  1537. */
  1538. protected $svgtextmode = array();
  1539. /**
  1540. * Array of hinheritable SVG properties.
  1541. * @protected
  1542. * @since 5.0.000 (2010-05-02)
  1543. */
  1544. protected $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode');
  1545. /**
  1546. * Array of SVG properties.
  1547. * @protected
  1548. * @since 5.0.000 (2010-05-02)
  1549. */
  1550. protected $svgstyles = array(array(
  1551. 'alignment-baseline' => 'auto',
  1552. 'baseline-shift' => 'baseline',
  1553. 'clip' => 'auto',
  1554. 'clip-path' => 'none',
  1555. 'clip-rule' => 'nonzero',
  1556. 'color' => 'black',
  1557. 'color-interpolation' => 'sRGB',
  1558. 'color-interpolation-filters' => 'linearRGB',
  1559. 'color-profile' => 'auto',
  1560. 'color-rendering' => 'auto',
  1561. 'cursor' => 'auto',
  1562. 'direction' => 'ltr',
  1563. 'display' => 'inline',
  1564. 'dominant-baseline' => 'auto',
  1565. 'enable-background' => 'accumulate',
  1566. 'fill' => 'black',
  1567. 'fill-opacity' => 1,
  1568. 'fill-rule' => 'nonzero',
  1569. 'filter' => 'none',
  1570. 'flood-color' => 'black',
  1571. 'flood-opacity' => 1,
  1572. 'font' => '',
  1573. 'font-family' => 'helvetica',
  1574. 'font-size' => 'medium',
  1575. 'font-size-adjust' => 'none',
  1576. 'font-stretch' => 'normal',
  1577. 'font-style' => 'normal',
  1578. 'font-variant' => 'normal',
  1579. 'font-weight' => 'normal',
  1580. 'glyph-orientation-horizontal' => '0deg',
  1581. 'glyph-orientation-vertical' => 'auto',
  1582. 'image-rendering' => 'auto',
  1583. 'kerning' => 'auto',
  1584. 'letter-spacing' => 'normal',
  1585. 'lighting-color' => 'white',
  1586. 'marker' => '',
  1587. 'marker-end' => 'none',
  1588. 'marker-mid' => 'none',
  1589. 'marker-start' => 'none',
  1590. 'mask' => 'none',
  1591. 'opacity' => 1,
  1592. 'overflow' => 'auto',
  1593. 'pointer-events' => 'visiblePainted',
  1594. 'shape-rendering' => 'auto',
  1595. 'stop-color' => 'black',
  1596. 'stop-opacity' => 1,
  1597. 'stroke' => 'none',
  1598. 'stroke-dasharray' => 'none',
  1599. 'stroke-dashoffset' => 0,
  1600. 'stroke-linecap' => 'butt',
  1601. 'stroke-linejoin' => 'miter',
  1602. 'stroke-miterlimit' => 4,
  1603. 'stroke-opacity' => 1,
  1604. 'stroke-width' => 1,
  1605. 'text-anchor' => 'start',
  1606. 'text-decoration' => 'none',
  1607. 'text-rendering' => 'auto',
  1608. 'unicode-bidi' => 'normal',
  1609. 'visibility' => 'visible',
  1610. 'word-spacing' => 'normal',
  1611. 'writing-mode' => 'lr-tb',
  1612. 'text-color' => 'black',
  1613. 'transfmatrix' => array(1, 0, 0, 1, 0, 0)
  1614. ));
  1615. /**
  1616. * If true force sRGB color profile for all document.
  1617. * @protected
  1618. * @since 5.9.121 (2011-09-28)
  1619. */
  1620. protected $force_srgb = false;
  1621. /**
  1622. * If true set the document to PDF/A mode.
  1623. * @protected
  1624. * @since 5.9.121 (2011-09-27)
  1625. */
  1626. protected $pdfa_mode = false;
  1627. /**
  1628. * Document creation date-time
  1629. * @protected
  1630. * @since 5.9.152 (2012-03-22)
  1631. */
  1632. protected $doc_creation_timestamp;
  1633. /**
  1634. * Document modification date-time
  1635. * @protected
  1636. * @since 5.9.152 (2012-03-22)
  1637. */
  1638. protected $doc_modification_timestamp;
  1639. /**
  1640. * Custom XMP data.
  1641. * @protected
  1642. * @since 5.9.128 (2011-10-06)
  1643. */
  1644. protected $custom_xmp = '';
  1645. /**
  1646. * Overprint mode array.
  1647. * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
  1648. * @protected
  1649. * @since 5.9.152 (2012-03-23)
  1650. */
  1651. protected $overprint = array('OP' => false, 'op' => false, 'OPM' => 0);
  1652. /**
  1653. * Alpha mode array.
  1654. * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
  1655. * @protected
  1656. * @since 5.9.152 (2012-03-23)
  1657. */
  1658. protected $alpha = array('CA' => 1, 'ca' => 1, 'BM' => '/Normal', 'AIS' => false);
  1659. /**
  1660. * Define the page boundaries boxes to be set on document.
  1661. * @protected
  1662. * @since 5.9.152 (2012-03-23)
  1663. */
  1664. protected $page_boxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox');
  1665. /**
  1666. * Set the document producer metadata.
  1667. * @protected
  1668. * @since 5.9.152 (2012-03-23)
  1669. */
  1670. protected $pdfproducer;
  1671. /**
  1672. * If true print TCPDF meta link.
  1673. * @protected
  1674. * @since 5.9.152 (2012-03-23)
  1675. */
  1676. protected $tcpdflink = true;
  1677. /**
  1678. * Cache array for computed GD gamma values.
  1679. * @protected
  1680. * @since 5.9.1632 (2012-06-05)
  1681. */
  1682. protected $gdgammacache = array();
  1683. //------------------------------------------------------------
  1684. // METHODS
  1685. //------------------------------------------------------------
  1686. /**
  1687. * This is the class constructor.
  1688. * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).
  1689. * @param $orientation (string) page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li><li>'' (empty string) for automatic orientation</li></ul>
  1690. * @param $unit (string) User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in…

Large files files are truncated, but you can click here to view the full file