aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php')
-rw-r--r--inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php492
1 files changed, 0 insertions, 492 deletions
diff --git a/inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php b/inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php
deleted file mode 100644
index fb30356f..00000000
--- a/inc/3rdparty/libraries/mpdf/examples/example52_new_mPDF_4-2_features.php
+++ /dev/null
@@ -1,492 +0,0 @@
1<?php
2
3
4ini_set("memory_limit","256M");
5
6
7$html = '
8<style>
9body {
10 font-family: sans-serif;
11}
12@page {
13 margin-top: 2.0cm;
14 margin-bottom: 2.0cm;
15 margin-left: 2.3cm;
16 margin-right: 1.7cm;
17 margin-header: 8mm;
18 margin-footer: 8mm;
19 footer: html_myHTMLFooter;
20 background-color:#ffffff;
21}
22
23@page :first {
24 margin-top: 6.5cm;
25 margin-bottom: 2cm;
26 header: html_myHTMLHeader;
27 footer: _blank;
28 resetpagenum: 1;
29 background-gradient: linear #FFFFFF #FFFF44 0 0.5 1 0.5;
30 background: #ccffff url(bgbarcode.png) repeat-y fixed left top;
31}
32@page letterhead {
33 margin-top: 2.0cm;
34 margin-bottom: 2.0cm;
35 margin-left: 2.3cm;
36 margin-right: 1.7cm;
37 margin-header: 8mm;
38 margin-footer: 8mm;
39 footer: html_myHTMLFooter;
40 background-color:#ffffff;
41}
42
43@page letterhead :first {
44 margin-top: 6.5cm;
45 margin-bottom: 2cm;
46 header: html_myHTMLHeader;
47 footer: _blank;
48 resetpagenum: 1;
49}
50.gradient {
51 border:0.1mm solid #220044;
52 background-color: #f0f2ff;
53 background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
54}
55.rounded {
56 border:0.1mm solid #220044;
57 background-color: #f0f2ff;
58 background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
59 border-radius: 2mm;
60 background-clip: border-box;
61}
62h4 {
63 font-weight: bold;
64 margin-top: 1em;
65 margin-bottom: 0.3em;
66}
67div.text {
68 padding:1em;
69 margin-bottom: 0.25em;
70 text-align:justify;
71}
72div.artificial {
73 font-family: arialuni; /* custom font using MS Arial Unicode */
74}
75p { margin-top: 0; }
76.code {
77 font-family: mono;
78 font-size: 9pt;
79 background-color: #d5d5d5;
80 margin: 1em 1cm;
81 padding: 0 0.3cm;
82}
83
84
85</style>
86
87<body>
88
89<!--mpdf
90
91<htmlpageheader name="myHTMLHeader">
92<div style="float:right; width: 90; height: 90; text-align: right; vertical-align: bottom; border: 1mm double #000088"><img src="tiger.png" width="90" /></div>
93
94<div style="color:#0000BB;"><span style="font-weight: bold; font-size: 14pt;">mPDF Version 4.2</span><br />123 Anystreet<br />Your City<br />GD12 4LP<br /><span style="font-size: 15pt;">&#x260e;</span> 01777 123 567
95</div>
96
97<div style="clear: both; margin-top: 1cm; text-align: right;">{DATE jS F Y}</div>
98
99</htmlpageheader>
100
101<htmlpagefooter name="myHTMLFooter">
102<table width="100%" style="border-top: 0.1mm solid #000000; vertical-align: top; font-size: 9pt; color: #000055;"><tr>
103<td width="25%"></td>
104<td width="50%" align="center">See <a href="http://mpdf1.com/manual/index.php">documentation manual</a> for further details</td>
105<td width="25%" align="right">Page {PAGENO} of {nbpg} pages</td>
106</tr></table>
107</htmlpagefooter>
108
109mpdf-->
110
111<h2>mPDF Version 4.2</h2>
112<h2>New Features</h2>
113
114<div class="gradient text">
115<ul>
116<li>image handling improved</li>
117<li>table layout - additional control over resizing</li>
118<li>vertical-alignment of images - better support for all CSS types</li>
119<li>top and bottom margins collapse between block elements</li>
120<li>improved support for CSS line-height</li>
121<li>display progress bar whilst generating file</li>
122<li>CSS @page selector can be specified when adding a pagebreak</li>
123<li>CSS @page selector allows different margins, backgrounds, headers/footers on :first :left and :right pages</li>
124<li>PNG images with alpha channel fully supported</li>
125<li>ability to generate italic and bold font variants from base font file</li>
126<li>CJK fonts to embed as subsets</li>
127<li>"double" border on block elements</li>
128<li>character substitution for missing characters in UTF-8 fonts</li>
129<li>direct passing of dynamically produced image data</li>
130<li>background-gradient and background-image can now co-exist </li>
131</ul>
132
133Note: automatic top- and bottom-margin to accomodate varying header/footer size was introduced in v4.0 but was not highlighted cf. AutoHeaderMargin in the Manual.
134
135</div>
136<br />
137
138<div class="gradient text">
139<h4>Page backgrounds</h4>
140Background images, gradients and/or colours can be used together on the same page. On this page, the bars on the left hand side are created using a background-image, whilst a background-gradient sets the background to the whole page.
141</div>
142<br />
143
144<div class="gradient text" style="background-color: #d9def0; border-style: double; border-color:#444444; border-width:1mm;">
145<h4>CSS "double" border</h4>
146Block elements can now use the CSS property: border(style) = double. See also the tiger logo in the header of this page.
147</div>
148<br />
149
150<div class="gradient text">
151<h4>CJK fonts to embed as subsets</h4>
152When writing documents with Chinese, Japanese or Korean characters, mPDF has previously required the end-user to download Adobe\'s free CJK font pack.
153The ability to embed font subsets now makes it feasible to use open license CJK fonts. 2 fonts are now available to download as an additional font-pack:
154<ul>
155<li>zn_hannom_a - contains all characters in the SJIS, BIG-5, and GBK codepages; original file was Han Nom A font (Hi-res version) from http://vietunicode.sourceforge.net/fonts/fonts_hannom.html</li>
156<li>unbatang_0613 - contains all the (Korean) characters in the UHC codepage; original file from from http://kldp.net/projects/unfonts/download</li>
157</ul>
158The following characters only added an extra 15kB to the size of this PDF file, and approximately 0.15 seconds extra to compile:<br />
159Chinese (traditional) <span style="font-family:zn_hannom_a">'."\xe6\x86\x82\xe9\xac\xb1".'</span> ; chinese (simplified) <span style="font-family:zn_hannom_a">'."\xe6\x9d\xa5\xe8\x87\xaa".'</span> ; japanese <span style="font-family:zn_hannom_a">'."\xe3\x81\x9f\xe3\x82\x90".'</span> ; korean <span style="font-family:unBatang_0613">'."\xed\x82\xa4\xec\x8a\xa4".'</span>
160</div>
161<br />
162
163<div class="artificial gradient text">
164<h4>Artificial Bold and Italic</h4>
165The text in this block is in ArialUnicodeMS font. Using embedded subsets it covers most characters you want to print - BUT it does not have bold, italic, or bold-italic forms.<br />
166From version 4.2, mPDF will create "artificial" font styles if they are not available as separate font files:<br />
167<p style="font-weight: bold">The quick brown fox jumps over a lazy dog</p>
168<p style="font-style: italic">The quick brown fox jumps over a lazy dog</p>
169<p style="font-weight: bold; font-style: italic">The quick brown fox jumps over a lazy dog</p>
170</div>
171<br />
172
173<div class="gradient text" style="font-family: \'Trebuchet MS\'">
174<h4>Character substitution in UTF-8 files</h4>
175This paragraph has the font-family set to Trebuchet MS, and the document has the default font set as DejaVuSansCondensed.
176The following characters are not present in the Trebuchet font, and are substituted from the core Adobe Zapfdingbats font:<br />
177
178&#x2710; &#x2711; &#x2712; &#x2713; &#x2714; &#x2715; &#x2716; &#x2717; &#x2718; &#x2719; &#x271a; &#x271b; &#x271c; &#x271d; &#x271e; &#x271f;<br />
179The characters are not present in the Trebuchet font, and are substituted from the (default) DejaVuSansCondensed font:<br />
180&#x280; &#x281; &#x282; &#x283; &#x284; &#x285; &#x286; &#x287; &#x288; &#x289; &#x28a; &#x28b; &#x28c; &#x28d; &#x28e; &#x28f;<br />
181Character substitution in UTF-8 files is enabled by setting:
182<p class="code">
183$mpdf->useSubstitutionsMB = true;
184</p>
185<div style="color:red; padding:0; margin:0;">NB In mPDF 5.0 this has changed to
186<p class="code" style="padding:0; margin:0;">
187$mpdf->useSubstitutions = true;
188</p>
189</div>
190It is not recommended to enable this for regular use, as it will add to the processing time.
191</div>
192
193
194
195<pagebreak />
196
197<h2>Margin-collapse</h2>
198<p>mPDF has always allowed margins to be collapsed at the top and bottom of pages. This is specified by the custom CSS property "margin-collapse: collapse"</p>
199
200<p>mPDF 4.2 also allows margins to collapse between block elements on the page. This is the default behaviour in browsers, and has been enabled in mPDF 4.2 by default.</p>
201
202<p>In the next 2 paragraphs, the first one has the margin-bottom set to 3em, and the second has the margin-top set to 0em. So the vertical-space between paragraphs is 3em:</p>
203
204<p class="gradient" style="font-size: 10pt; padding: 0 0.3em; margin-bottom: 3em;">The quick brown fox jumps over a lazy dog</p>
205<p class="gradient" style="font-size: 10pt; padding: 0 0.3em; margin-top: 0em;">The quick brown fox jumps over a lazy dog</p>
206
207<p>In the next 2 paragraphs, the first one has the margin-bottom set to 2em, and the second has the margin-top set to 1em. The margins collapse to the larger of the adjoining margins i.e. 2em:</p>
208
209<p class="gradient" style="font-size: 10pt; padding: 0 0.3em; margin-bottom: 2em;">The quick brown fox jumps over a lazy dog</p>
210<p class="gradient" style="font-size: 10pt; padding: 0 0.3em; margin-top: 1em;">The quick brown fox jumps over a lazy dog</p>
211
212
213<pagebreak />
214
215<h2>Images</h2>
216
217<h4>PNG Alpha channel</h4>
218PNG alpha channel transparency is now fully supported, and works against solid backgrounds, gradients or background images:
219<table>
220<tr>
221<td><img style="vertical-align: top" src="alpha.png" width="90" /></td>
222<td style="background-color:#FFCCFF; "><img style="vertical-align: top" src="alpha.png" width="90" /></td>
223<td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="alpha.png" width="90" /></td>
224<td style="background-color:#CCFFFF; background-gradient: linear #88FFFF #FFFF44 0 0.5 1 0.5; "><img style="vertical-align: top" src="alpha.png" width="90" /></td>
225<td style="background-color:#CCFFFF; background: transparent url(\'bgrock.jpg\') repeat scroll right top;"><img style="vertical-align: top" src="alpha.png" width="90" /></td>
226</tr>
227</table>
228
229<br />
230
231<h4>Image Border and padding</h4>
232Image padding is now supported as well as border and margin:
233<img src="sunset.jpg" width="100" style="border:3px solid #44FF44; padding: 1em; vertical-align: text-top; " />
234<br />
235
236<h4>Vertical alignment</h4>
237<div>From mPDF version 4.2 onwards, most of the values for "vertical-align" are supported: top, bottom, middle, baseline, text-top, and text-bottom.<br />
238<b>Note:</b> The default value for vertical alignment has been changed to baseline, and the default padding to 0, consistent with most browsers.
239</div>
240<br />
241<div class="gradient" style="font-size: 80%;">
242baseline: <img src="sunset.jpg" width="50" style="vertical-align: baseline;" />
243text-bottom: <img src="sunset.jpg" width="30" style="vertical-align: text-bottom;" />
244middle: <img src="sunset.jpg" width="30" style="vertical-align: middle;" />
245bottom: <img src="sunset.jpg" width="80" style="vertical-align: bottom;" />
246text-top: <img src="sunset.jpg" width="50" style="vertical-align: text-top;" />
247top: <img src="sunset.jpg" width="100" style="vertical-align: top;" />
248</div>
249
250
251<pagebreak />
252<h4>Image Alignment</h4>
253<div>From mPDF version 4.2 onwards, in-line images can be individually aligned (vertically).
254</div>
255
256<div class="gradient" style="margin: 0.5em 0;">
257These images <img src="img1.png" style="vertical-align: top;" />
258are <img src="img2.png" style="vertical-align: top;" />
259<b>top</b> <img src="img3.png" style="vertical-align: top;" />
260aligned <img src="img4.png" style="vertical-align: middle;" />
261</div>
262
263<div class="gradient" style="margin: 0.5em 0;">
264These images <img src="img1.png" style="vertical-align: text-top;" />
265are <img src="img2.png" style="vertical-align: text-top;" />
266<b>text-top</b> <img src="img3.png" style="vertical-align: text-top;" />
267aligned <img src="img4.png" style="vertical-align: middle;" />
268</div>
269
270<div class="gradient" style="margin: 0.5em 0;">
271These images <img src="img1.png" style="vertical-align: bottom;" />
272are <img src="img2.png" style="vertical-align: bottom;" />
273<b>bottom</b> <img src="img3.png" style="vertical-align: bottom;" />
274aligned <img src="img4.png" style="vertical-align: middle;" />
275</div>
276
277<div class="gradient" style="margin: 0.5em 0;">
278These images <img src="img1.png" style="vertical-align: text-bottom;" />
279are <img src="img2.png" style="vertical-align: text-bottom;" />
280<b>text-bottom</b> <img src="img3.png" style="vertical-align: text-bottom;" />
281aligned <img src="img4.png" style="vertical-align: middle;" />
282</div>
283
284<div class="gradient" style="margin: 0.5em 0;">
285These images <img src="img1.png" style="vertical-align: baseline;" />
286are <img src="img2.png" style="vertical-align: baseline;" />
287<b>baseline</b> <img src="img3.png" style="vertical-align: baseline;" />
288aligned <img src="img4.png" style="vertical-align: middle;" />
289</div>
290
291<div class="gradient" style="margin: 0.5em 0;">
292These images <img src="img1.png" style="vertical-align: middle;" />
293are <img src="img2.png" style="vertical-align: middle;" />
294<b>middle</b> <img src="img3.png" style="vertical-align: middle;" />
295aligned <img src="img5.png" style="vertical-align: bottom;" />
296</div>
297
298
299<pagebreak />
300<h4>Images from PHP</h4>
301
302<br />
303<img src="var:smileyface" />
304<br />
305This image was created with the following code:
306
307<p class="code">
308 $img = imagecreatetruecolor(200, 200);<br />
309 $white = imagecolorallocate($img, 255, 255, 255);<br />
310 $red = imagecolorallocate($img, 255, 0, 0);<br />
311 $green = imagecolorallocate($img, 0, 255, 0);<br />
312 $blue = imagecolorallocate($img, 0, 0, 255);<br />
313 imagearc($img, 100, 100, 200, 200, 0, 360, $white);<br />
314 imagearc($img, 100, 100, 150, 150, 25, 155, $red);<br />
315 imagearc($img, 60, 75, 50, 50, 0, 360, $green);<br />
316 imagearc($img, 140, 75, 50, 50, 0, 360, $blue);<br />
317 ob_start();<br />
318 imagejpeg($img);<br />
319 $mpdf->smileyface = ob_get_clean(); <br />
320 imagedestroy($img);<br />
321</p>
322and written to the document using:
323<p class="code">
324&lt;img src="var:smileyface" /&gt;
325</p>
326
327
328<pagebreak>
329<h4>Line-height inheritance</h4>
330Line-height inheritance has been altered to follow the CSS2 recommendation:
331<ul>
332<li>normal is inherited as "normal"</li>
333<li>1.2 is inherited as a factor</li>
334<li>120% is converted to an actual value and then inherited as the computed value</li>
335<li>em is converted to an actual value and then inherited as the computed value</li>
336<li>px pt mm are inherited as fixed values</li>
337</ul>
338
339<div>Relative values (e.g. 1.3, normal)</div>
340<div style="font-size: 12pt; line-height: 2.0; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
341This DIV has the line-height set as "2.0" and font-size as 12pt. The line-height is therefore 24pt, but the factor of 2 is inherited...<br />
342Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse...
343<div style="font-size: 8pt; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
344This DIV has the font-size set as 8pt. The line-height of 2 is inherited...<br />
345Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci.
346<div style="font-size: 18pt; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
347This DIV has the font-size set as 18pt. The line-height of 2 is inherited...<br />
348Nulla felis erat, imperdiet eu, ullamcorper non...
349</div>
350</div>
351</div>
352<br />
353<div>Absolute values (e.g. 130%, 1.3em, 18pt)</div>
354<div style="font-size: 12pt; line-height: 200%; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
355This DIV has the line-height set as "200%" and font-size as 12pt. The computed line-height of 24pt is inherited...<br />
356Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse...
357<div style="font-size: 8pt; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
358This DIV has the font-size set as 8pt. The computed line-height of 24pt is inherited...<br />
359Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci.
360<div style="font-size: 18pt; border: 0.2mm solid #880000; background-color: #FFEECC; padding: 0.3em;">
361This DIV has the font-size set as 18pt. The computed line-height of 24pt is inherited...<br />
362Nulla felis erat, imperdiet eu, ullamcorper non...
363</div>
364</div>
365</div>
366
367
368<pagebreak />
369<h4>Line-height & vertical alignment</h4>
370<div>In these examples, top and bottom padding are set to 0, so the block height = line height.</div>
371<div>The inline text (set to a larger font-size) inherits the line-height as a factor of the largest font-size i.e. the line height will expand to reflect the largest font on the line.<br />
372Line-height: "normal" (set in mPDF by default as 1.33).</div>
373<p class="gradient" style="font-size: 10pt; line-height: normal; padding: 0 0.3em;">Normal text <span style="font-size: 16pt;">16pt font-size &#194;</span> and normal again</p>
374
375<div>Line-height: 2.0 When using relative line-heights, the text is aligned vertically so that the centre-line of the line goes throught the middle of the largest font.</div>
376<p class="gradient" style="font-size: 10pt; line-height: 2.0; padding: 0 0.3em;">Normal text <span style="font-size: 16pt;">16pt font-size &#194;</span> and normal again</p>
377
378<div>Line-heights set as a percentages are computed on the base font-size, and are then inherited and treated the same as absolute lengths. This is also true for "em" values. The line-height of this line is set as 200% of the paragraph font-size (10pt).<br />
379When using absolute line-heights, the text is aligned vertically so that the centre-line of the line goes throught the middle of the base font.<br />
380This means that as far as possible, multiple lines will remain equally spaced<br />
381Line-height: 200% </div>
382<p class="gradient" style="font-size: 10pt; line-height: 200%; padding: 0 0.3em;">Normal text <span style="font-size: 16pt;">16pt font-size &#194;</span> and normal again</p>
383
384<div>If the line includes a font-size greater than 1.6 times the computed line-height, then the text baseline is dropped so that the text will approximately fit within the line-height.
385<br />Line-height: 2em</div>
386<p class="gradient" style="font-size: 10pt; line-height: 2em; padding: 0 0.3em;">Normal text <span style="font-size: 18pt;">18pt font-size &#194;</span> and normal again</p>
387
388<div>If the line includes a font-size greater than 2 times the computed line-height, then the line-height is increased to accommodate the larger fontsize.<br />
389Line-height: 2em</div>
390<p class="gradient" style="font-size: 10pt; line-height: 2em; padding: 0 0.3em;">Normal text <span style="font-size: 24pt;">24pt font-size &#194;</span> and normal again</p>
391
392<br />
393This broadly reflects the behaviour of IE and Firefox. Note that tall characters such as &#194; may fall outside the computed line-heights. See the same in an <a href="example52_lineheight.htm">HTML page</a>.
394
395
396<pagebreak page-selector="letterhead" />
397<h2>Extended use of CSS @page selectors</h2>
398The CSS @page selector, together with the pseudo-selectors :first :left :right have increased support in mPDF 4.2<br />
399A named @page can be selected when forcing a new page, e.g. this page was started with:<br />
400<span style="font-family: mono; font-size: 9pt;">&lt;pagebreak page-selector="letterhead" /&gt;</span>
401<br />
402The header and background on this page (and page 1 of the document) are set by the CSS selector: @page letterhead :first {} whilst subsequent pages have no header, a footer, and no background.
403<br />
404CSS @page selectors allow different margins, backgrounds, headers/footers to be set on :first :left and :right pages. Only fixed or mirrored left- and right-margins are supported (i.e. cannot specify different margins for :left and :right).
405<br />
406This layout can be used to produce company letters with only the first page on letterheaded paper.
407
408<pagebreak />
409<h2>Table Layout control</h2>
410<p>mPDF attempts to layout tables according to HTML and CSS specifications. However, because of the difference between screen and paged media, mPDF resizes tables when necessary to make them fit the page. This will happen if the minimum table-width is greater than the page-width. Minimum table-width is defined as the minimum width to accomodate the longest word in each column i.e. words will never be split.
411</p>
412<p>This resizing (minimum-width) can be disabled using a custom CSS property "overflow" on the TABLE tag. There are 4 options:</p>
413&lt;table style="overflow: auto"&gt; (this is the default, using resizing)
414<table border="1" style="overflow: auto; border-collapse: collapse; padding: 0.1em; background-color: #DDFFFF"><tr>
415<td>Verylongwordwithnospacesinitatall</td>
416<td>Verylongwordwithnospacesinitatall</td>
417<td>Verylongwordwithnospacesinitatall</td>
418</tr></table>
419<br />
420&lt;table style="overflow: visible"&gt; (disables resizing, but allows overflow to show)
421<table border="1" style="overflow: visible; border-collapse: collapse; padding: 0.1em; background-color: #DDFFFF"><tr>
422<td>Verylongwordwithnospacesinitatall</td>
423<td>Verylongwordwithnospacesinitatall</td>
424<td>Verylongwordwithnospacesinitatall</td>
425</tr></table>
426<br />
427
428&lt;table style="overflow: hidden"&gt; (disables resizing, and hides/clips any overflow)
429<table border="1" style="overflow: hidden; border-collapse: collapse; padding: 0.1em; background-color: #DDFFFF"><tr>
430<td>Verylongwordwithnospacesinitatall</td>
431<td>Verylongwordwithnospacesinitatall</td>
432<td>Verylongwordwithnospacesinitatall</td>
433</tr></table>
434<br />
435
436&lt;table style="overflow: wrap"&gt; (forces words to break as necessary)
437<table border="1" style="overflow: wrap; border-collapse: collapse; padding: 0.1em; background-color: #DDFFFF"><tr>
438<td>Verylongwordwithnospacesinitatall</td>
439<td>Verylongwordwithnospacesinitatall</td>
440<td>Verylongwordwithnospacesinitatall</td>
441</tr></table>
442<br />
443
444
445
446';
447if ($_REQUEST['html']) { echo $html; exit; }
448
449
450//==============================================================
451//==============================================================
452//==============================================================
453define('_MPDF_URI','../'); // required for the progress bar
454
455include("../mpdf.php");
456
457$mpdf=new mPDF('','A4','','',15,15,20,20,5,5);
458
459$mpdf->StartProgressBarOutput(2); // 2 => advanced mode
460
461$mpdf->SetDisplayMode('fullpage');
462
463$mpdf->useSubstitutions = true;
464
465// Dynamically create image in var:smileyface
466 $img = imagecreatetruecolor(200, 200);
467 $white = imagecolorallocate($img, 255, 255, 255);
468 $red = imagecolorallocate($img, 255, 0, 0);
469 $green = imagecolorallocate($img, 0, 255, 0);
470 $blue = imagecolorallocate($img, 0, 0, 255);
471 imagearc($img, 100, 100, 200, 200, 0, 360, $white);
472 imagearc($img, 100, 100, 150, 150, 25, 155, $red);
473 imagearc($img, 60, 75, 50, 50, 0, 360, $green);
474 imagearc($img, 140, 75, 50, 50, 0, 360, $blue);
475 ob_start();
476 imagejpeg($img);
477 $mpdf->smileyface = ob_get_clean();
478 imagedestroy($img);
479
480
481$mpdf->WriteHTML($html);
482
483$mpdf->Output();
484exit;
485
486//==============================================================
487//==============================================================
488//==============================================================
489//==============================================================
490
491
492?> \ No newline at end of file