example58_new_mPDF_v5-4_features.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <?php
  2. require_once __DIR__ . '/../vendor/autoload.php';
  3. $mpdf = new mPDF('');
  4. //==============================================================
  5. $html = '
  6. <style>
  7. .gradient {
  8. border:0.1mm solid #220044;
  9. background-color: #f0f2ff;
  10. background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
  11. box-shadow: 0.3em 0.3em #888888;
  12. }
  13. .rounded {
  14. border:0.1mm solid #220044;
  15. background-color: #f0f2ff;
  16. background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
  17. border-radius: 2mm;
  18. background-clip: border-box;
  19. }
  20. h4 {
  21. font-weight: bold;
  22. margin-top: 1em;
  23. margin-bottom: 0.3em;
  24. margin-top: 0;
  25. }
  26. div.text {
  27. padding:0.8em;
  28. margin-bottom: 0.7em;
  29. }
  30. p { margin: 0.25em 0; }
  31. .code {
  32. font-family: monospace;
  33. font-size: 9pt;
  34. background-color: #d5d5d5;
  35. margin: 1em 1cm;
  36. padding: 0 0.3cm;
  37. border:0.2mm solid #000088;
  38. box-shadow: 0.3em 0.3em #888888;
  39. }
  40. table {
  41. overflow: visible;
  42. empty-cells: hide;
  43. border:1px solid #000000;
  44. font-family: sans-serif;
  45. font-size: 10pt;
  46. background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
  47. }
  48. td, th {
  49. border:1px solid #000000;
  50. text-align: left;
  51. font-weight: normal;
  52. }
  53. td.markedcell {
  54. text-decoration: line-through;
  55. color: #CC0000;
  56. }
  57. td.underlinedcell {
  58. text-decoration: underline;
  59. color: #CC0000;
  60. }
  61. td.rotatedcell {
  62. text-decoration: line-through;
  63. color: #CC0000;
  64. text-rotate: 45;
  65. }
  66. td.cost { text-align: right; }
  67. caption.tablecaption {
  68. font-family: sans-serif;
  69. font-weight: bold;
  70. border: none;
  71. caption-side: top;
  72. margin-bottom: 0;
  73. text-align: center;
  74. }
  75. u.doubleu {
  76. text-decoration: none;
  77. border-bottom: 3px double #000088;
  78. }
  79. a.reddashed {
  80. text-decoration: none;
  81. border: 1px dashed #880000;
  82. }
  83. .shadowtitle {
  84. height: 8mm;
  85. background-color: #EEDDFF;
  86. background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
  87. padding: 0.8em;
  88. padding-left: 3em;
  89. font-family:sans;
  90. font-size: 26pt;
  91. font-weight: bold;
  92. border: 0.2mm solid white;
  93. border-radius: 0.2em;
  94. box-shadow: 0 0 2em 0.5em rgba(0,0,255,0.9);
  95. color: #AAAACC;
  96. text-shadow: 0.03em 0.03em #666, 0.05em 0.05em rgba(127,127,127,0.5), -0.015em -0.015em white;
  97. }
  98. h3 {
  99. margin: 3em 0 2em -15mm;
  100. background-color: #EEDDFF;
  101. background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
  102. padding: 0.5em;
  103. padding-left: 3em;
  104. width: 50%;
  105. font-family:sans;
  106. font-size: 16pt;
  107. font-weight: bold;
  108. border-left: none;
  109. border-radius: 0 2em 2em 0;
  110. box-shadow: 0 0 2em 0.5em rgba(255,0,0,1);
  111. text-shadow: 0.05em 0.04em rgba(127,127,127,0.5);
  112. }
  113. .css {
  114. font-family: arial;
  115. font-style: italic;
  116. color: #000088;
  117. }
  118. table.zebra tbody tr:nth-child(2n+1) td { background-color: rgba(255,255,127,0.6); }
  119. table.zebra tbody tr:nth-child(2n+1) th { background-color: rgba(255,255,127,0.6); }
  120. table.zebra thead tr { background-color: #FFBBFF; }
  121. table.zebra tfoot tr { background-color: #BBFFFF; }
  122. </style>
  123. <body>
  124. <div class="shadowtitle">New Features in mPDF v5.4</div>
  125. <h3>Bookmark styles<bookmark content="Bookmark styles" level="0" /></h3>
  126. <div>
  127. <p>Bookmarks can be styled by adding code as below to your script. You can define a colour (array of RGB) and/or a font-style (B, I, or BI) for each level (starting at 0). Results may depend on the PDF Reader you are using.</p>
  128. <p class="code">
  129. $this->bookmarkStyles = array(<br />
  130. &nbsp; &nbsp; &nbsp; 0 => array(\'color\'=> array(0,64,128), \'style\'=>\'B\'),<br />
  131. &nbsp; &nbsp; &nbsp; 1 => array(\'color\'=> array(128,0,0), \'style\'=>\'\'),<br />
  132. &nbsp; &nbsp; &nbsp; 2 => array(\'color\'=> array(0,128,0), \'style\'=>\'I\'),<br />
  133. );
  134. </p>
  135. </div>
  136. <h3>Embedded SVG code<bookmark content="Embedded SVG code" level="0" /></h3>
  137. <p>SVG Images can be embedded in your HTML code. This is formally part of the XHTML specification and is supported by IE9+ and most other browsers.</p>
  138. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 400 200" width="400" height="200">
  139. <circle cx="130" cy="100" r="80" stroke="black" stroke-width="1" fill="red" />
  140. <circle cx="200" cy="100" r="80" stroke="black" stroke-width="1" fill="blue" />
  141. </svg>
  142. <p class="code">
  143. &lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 200 200" width="200" height="200"&gt; <br />
  144. &nbsp; &lt;circle cx="100" cy="50" r="40" stroke="black" stroke-width="1" fill="red" /&gt;<br />
  145. &nbsp; &lt;circle cx="130" cy="50" r="40" stroke="black" stroke-width="1" fill="blue" /&gt;<br />
  146. &lt;/svg&gt;
  147. </p>
  148. <h3>Improved CSS support<bookmark content="Improved CSS support" level="0" /></h3>
  149. <div class="gradient text">
  150. <p><span class="css">border-radius</span> is now supported on fixed/absolute-positioned block elements.</p>
  151. <p><span class="css">visibility</span> can be set on any block-style element e.g. DIV,P or images IMG as: visible|hidden|printonly|screenonly</p>
  152. <p><span class="css">background-color</span> now supports rgba() and cmyka() alpha transparency formats in tables.</p>
  153. <p>Color, underline and strike-through are now supported in table cells, including with rotated text (see example below of spread table)</p>
  154. <p><span class="css">page-break-after: left|right|always</span> is supported on all block-style elements and tables</p>
  155. <p><span class="css">text-transform: capitalize|uppercase|lowercase</span> is supported in table cells</p>
  156. </div>
  157. <div class="gradient text">
  158. <h4>Zebra stripes in Tables<bookmark content="Zebra stripes" level="1" /></h4>
  159. <div>
  160. <p><span class="css">:nth-child()</span> selector can be used in tables (on TR, TD or TH) to stripe rows or columns. Both the <i>a</i>n+<i>b</i> and odd/even forms are supported e.g.</p>
  161. <p class="code">
  162. tr:nth-child(2n+1) { background-color: rgba(255,255,127,0.6); } <i>or</i><br />
  163. tr:nth-child(odd) { background-color: rgba(255,255,127,0.6); }
  164. </p>
  165. <table class="zebra" align="center">
  166. <tbody>
  167. <tr>
  168. <th>Row 1</th>
  169. <td>This is data</td>
  170. <td class="cost">167.00</td>
  171. </tr>
  172. <tr>
  173. <th>Row 2</th>
  174. <td>
  175. <p>This is data p</p>
  176. </td>
  177. <td class="cost">
  178. <p>444.53</p>
  179. </td>
  180. </tr>
  181. <tr>
  182. <th>
  183. <p>Row 3</p>
  184. </th>
  185. <td>
  186. <p>This is long data</p>
  187. </td>
  188. <td class="cost">14.00</td>
  189. </tr>
  190. <tr>
  191. <td>
  192. <p>Row 4</p>
  193. </td>
  194. <td>This is data</td>
  195. <td class="cost">
  196. <p>0.88</p>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td>Row 5</td>
  201. <td>Also data</td>
  202. <td class="cost">144.00</td>
  203. </tr>
  204. <tr>
  205. <td>Row 6</td>
  206. <td>Also data</td>
  207. <td class="cost">8089.00</td>
  208. </tr>
  209. </tbody></table>
  210. <p><b>Note:</b> mPDF does NOT correctly apply specificity to all CSS. The following stylesheet:</p>
  211. <p class="code">
  212. table.zebra tbody tr:nth-child(2n+1) td { background-color: yellow; }<br />
  213. table.zebra tbody td:nth-child(odd) { background-color: blue; }
  214. </p>
  215. <p>should make every odd row yellow, and every odd column blue, but with the row/yellow overriding the column/blue.
  216. In mPDF the td:nth-child(odd) trumps the plain td, so the column colour wins out. You can force the effect you want by using:</p>
  217. <p class="code">
  218. table.zebra tbody tr:nth-child(2n+1) td:nth-child(1n+0) { background-color: yellow; }
  219. </p>
  220. <p>The :nth-child(1n+0) selector just selects every td cell.</p>
  221. </div>
  222. </div>
  223. <div class="gradient text">
  224. <p><span class="css">border</span> can now be defined on in-line elements eg SPAN</p>
  225. <ul><li style="font-family: arial;">Cum sociis natoque <u class="doubleu">penatibus</u> et <a class="reddashed" href="#">magnis dis parturient</a> montes</li></ul>
  226. <p><b>Note:</b> Remember that in mPDF, inside table cells, properties set on block elements are set when possible as in-line properties - so a P element inside a table with border set, will appear with a border around the text line as though it had been set on SPAN </p>
  227. </div>
  228. <div class="gradient text">
  229. <h4>Shadows<bookmark content="Shadows" level="1" /></h4>
  230. <p><span class="css">box-shadow</span> can be defined on any block-level element (P, DIV etc). It follows the CSS3 recommendation, but <i>inset</i> is not supported.</p>
  231. <p><span class="css">text-shadow</span> can be defined on any element. It follows the CSS3 recommendation, but <i>blur</i> is not supported.</p>
  232. <p class="code">
  233. &lt;span style="text-shadow: 0.03em 0.03em #666, -0.015em -0.015em white;"&gt;<br />
  234. &lt;div style="box-shadow: 0.3em 0.3em #888888;"&gt;
  235. </p>
  236. </div>
  237. <h3>Other Enhancements<bookmark content="Other Enhancements" level="0" /></h3>
  238. <h4>Column Totals (Tables)<bookmark content="Column totals" level="1" /></h4>
  239. <p>{colsum} placed in the footer of a table will automatically display the sum of that column. If the table breaks across more than one page, the sum of the values on that page will be displayed. A number following the colsum e.g. {colsum2} will force that number of decimal places to be displayed.</p>
  240. <table class="zebra" align="center">
  241. <caption class="tablecaption" align="bottom">Table caption goes here</caption>
  242. <thead>
  243. <tr>
  244. <th>Header Row</th>
  245. <td>Header Row</td>
  246. <td>Header Row</td>
  247. </tr>
  248. </thead>
  249. <tfoot>
  250. <tr>
  251. <th></th>
  252. <td>Column total: (using colsum2 in {})</td>
  253. <td class="cost"><b>{colsum2}</b></td>
  254. </tr>
  255. </tfoot>
  256. <tbody>
  257. <tr>
  258. <th>Row 1</th>
  259. <td>This is data</td>
  260. <td class="cost">167.00</td>
  261. </tr>
  262. <tr>
  263. <th>Row 2</th>
  264. <td>
  265. <p>This is data p</p>
  266. </td>
  267. <td class="cost">
  268. <p>444.53</p>
  269. </td>
  270. </tr>
  271. <tr>
  272. <th>
  273. <p>Row 3</p>
  274. </th>
  275. <td>
  276. <p>This is long data</p>
  277. </td>
  278. <td class="cost">14.00</td>
  279. </tr>
  280. <tr>
  281. <td>
  282. <p>Row 4</p>
  283. </td>
  284. <td>This is data</td>
  285. <td class="cost">
  286. <p>0.88</p>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td>Row 5</td>
  291. <td>Also data</td>
  292. <td class="cost">144.00</td>
  293. </tr>
  294. <tr>
  295. <td>Row 6</td>
  296. <td>Also data</td>
  297. <td class="cost">8089.00</td>
  298. </tr>
  299. <tr>
  300. <td>Row 7</td>
  301. <td>Also data</td>
  302. <td class="cost">3.00</td>
  303. </tr>
  304. <tr>
  305. <td>Row 8</td>
  306. <td>Also data</td>
  307. <td class="cost">23.00</td>
  308. </tr>
  309. </tbody></table>
  310. <br />
  311. <h4>Table <span style="font-variant: small-caps">caption</span><bookmark content="Table caption" level="1" /></h4>
  312. <p>The caption element for tables is partially supported (see example above).</p>
  313. <p class="code">
  314. &lt;caption align="top|bottom" style="caption-side: top|bottom"&gt;
  315. </p>
  316. <ul>
  317. <li>The caption must come immediately after &lt;table&gt;.</li>
  318. <li>The CSS <span class="css">caption-side</span> or HTML <span class="css">align</span> attribute of top|bottom supported</li>
  319. <li>Left or right placement are not supported.</li>
  320. <li>The caption is handled as a separate block element brought outside the table, so:
  321. <ul>
  322. <li>CSS will not cascade correctly from the table</li>
  323. <li>the width of the caption block is that of page or of the block element containing the table</li>
  324. <li>text alignment will be to the page-width not the table width</li>
  325. <li>if table page-break-after: always, the caption will follow the pagebreak</li>
  326. </ul></li>
  327. </ul>
  328. <h4>Core fonts in non-core font document<bookmark content="Core fonts" level="1" /></h4>
  329. <p>Core fonts, which do not need to be embedded in a PDF, can now be included in a document which uses non-core fonts. The pseudo font-family names: <span style="font-family: chelvetica">chelvetica</span>, <span style="font-family: ctimes">ctimes</span> and <span style="font-family: ccourier">ccourier</span> should be used.</p>
  330. <p class="code">
  331. &lt;div style="font-family: chelvetica"&gt;
  332. </p>
  333. <p>NB You could force mPDF to always use core fonts when Arial/Helvetica/Courier are specified, by editing $this->fonttrans in config_fonts.php:</p>
  334. <p class="code">
  335. $this->fonttrans = array(<br />
  336. \'arial\' => \'chelvetica\',<br />
  337. \'helvetica\' => \'chelvetica\',<br />
  338. \'timesnewroman\' => \'ctimes\',<br />
  339. \'times\' => \'ctimes\',<br />
  340. \'couriernew\' => \'ccourier\',<br />
  341. \'courier\' => \'ccourier\',<br />
  342. ...
  343. </p>
  344. <br />
  345. <h4>Javascript in Forms<bookmark content="Javascript in Forms" level="1" /></h4>
  346. <p>Javascript used in (active) forms has been altered to reflect the Adobe Acrobat specification for Javascript in PDF documents.</p>
  347. <p>textarea and input (text-types) now accept javascript as: onKeystroke, onValidate, onCalculate and onFormat. onChange is depracated but is not ignored; it works as though for onCalculate. (PS Select still accepts onChange)</p>
  348. <br />
  349. <h4>Overlapping Rows in Tables<bookmark content="Overlapping Table Rows" level="1" /></h4>
  350. <p> Support for overlapping rowspans in tables has been improved (although probably not foolproof!)</p>
  351. <table style="border-collapse: separate; border-spacing: 3.5mm;">
  352. <tr>
  353. <td style="width: 30mm; height: 30mm; background-color: rgb(213,226,253)">&nbsp;</td>
  354. <td style="width: 30mm; height: 30mm; background-color: rgb(75,155,215)">&nbsp;</td>
  355. <td rowspan="2" style="width: 30mm; height: 63.5mm; background-color: rgb(183,225,253)">&nbsp;</td>
  356. </tr>
  357. <tr>
  358. <td colspan="2" rowspan="2" style="width: 63.5mm; height: 63.5mm; background-color: rgb(183,225,253)">&nbsp;</td>
  359. </tr>
  360. <tr>
  361. <td style="width: 30mm; height: 30mm; background-color: rgb(75,155,215)">&nbsp;</td>
  362. </tr>
  363. </table>
  364. <br />
  365. <h3>Circular Text<bookmark content="Circular Text" level="0" /></h3>
  366. <p>Circular Text can be included in a PDF document as a custom HTML tag (or a function)</p>
  367. <ul>
  368. <li>top-text and/or bottom-text can be specified</li>
  369. <li>Radius (r) and font-size (using CSS) are user-defined</li>
  370. <li>Width and height are calculated from radius and font-size</li>
  371. <li>Other CSS styles supported on Circular Text: border, margin, padding, color, background-color, font-family, font-size, font-weight, font-style, display, visibility, and opacity</li>
  372. <li>space-width should be specified as an integer defining the letter-spacing as a percentage of normal (default 120)</li>
  373. <li>char-width should be specified as an integer defining the width of each character as a percentage of normal (default 100)</li>
  374. <li>Circular Text is displayed as though an in-line element</li>
  375. </ul>
  376. <p>NB If $mpdf->useKerning is true then automatic kerning will be used on Circular Text.</p>
  377. <p class="code">
  378. &lt;textcircle r="30mm" top-text="Circular Text Circular Text" style="color: blue; font-size: 34pt; font-style: italic" /&gt;<br /><br />
  379. &lt;textcircle r="30mm" space-width="120" char-width="150" top-text="&amp;bull; Circular Text &amp;bull;" bottom-text="Circular Text" style="background-color: #FFAAAA; border:1px solid red; padding: 0.3em; margin: 0.3em; color: #000000; font-size: 21pt; font-weight:bold; font-family: Arial" /&gt;
  380. </p>
  381. <textcircle r="30mm" top-text="Circular Text Circular Text" style="color: blue; font-size: 34pt; font-style: italic" />
  382. <textcircle r="30mm" space-width="120" char-width="150" top-text="&bull; Circular Text &bull;" bottom-text="Circular Text" style="background-color: #FFAAAA; border:1px solid red; padding: 0.3em; margin: 0.3em; color: #000000; font-size: 21pt; font-weight:bold; font-family: Arial" />
  383. <h3 style="page-break-before: left;">Spread tables<bookmark content="Spread Tables" level="0" /></h3>
  384. <div class="gradient text">
  385. Setting the CSS property "overflow: visible" on a table now has the effect of cancelling resizing, and allowing tables to split columns across multiple pages.
  386. The maximum width for a column (or group of columns set by colspan) is the page width. It is recommended to specify absolute values of width on each column (not percentages).
  387. </div>
  388. <br />
  389. <input type="button" name="javascriptButton" value="Show 2 pages" onClick="TwoPages()" />
  390. <input type="button" name="javascriptButton2" value="Show 1 page" onClick="OnePage()" />
  391. <br /><br />
  392. <table cellPadding="9" style="font-size: 16pt;">
  393. <caption class="tablecaption">Periodic Table (table caption)</caption>
  394. <thead>
  395. <tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th><th>11</th><th>12</th><th>13</th><th>14</th><th>15</th><th>16</th><th>17</th><th>18</th></tr></thead>
  396. <tbody>
  397. <tr>
  398. <td>H </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
  399. <td></td><td></td><td></td><td></td><td>He </td>
  400. </tr>
  401. <tr>
  402. <td>Li </td><td>Be </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
  403. <td>B </td><td>C </td><td>N </td><td>O </td><td>F </td><td>Ne </td>
  404. </tr>
  405. <tr>
  406. <td>Na </td><td>Mg </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
  407. <td>Al </td><td>Si </td><td>P </td><td>S </td><td>Cl </td><td>Ar </td>
  408. </tr>
  409. <tr>
  410. <td>K </td><td>Ca </td><td>Sc </td><td>Ti </td><td>V </td><td class="markedcell">Cr </td><td>Mn </td><td>Fe </td><td>Co </td><td>Ni </td>
  411. <td>Cu </td><td>Zn </td><td>Ga </td><td>Ge </td><td>As </td><td>Se </td><td>Br </td><td>Kr </td>
  412. </tr>
  413. <tr>
  414. <td>Rb </td><td>Sr </td><td>Y </td><td>Zr </td><td>Nb </td><td>Mo </td><td>Tc </td><td class="underlinedcell">Ru </td><td>Rh </td>
  415. <td>Pd </td><td>Ag </td><td>Cd </td><td>In </td><td>Sn </td><td>Sb </td><td>Te </td><td>I </td><td>Xe </td>
  416. </tr>
  417. <tr>
  418. <td>Cs </td><td>Ba </td><td class="rotatedcell">Lu </td><td>Hf </td><td>Ta </td><td>W </td><td>Re </td><td>Os </td><td>Ir </td><td>Pt </td>
  419. <td>Au </td><td>Hg </td><td>Tl </td><td>Pb </td><td>Bi </td><td>Po </td><td>At </td><td>Rn </td>
  420. </tr>
  421. <tr>
  422. <td>Fr </td><td>Ra </td><td> </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
  423. <td></td><td></td><td></td><td></td><td></td>
  424. </tr>
  425. </tbody></table>
  426. <br /><br />
  427. <div class="gradient text">
  428. <h4>Limitations of Spread tables<bookmark content="Limitations" level="1" /></h4>
  429. Spread tables cannot be used with: keep-headings-with-table ($mpdf->use_kwt), table rotate, table page-break-inside:avoid, columns,
  430. CJK (chinese-japanese-korean) or RTL (right-to-left) languages.
  431. They will also cause problems with $mpdf->forcePortraitHeaders or $mpdf->forcePortraitMargins.<br />
  432. Warning: If a table row is too tall to fit on a page, mPDF will crash with an error message.<br />
  433. If the width settings within the table cause conflicts, it will override some of these settings.
  434. </div>
  435. <br />
  436. ';
  437. //==============================================================
  438. $mpdf->useActiveForms = true;
  439. $mpdf->bookmarkStyles = array(
  440. 0 => array('color'=> array(0,64,128), 'style'=>'B'),
  441. 1 => array('color'=> array(128,0,0), 'style'=>''),
  442. 2 => array('color'=> array(0,128,0), 'style'=>'I'),
  443. );
  444. $mpdf->useKerning=true; // set this to improve appearance of Circular text
  445. // must be set before the font is first loaded
  446. $mpdf->WriteHTML($html);
  447. // JAVASCRIPT FOR WHOLE DOCUMENT
  448. $mpdf->SetJS('
  449. function TwoPages() {
  450. this.layout="TwoColumnRight";
  451. this.zoomType = zoomtype.fitW;
  452. }
  453. function OnePage() {
  454. this.layout="SinglePage";
  455. this.zoom = 100;
  456. }
  457. ');
  458. // OUTPUT
  459. $mpdf->Output(); exit;
  460. //==============================================================
  461. //==============================================================
  462. //==============================================================
  463. //==============================================================