]>
Commit | Line | Data |
---|---|---|
4188f38a | 1 | =========================== |
2 | mPDF 5.7 | |
3 | 14/07/2013 | |
4 | =========================== | |
5 | ||
6 | Files changed | |
7 | ------------- | |
8 | config.php | |
9 | mpdf.php | |
10 | classes/tocontents.php | |
11 | classes/cssmgr.php | |
12 | classes/svg.php | |
13 | includes/functions.php | |
14 | includes/out.php | |
15 | examples/formsubmit.php [Important - Security update] | |
16 | ||
17 | Updated Example Files in /examples/ | |
18 | ----------------------------------- | |
19 | All example files | |
20 | mpdfstyleA4.css | |
21 | ||
22 | ||
23 | config.php | |
24 | ---------- | |
25 | Removed: | |
26 | $this->hyphenateTables | |
27 | $this->hyphenate | |
28 | $this->orphansAllowed | |
29 | Edited: | |
30 | "hyphens: manual" - Added to $this->defaultCSS | |
31 | $this->allowedCSStags now includes '|TEXTCIRCLE|DOTTAB' | |
32 | New: | |
33 | $this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-'); | |
34 | $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2); | |
35 | $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2); | |
36 | $this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin (used with CJK script) | |
37 | ||
38 | ||
39 | Backwards compatability | |
40 | ----------------------- | |
41 | Changes in mPDF 5.7 may cause some changes to the way your documents appear. There are two main differences: | |
42 | 1) Hyphenation. To retain appearance compatible with earlier versions, set the CSS property "hyphens: auto" whenever | |
43 | you previously used $mpdf->hyphenate=true; | |
44 | 2) Table of Contents - appearance can now be controlled with CSS styles. By default, in mPDF 5.7, no styling is applied so you will get: | |
45 | - No indent (previous default of 5mm) - ($tocindent is ignored) | |
46 | - Any font, font-size set ($tocfont or $tocfontsize) will not work | |
47 | - HyperLinks will appear with your default appearance - usually blue and underlined | |
48 | - line spacing will be narrower (can use line-height or margin-top in CSS) | |
49 | ||
50 | ||
51 | New features / Improvements | |
52 | --------------------------- | |
53 | Layout of Table of Content ToC now controlled using CSS styles | |
54 | Text alignment on decimal mark inside tables | |
55 | Automatically generated bookmarks and/or ToC entries from H1 - H6 tags | |
56 | Support for unit of "rem" as size e.g. font-size: 1rem; | |
57 | Origin and clipping for background images and gradients controlled by CSS i.e. background-origin, background-size, background-clip | |
58 | Text-outline controlled by CSS (compatible with CSS3 spec.) | |
59 | Use of <dottab> enhanced by custom CSS "outdent" property | |
60 | Image HTML attributes <img> added: max-height, max-width, min-height and min-width | |
61 | Spotcolor can now be defined as it is used e.g. color: spot(PANTONE 534 EC, 100%, 85, 65, 47, 9); | |
62 | Lists - added support for "start" attribute in <ol> e.g. <ol start="5"> | |
63 | Hyphenation controlled using CSS, consistent with CSS3 spec. | |
64 | Line breaking improved to avoid breaks within words where HTML tags are used e.g. H<sub>2<sub>0 | |
65 | Line breaking in CJK scripts improved (and ability to force hanging punctuation) | |
66 | Numerals in a CJK script are kept together | |
67 | RTL improved support for phrases containing numerals and \ and / | |
68 | Bidi override codes supported - Right-to-Left Embedding [RLE] U+202B, Left-to-Right Embedding [LRE] U+202A, | |
69 | U+202C POP DIRECTIONAL FORMATTING (PDF) | |
70 | Support for <base href=""> in HTML - uses it to SetBasePath for relative URLs. | |
71 | HTML tag - added support for <wbr> or <wbr /> - converted to a soft-hyphen | |
72 | CSS now takes precedence over HTML attribute e.g. <table bgcolor="black" style="background-color:yellow"> | |
73 | ||
74 | ||
75 | ||
76 | Added CSS support | |
77 | ----------------- | |
78 | - max-height, max-width, min-height and min-width for images <img> | |
79 | - "hyphens: none|manual|auto" as per CSS3 spec. | |
80 | - Decimal mark alignment e.g. text-align: "." center; | |
81 | - "rem" accepted as a valid (font)size in CSS e.g. font-size: 1.5rem | |
82 | - text-outline, text-outline-width and text-outline-color supported everywhere except in tables (blur not supported) | |
83 | - background-origin, background-size, background-clip are now supported everywhere except in tables | |
84 | - "visibility: hidden|visible|printonly|screenonly" for inline elements e.g. <span> | |
85 | - Colors: device-cmyk(c,m,y,k) as per CSS3 spec. For consistency, device-cmyka also supported (not CSS3 spec) | |
86 | - "z-index" can be used to utilise layers in the PDF document | |
87 | - Custom CSS property added: "outdent" - opposite of indent | |
88 | ||
89 | The HTML elements <dottab> and <textcircle> can now have CSS properties applied to them. | |
90 | ||
91 | ||
92 | Bug fixes | |
93 | --------- | |
94 | - SVG images - path including e.g. 1.234E-15 incorrectly parsed (not recognising capital E) | |
95 | - Tables - if a table starts when the Y position on page is below bottom margin caused endless loop | |
96 | - Float-ing DIVs - starting a float at bottom of page and it causes page break before anything output, second new page is forced | |
97 | - Tables - Warning notice now given in Table footer or header if <tfoot> placed after <tbody> and table spans page | |
98 | - Columns - block with border-width wider than the length of the border line, line overflows | |
99 | - Columns - block with no padding containing a block with borders but no backgound colour, borders not printed | |
100 | - Table in Columns - when background color set by surrounding block element - colour missing for height of half bottom border. | |
101 | - TOCpagebreakByArray() when called by function was not adding the pagebreak | |
102 | - Border around block element - dashed not showing correctly (not resetting linewidth between different edges) | |
103 | - Double border in table - when background colour set in surrounding block element - shows as black line between the 2 bits of double | |
104 | - Borders around DIVs - "double" border problem if not all 4 sides equally - fixed | |
105 | - Borders around DIVs - solid (and double) borders overlap as in tables - now fixed so mitred joins as in browser | |
106 | [Inadvertently improves borders in Columns because of change in LineCap] | |
107 | - Page numbering - $mpdf->pagenumSuffix etc not suppressed in HTML headers/footers if number suppressed | |
108 | - Page numbering - Page number total {nbpg} incorrect - e.g. showing decreasing numbers through document, when ToC present | |
109 | - RTL numerals - incorrectly reversing a number followed by a comma | |
110 | - Transform to uppercase/lowercase not working for chars > ASCII 128 when using core fonts | |
111 | - TOCpagebreak - Not setting TOC-FOOTER | |
112 | - TOCpagebreak - toc-even-header-name etc. not working | |
113 | - Parsing some relative URLs incorrectly | |
114 | - Textcircle - when moved to next page by "page-break-inside: avoid" | |
115 | - Bookmarks will now work if jump more than one level e.g. 0,2,1 Inserts a new blank entry at level 1 | |
116 | - Paths to img or stylesheets - incorrectly reading "//www.domain.com" i.e. when starting with two / | |
117 | - data:image as background url() - incorrectly adjusting path on server if MPDF_PATH not specified (included in release mPDF 5.6.1) | |
118 | - Image problem if spaces or commas in path using http:// URL (included in release mPDF 5.6.1) | |
119 | - Image URL parsing rewritten to handle both urlencoded URLs and not urlencoded (included in release mPDF 5.6.1) | |
120 | - <dottab> fixed to allow color, font-size and font-family to be correctly used, avoid dots being moved to new page, and to work in RTL | |
121 | - Table {colsum} summed figures in table header | |
122 | - list-style-type (custom) colour not working | |
123 | - <tocpagebreak> toc-preHTML and toc-postHTML can now contain quotes | |
124 | ||
125 | ||
126 | ||
127 | =========================== | |
128 | mPDF 5.6 | |
129 | 20/01/2013 | |
130 | =========================== | |
131 | ||
132 | Files changed | |
133 | ------------- | |
134 | mpdf.php | |
135 | config.php | |
136 | includes/functions.php | |
137 | classes/meter.php | |
138 | classes/directw.php | |
139 | ||
140 | ||
141 | config.php changes | |
142 | ------------------ | |
143 | $this->allowedCSStags - added HTML5 tags + textcircle AND | |
144 | $this->outerblocktags - added HTML5 tags | |
145 | $this->defaultCSS - added default CSS properties | |
146 | ||
147 | ||
148 | New features / Improvements | |
149 | --------------------------- | |
150 | CSS support added for for min-height, min-width, max-height and max-width in <img> | |
151 | ||
152 | Images embedded in CSS | |
153 | <img src="data:image/gif;base64,...."> improved to make it more robust, and | |
154 | background: url(data:image... now added to work | |
155 | ||
156 | HTML5 tags supported | |
157 | - as generic block elements: <article><aside><details><figure><figcaption><footer><header><hgroup><nav><section><summary> | |
158 | - as in-line elements: <mark><time><meter><progress> | |
159 | - <mark> has a default CSS set in config.php to yellow highlight | |
160 | - <meter> and <progress> support attributes as for HTML5 | |
161 | - custom appearances for <meter> and <progress> can be made by editing classes/meter.php file | |
162 | - <meter> and <progress> suppress text inside the tags | |
163 | ||
164 | Textcircle/Circular | |
165 | font: "auto" added: automatically sizes text to fill semicircle (if both set) or full circle (if only one set) | |
166 | NB for this AND ALL CSS on <textcircle>: does not inherit CSS styles | |
167 | attribute: divider="[characters including HTML entities]" added | |
168 | <textcircle r="30mm" top-text="Text Circular Text Circular" bottom-text="Text Circular Text Circular" | |
169 | divider=" • " style="font-size: auto" /> | |
170 | ||
171 | » ’ ‚ „ are now included in "orphan"-management at the end of lines | |
172 | ||
173 | Improved CJK line wrapping (if CJK character at end of line, breaks there rather than previous wordspace) | |
174 | ||
175 | NB mPDF 5.5 added support for <fieldset> and <legend> (omitted from ChangeLog) | |
176 | ||
177 | Bug fixes | |
178 | --------- | |
179 | - embedded fonts: Panose string incorrectly output as decimals - changed to hexadecimal | |
180 | Only a problem in limited circumstances. | |
181 | *****Need to delete all ttfontdata/ files in order for fix to have effect. | |
182 | - <textCircle> background white even when set to none/transparent | |
183 | - border="0" causing mPDF to add border to table CELLS as well as table | |
184 | - iteration counter in THEAD crashed in some circumstances | |
185 | - CSS color now supports spaces in the rgb() format e.g. border: 1px solid rgb(170, 170, 170); | |
186 | - CJK not working in table following changes made in v5.4 | |
187 | - images fixed to work with Google Chart API (now mPDF does not urldecode the query part of the src) | |
188 | - CSS <style> within HTML page crashed if CSS is too large (? > 32Kb) | |
189 | - SVG image nested int eht HTML failed to show if code too large (? > 32Kb) | |
190 | - cyrillic character p р at end of table cell caused cell height to be incorrectly calculated | |
191 | ||
192 | ||
193 | =========================== | |
194 | mPDF 5.5 | |
195 | 02/03/2012 | |
196 | =========================== | |
197 | ||
198 | Files changed | |
199 | ------------- | |
200 | mpdf.php | |
201 | classes/ttfontsuni.php | |
202 | classes/svg.php | |
203 | classes/tocontents.php | |
204 | config.php | |
205 | config_fonts.php | |
206 | utils/font_collections.php | |
207 | utils/font_coverage.php | |
208 | utils/font_dump.php | |
209 | ||
210 | Files added | |
211 | ----------- | |
212 | classes/ttfontsuni_analysis.php | |
213 | ||
214 | config.php changes | |
215 | ------------------ | |
216 | To avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>) | |
217 | $this->margBuffer = 0; // Allow an (empty) end of block to extend beyond the bottom margin by this amount (mm) | |
218 | ||
219 | config_fonts.php changes | |
220 | ------------------------ | |
221 | Added to (arabic) fonts to allow "use non-mapped Arabic Glyphs" e.g. for Pashto | |
222 | 'unAGlyphs' => true, | |
223 | ||
224 | Arabic text | |
225 | ----------- | |
226 | Arabic text (RTL) rewritten with improved support for Pashto/Sindhi/Urdu/Kurdish | |
227 | Presentation forms added: | |
228 | U+0649, U+0681, U+0682, U+0685, U+069A-U+069E, U+06A0, U+06A2, U+06A3, U+06A5, U+06AB-U+06AE, | |
229 | U+06B0-U+06B4, U+06B5-U+06B9, U+06BB, U+06BC, U+06BE, U+06BF, U+06C0, U+06CD, U+06CE, U+06D1, U+06D3, U+0678 | |
230 | Joining improved: | |
231 | U+0672, U+0675, U+0676, U+0677, U+0679-U+067D, U+067F, U+0680, U+0683, U+0684, U+0687, U+0687, U+0688-U+0692, | |
232 | U+0694, U+0695, U+0697, U+0699, U+068F, U+06A1, U+06A4, U+06A6, U+06A7, U+06A8, U+06AA, U+06BA, U+06C2-U+06CB, U+06CF | |
233 | ||
234 | Note - | |
235 | Some characters in Pashto/Sindhi/Urdu/Kurdish do not have Unicode values for the final/initial/medial forms of the characters. | |
236 | However, some fonts include these characters "un-mapped" to Unicode (including XB Zar and XB Riyaz, which are bundled with mPDF). | |
237 | 'unAGlyphs' => true, | |
238 | added to the config_fonts.php file for appropriate fonts will | |
239 | ||
240 | This requires the font file to include a Format 2.0 POST table which references the glyphs as e.g. uni067C.med or uni067C.medi: | |
241 | e.g. XB Riyaz, XB Zar, Arabic Typesetting (MS), Arial (MS) | |
242 | NB If you want to know if a font file is suitable, you can open a .ttf file in a text editor and search for "uni067C.med" | |
243 | - if it exists, it may work! | |
244 | Using "unAGlyphs" forces subsetting of fonts, and will not work with SIP/SMP fonts (using characters beyond the Unicode BMP Plane). | |
245 | ||
246 | mPDF maps these characters to part of the Private Use Area allocated by Unicode U+F500-F7FF. This could interfere with correct use | |
247 | if the font already utilises these codes (unlikely). | |
248 | ||
249 | mPDF now deletes U+200C,U+200D,U+200E,U+200F zero-widthjoiner/non-joiner, LTR and RTL marks so they will not appear | |
250 | even though some fonts contain glyphs for these characters. | |
251 | ||
252 | ||
253 | Other New features / Improvements | |
254 | --------------------------------- | |
255 | Avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>) | |
256 | using configurable variable: $this->margBuffer; | |
257 | ||
258 | ||
259 | The TTFontsUni class contained a long function (extractcoreinfo) which is not used routinely in mPDF | |
260 | This has been moved to a new file: classes/ttfontsuni_analysis.php | |
261 | The 3 utility scripts have been updated to use the new extended class: | |
262 | - utils/font_collections.php | |
263 | - utils/font_coverage.php | |
264 | - utils/font_dump.php | |
265 | ||
266 | ||
267 | Bug fixes | |
268 | --------- | |
269 | - Border & background when closing 2 blocks (e.g. </div></div>) incorrectly being moved to next page because incorrectly | |
270 | calculating how much space required | |
271 | - Fixed/Absolute-positioned elements not inheriting letter-spacing style | |
272 | - Rotated cell - error if text-rotate set on a table cell, but no text content in cell | |
273 | - SVG images, text-anchor not working | |
274 | - Nested table - not resetting cell style (font, color etc) after nested table, if text follows immediately | |
275 | - Nested table - font-size 70% set in extenal style sheet; if repeated nested tables, sets 70% of 70% etc etc | |
276 | - SVG setting font-size as percent on successive <text> elements gives progressively smaller text | |
277 | - mPDF will check if magic_quotes_runtime set ON even >= PHP 5.3 (will now cause an error message) | |
278 | - not resetting after 2 nested tags of same type e.g. <b><b>bold</b></b> still bold | |
279 | - When using charset_in other than utf-8, HTML Footers using tags e.g. <htmlpageheader> do not decode correctly | |
280 | - ToC if nested > 3 levels, line spacing reduces and starts to overlap | |
281 | ||
282 | ||
283 | ||
284 | ||
285 | =========================== | |
286 | mPDF 5.4 | |
287 | 14/02/2012 | |
288 | =========================== | |
289 | Files changed | |
290 | ------------- | |
291 | mpdf.php | |
292 | config.php | |
293 | compress.php | |
294 | classes/ttfontsuni.php | |
295 | classes/barcode.php | |
296 | classes/indic.php | |
297 | classes/svg.php | |
298 | examples/show_code.php ----- SECURITY RISK** | |
299 | examples/example49_changelog.php | |
300 | examples/example57_new_mPDF_v5-3_active_forms_b (replace example57_new_mPDF_v5-3_active_forms) | |
301 | includes/out.php | |
302 | mpdfi/fpdi_pdf_parser.php | |
303 | ||
304 | Files added | |
305 | ----------- | |
306 | classes/bmp.php | |
307 | classes/directw.php | |
308 | classes/form.php | |
309 | classes/grad.php | |
310 | classes/tocontents.php | |
311 | classes/wmf.php | |
312 | examples/example58_new_mPDF_v5-4_features | |
313 | ||
314 | config.php changes | |
315 | ------------------ | |
316 | Edited: $this->allowedCSStags, $this->innerblocktags, $this->defaultCSS; (CAPTION added in each case) | |
317 | Moved: Numerous $form_.. variables are now in /classes/form.php | |
318 | ||
319 | New config variables | |
320 | -------------------- | |
321 | $this->bookmarkStyles = array(); | |
322 | $this->cacheTables = true; | |
323 | ||
324 | New methods | |
325 | ----------- | |
326 | function CircularText() | |
327 | function SetVisibility() | |
328 | ||
329 | New/Extended CSS | |
330 | ---------------- | |
331 | box-shadow (block elements - does NOT support "inset") | |
332 | text-shadow (all text elements - does NOT support "blur") | |
333 | visibility: visible|hidden|printonly|screenonly (block-level elements and images IMG only) | |
334 | text-transform: capitalize|uppercase|lowercase (extended to support TD/TH) | |
335 | tr|td|th:nth-child(odd|even|2n+1) | |
336 | color, strikethrough, underline and background-color (extended to support rotated TD/TH) | |
337 | underline and strike-through (extended to support TD/TH) | |
338 | underline (line colour) (extended to work correctly in watermark) | |
339 | page-break-after: left|right|always (block elements and tables) | |
340 | NB respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed | |
341 | background[-color]: extended to support rgba|cmyka|cmyk|hsla|hsl|spot | |
342 | border(extended to support inline elements) | |
343 | ||
344 | ||
345 | New HTML | |
346 | -------- | |
347 | <caption> | |
348 | <textcircle /> | |
349 | ||
350 | ||
351 | New features / Improvements | |
352 | --------------------------- | |
353 | Tables - Zebra Stripes | |
354 | Tables: overlapping rowspans (partially) supported | |
355 | Tables - Disk caching | |
356 | Using progress bars (or $showStats) now reports 'real' memory usage i.e. get_memory_usage(true) | |
357 | Support for query string in the URLs for external stylesheets e.g. @import url("style.css?ltcyy7"); | |
358 | Table caption partially supported | |
359 | CircularText | |
360 | BookMark styling | |
361 | Spread tables i.e. can split table (columns) across several pages width. | |
362 | Can use chelvetica, ctimes and ccourier to specify core fonts in a non-core font document | |
363 | Spread tables i.e. can split table (columns) across several pages width. | |
364 | {colsum} in <tfoot> cell will insert a column total per page. | |
365 | SVG embedded as island in HTML supported | |
366 | Active Forms | |
367 | textarea and input (text types) now accept javascript as: | |
368 | onKeystroke, onValidate, onCalculate and onFormat | |
369 | onChange is depracated but works as onCalculate (for textarea and input) | |
370 | (PS Select still accepts onChange cf. 5.3.37) | |
371 | Ledger and Tabloid added as page formats recognised. NB Ledger is same as tabloid but landscape. In mPDF, both give the same size (portrait) | |
372 | so need to add -L e.g. Ledger-L for landscape. | |
373 | ||
374 | ||
375 | Internal script changes | |
376 | ----------------------- | |
377 | Changed this->k to _MPDFK throughout all scripts | |
378 | Changes to color (packed binary data in string rather than array) to reduce memory usage esp in tables | |
379 | Internal variables Removed | |
380 | $usetableheader; | |
381 | $tableheadernrows; | |
382 | $tablefooternrows; | |
383 | vars $ChangePage, $p_bottom_border, $img_margin_top(+) $issetcolor + other similar removed | |
384 | ||
385 | Removed a whole load of // comments | |
386 | Updates to remove some more Warning Notices (not all marked in text) | |
387 | Border set on TR - changed so set on each cell, rather than retrospectively at end of TR | |
388 | All references to table['text'] removed as not needed - uses ['textbuffer'] instead | |
389 | OpenTag(TD) changes to reduce memory usage with tables | |
390 | Includes different method to set a default timezone | |
391 | fn _smallCaps does not need (undefined) $space | |
392 | this->chrs and this->ords replaced by chr() and ord() | |
393 | Headers in out.php updated to match those used in Output() | |
394 | Change to SetFont() to improve performance time | |
395 | Change to GetStringWidth() to improve performance time | |
396 | Corrected copying of Glyphs 0,1,2, to all subset fonts (non-SMP/SIP), and only setting 32->127 in subset | |
397 | Subset fonts (non-SMP/SIP) have additionally Unicode CMap tables (0,0,4 and 0,3,4) as well as Microsoft (3,1,4) | |
398 | Subset fonts (SMP/SIP) have CMap tables (1,0,6 and 3,0,4) - rather than 1,0,6 and 3,0,6 | |
399 | Subset fonts (SMP/SIP) have 'name' table changed to give 1,0 and 3,0. As it is a symbol font (not Unicode encoded) : | |
400 | needs to have a name entry in 3,0 (e.g. symbol) - original font will have 3,1 (i.e. Unicode) | |
401 | Automatically checks for HTML code length > 100000 characters and gives error warning if | |
402 | PHP < 5.2.0 (as not configurable) or increases pcre.backtrack_limit if PHP < 5.3.7 | |
403 | ||
404 | Removed/Depracated | |
405 | ------------------ | |
406 | function UseTableHeader($opt=true) fn removed / depracated | |
407 | function UsePRE($opt=true) removed | |
408 | $attr['REPEAT_HEADER'] == true CSS removed / depracated | |
409 | $this->usepre=true; removed / depracated as never needed - always respects PRE whitespace | |
410 | ||
411 | ToC: NB Values can no longer be set directly e.g. as in example | |
412 | $mpdf->TOCheader = array(); // array as for setting header/footer | |
413 | $mpdf->TOCfooter = array(); // array as for setting header/footer | |
414 | $mpdf->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents | |
415 | $mpdf->TOCpostHTML = ''; // HTML text to appear after table of contents | |
416 | $mpdf->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none) | |
417 | Need to use TOCpagebreak either direct (or array version) or as HTML | |
418 | OR if absolutley necessary, could use: | |
419 | $mpdf->tocontents->TOCheader = array(); // array as for setting header/footer | |
420 | $mpdf->tocontents->TOCfooter = array(); // array as for setting header/footer | |
421 | $mpdf->tocontents->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents | |
422 | $mpdf->tocontents->TOCpostHTML = ''; // HTML text to appear after table of contents | |
423 | $mpdf->tocontents->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none) | |
424 | ||
425 | ||
426 | ||
427 | Further Details | |
428 | =============== | |
429 | ||
430 | CSS border on inline elements | |
431 | ----------------------------- | |
432 | Support for CSS border (and variants) on inline elements e.g. <span style="border-bottom: 1px dashed #000000;"> | |
433 | Border styles solid|dotted|dashed|double only are supported. Border radius not supported. | |
434 | Nested inline elements will have repeat left|right borders on the nested content (unlike browsers) | |
435 | ||
436 | Tables - Zebra Stripes | |
437 | ---------------------- | |
438 | TABLE - striped rows cf. http://dev.opera.com/articles/view/zebra-striping-tables-with-css3/ | |
439 | tr:nth-child(odd) { background-color: #99ff99; } | |
440 | thead tr:nth-child(3n+2) { background-color: #FFBBFF; } | |
441 | td:nth-child(2n+1) { background-color: #BBBBFF; } | |
442 | table.zebraTable td:nth-child(2n+1) { background-color: #BBBBFF; } | |
443 | table.zebraTable th:nth-child(2n+1) { background-color: #BBBBFF; } | |
444 | ||
445 | NB mPDF does NOT correctly apply specificity to all CSS | |
446 | table.zebra tbody tr:nth-child(2n+1) td { background-color: #FFFFBB; } | |
447 | table.zebra tbody td:nth-child(odd) { background-color: #BBBBFF; } | |
448 | ||
449 | should make every odd row yellow, and every odd coloumn blue, but with the row/yellow overriding the column/blue. | |
450 | 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 | |
451 | table.zebra tbody tr:nth-child(2n+1) td:nth-child(1n+0) { background-color: #FFFFBB; } | |
452 | ||
453 | (The :nth-child(1n+0) selector just selects every td cell.) | |
454 | ||
455 | ||
456 | ||
457 | Tables - Disk caching | |
458 | --------------------- | |
459 | TABLES: using disk caching | |
460 | // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased | |
461 | // executon time and disk access (read and write) | |
462 | $this->cacheTables = true; | |
463 | NB $this->packTableData will be overridden to => true; // required for cacheTables | |
464 | $this->simpleTables will be overridden to => false; // Cannot co-exist with cacheTables | |
465 | ||
466 | ||
467 | Table caption | |
468 | ------------- | |
469 | Must come immediately after <table...> | |
470 | CSS caption-side and HTML align attribute of top|bottom supported (not attribute left|right) | |
471 | Handled as a separate block element brought outside the table, so: | |
472 | CSS will not cascade correctly on the table | |
473 | width of caption block is that of page or of the block element containing the table | |
474 | so alignment will be to the page-width not the table width | |
475 | if table page-break-after: always, the caption will follow the pagebreak. | |
476 | This does work: | |
477 | <style> | |
478 | .tablecaption { caption-side: bottom; text-align: left; font-weight: bold; color: green; } | |
479 | </style> | |
480 | ... | |
481 | <table> | |
482 | <caption class="tablecaption">Caption title here</caption> | |
483 | <tbody> | |
484 | ||
485 | CSS visibility: printonly, screenonly | |
486 | ------------------------------------- | |
487 | Roughly based on CSS | |
488 | ||
489 | Works on Block elements P, DIV etc, or Image | |
490 | Cannot nest / layer. | |
491 | Inner blocks/image with set visibility are ignored if already set on enclosing block element. | |
492 | (Block element) does not work inside table (image does) | |
493 | So 'visible' does nothing but is set as default | |
494 | (NB Changes output to PDF version 1.5) | |
495 | Incompatible with PDFA / PDFX | |
496 | ||
497 | 'visibility' | |
498 | Value: visible | hidden | (collapse | inherit) | |
499 | Initial: visible | |
500 | Applies to: all elements | |
501 | Inherited: yes | |
502 | ||
503 | The 'visibility' property specifies whether the boxes generated by an element are rendered. | |
504 | Invisible boxes still affect layout (set the 'display' property to 'none' to suppress box generation altogether). | |
505 | Values have the following meanings: | |
506 | ||
507 | visible | |
508 | The generated box is visible. | |
509 | hidden | |
510 | The generated box is invisible (fully transparent, nothing is drawn), but still affects layout. | |
511 | Furthermore, descendants of the element will be visible if they have 'visibility: visible'. | |
512 | collapse | inherit | |
513 | NOT supported in mPDF | |
514 | ||
515 | CUSTOM: | |
516 | printonly | screenonly | |
517 | ||
518 | ||
519 | Added VISIBILITY function | |
520 | $mpdf->SetVisibility('screenonly'); or 'printonly' 'visible' or 'hidden' | |
521 | (NB Changes output to PDF version 1.5) | |
522 | Incompatible with PDFA / PDFX | |
523 | ||
524 | CircularText | |
525 | ------------ | |
526 | function CircularText($x, $y, $r, $text, $align='top', $kerning=120, $fontwidth=100) { | |
527 | x: abscissa of center | |
528 | y: ordinate of center | |
529 | r: radius of circle | |
530 | text: text to be printed | |
531 | align: text alignment: top or bottom. Default value: top | |
532 | kerning: spacing between letters in percentage. Default value: 120. Zero is not allowed. | |
533 | fontwidth: width of letters in percentage. Default value: 100. Zero is not allowed | |
534 | ||
535 | - now uses Kerning between letters if useKerning == true (set manually see example) | |
536 | ||
537 | BookMark styling | |
538 | ---------------- | |
539 | New configurable variable to control appearance of Bookmarks e.g. | |
540 | $this->bookmarkStyles = array( | |
541 | 0 => array('color'=> array(0,64,128), 'style'=>'B'), | |
542 | 1 => array('color'=> array(128,0,0), 'style'=>''), | |
543 | 2 => array('color'=> array(0,128,0), 'style'=>'I'), | |
544 | ); | |
545 | ||
546 | Column sums | |
547 | ----------- | |
548 | (Also changed some preg_replace to str_replace to improve performance) | |
549 | To use: just add {colsum} to any cells of the table footer <tfoot> | |
550 | Content-type: text/html ]>