Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 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="&nbsp;&bull;&nbsp;" style="font-size: auto" />
170
 
171
&raquo; &rsquo; &sbquo; &bdquo; 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 &#1088; 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
 
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
Add a number to specify a fixed number of decimal points e.g. <td>£{colsum2}</td>  will give you £123.40
551
The width of the column will be calculated using the actual string {colsum} as a placeholder.
552
If you need the column to be wider, use underscores "_" to pad it e.g. {colsum2_____}
553
 
554
 
555
Spread tables
556
-------------
557
i.e. can split table (columns) across several pages width.
558
CSS <table style="overflow: visible">
559
Cannot use with:
560
$this->kwt - ignored
561
$this->table_rotate - ignored
562
$this->table_keep_together - ignored
563
$this->ColActive  - cancels spread tables
564
 
565
Messes up with:
566
$mpdf->forcePortraitHeaders = true;
567
$mpdf->forcePortraitMargins = true;
568
Problems with CJK, and RTL
569
 
570
Will do no resizing of fonts at all.
571
Maximum width of column = page width i.e. will not split columns across pages - NB will keep colspan>1 on one page
572
If table row too high for page will die with error message.
573
Will override some specs for width if this creates conflicts
574
Recommended to specify absolute value of width on each column.
575
 
576
 
577
 
578
 
579
Bug fixes
580
=========
581
Dottab - if text after dottab is hyperlinked <a></a> then dots are underlined
582
 
583
page-break-before now respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
584
Annotation() function called directly with colorarray(r,g,b)
585
 
586
Added urldecode to _getImage to cope with ../name%20of%20image.jpg
587
Added urldecode AND htmlspecials_decode to href in <a> link e.g. https://www.google.com/search?hl=en&amp;q=mpdf&amp;filename=name%20of%20file
588
[barcode.php] Allow &nbsp; in C39 codes - will be changed to spaces
589
 
590
<table> inside a <div position:fixed, left:300px;> not calculating table width correctly
591
	- leading to either upside down table or error width less than 1 character
592
 
593
Depracated magic_quotes_runtime() in compress.php
594
 
595
DIRECTW included twice in compress.php
596
FORMS mark up for compress.php corrected
597
 
598
double backslashes not preserved inside <pre> or <textarea>
599
 
600
font-weight and font-style not recognised in <pageheader>
601
 
602
Progress bars causing corrupt PDF file (out.php) changed fopen from "r" mode to "rb" (binary)
603
Target around image - <a href="#internaltarget"><img ... /></a> - not working
604
 
605
SmallCaps in <thead> error
606
 
607
Fonts with "name" table in format 1 not recognised correctly
608
Rotated table which does not fit on remaining page, forces a new page even if already at top of page
609
 
610
Locale causing problems - all instances of sprintf() using %.3f changed to %.3F so not locale aware
611
 
612
CSS border radius not implemented on fixed/absolute positioned block element
613
 
614
Background color in rotated table extending way beyond bottom of table
615
 
616
Nested table containing <thead> or <tfoot> was confused with <thead> or <tfoot> of parent table
617
 
618
Correct handling of spaces, < or & in textarea
619
 
620
<option> and <input ..> attributes value/title decoded with fn lesser_entity_decode instead of htmlspecialchars_decode to include &apos;
621
 
622
line width not restored to correct value after "line-through" text in Cell()
623
 
624
Kannada - incorrect positioning of Reph
625
 
626
Forms - In <input> or <option> (select) not correctly handling HTML named entities e.g. &lt; in value or title
627
Active forms - &nbsp; as Value or Title incorrectly showing as Euro - PDFDocEncoding fixed
628
 
629
Unicode data in embedded fonts not encrypted when doc encrypted
630
 
631
Nested block elements which are empty including innermost one, top margin of innermost block was ignored
632
 
633
font-size: xx% inside a block was setting on block's parent font-size
634
 
635
Active forms - radio buttons (removed name from Widget - leave on Radio group)
636
	causing problems accessing field for radio buttons
637
 
638
When using simple tables and border-collapse, if table border set, but cell borders not set, should display table border (fixed)
639
position:fixed block - if neither top nor bottom nor height specified, was positioned incorrectly (y)
640
Leave - if top, bottom, margin-top, margiin-bottom and height are all left unspecified (or auto), will centre vertically
641
on the page (specific to mPDF - not consistent with CSS2.1)
642
But if any one of them are specified (including e.g. margin-top=0), follows CSS spec, so top is the current "static" position
643
 
644
background-image-opacity=0 not working on BODY or BLOCK
645
 
646
Lists - if LI continues after a nested List, would add as a new LI item (should continue as part of earlier LI item)
647
 
648
fn WriteCell() converts to 'windows-1252' when required
649
if multiple calls to mPDF used, cannot redefine function cmp()
650
internal link targets <a name="xx" /> in ToC not moved when using: page-break-inside:avoid
651
internal link targets <a name="xx" /> not moved when using: columns, page-break-inside:avoid, keep-with-table or table rotate
652
 
653
Active Forms - onChange not working for SELECT (cf. 5.3.25) Example 57 only worked by chance as JS was carried over from Select to Text field
654
Bug is fixed, but example file needed updating to onCalculate for the display field.
655
 
656
Table cell: if height set as %, currently sets it as % of page-width; instead this now ignores it.
657
 
658
Bengali letter Khanda Ta (U+09CE) character not recognised; was added in Unicode v4.1 and prior to this, (U+09A4 U+09CD U+200D)
659
	so mPDF converts to this string and seems to work.
660
 
661
OCR characters wrong size in barcodes if using different ocr font - fixed
662
 
663
===========================
664
mPDF v5.3   (21/07/2011)
665
===========================
666
 
667
New Features
668
------------
669
- Active forms (see on-line manual for details)
670
- 128-bit encryption (optional) with additional user-permissions (see on-line manual)
671
 
672
PLEASE READ - Change in Font management
673
---------------------------------------
674
The font name imported from the font and included by mPDF in the PDF file was stripping any '-' in the name.
675
This is the PostScript name which is utilised by some PostScript programmes.
676
mPDF has been changed to leave the PostScript font name unchanged. In 99% cases no difference will be noted, but
677
you MUST delete all the temporary font data files cached in the  /ttfontdata/ folder for this to be effective.
678
 
679
 
680
Minor changes
681
-------------
682
If @page CSS is used to select a first page with settings different from the default, mPDF did create a blank page
683
	then pagebreak to the new @page settings - this has been changed so it now will start with the new page settings.
684
 
685
New function added: DeletePages($start_page, $end_page=-1)  e.g. $mpdf->DeletePages(1);
686
	Can be used just before calling Output()
687
 
688
compress.php utility extended to exclude active forms and images-svg
689
 
690
 
691
Bug fixes
692
---------
693
- list-style-type: (custom version, user-defined bullet) colour change not working if colour is set on the list item line
694
- background-image: SVG or WMF images as background-images in tables/tr/cells not working
695
- font-weight: bold font not always reset after inline <b>...</b> thus miscalculating width
696
- forms (inactive) in 'c' core fonts using unicode characters 127-255 incorrect display in input text and button text
697
- form elements (inactive) if in-line with mixed size fonts, error in vertical positioning of text related to box
698
- ToC: wrapped lines in ToC not retaining formatting e.g. bold style
699
- HTMLHeaders: using setAutoTopMargin="pad"; not correctly setting top margin for first page
700
- output headers changed: Content-length not used if server uses output compression
701
- embedded font subsets from fonts which contain non-BMP plane 0 characters (incl. e.g. dejavusanscondensed)
702
	- causing Adobe Reader to create a CJK encoded font subset internally when loading interactive Forms
703
	- Changed so unsets the flag in the subset font to show no non-BMP characters.
704
 
705
 
706
Configurable variables added (see config.php file):
707
--------------------------------------------------
708
All for Active Forms:
709
$this->useActiveForms
710
$this->formExportType
711
$this->formSubmitNoValueFields
712
$this->formSelectDefaultOption
713
$this->form_border_color
714
$this->form_background_color
715
$this->form_border_width
716
$this->form_border_style
717
$this->form_button_border_color
718
$this->form_button_background_color
719
$this->form_button_border_width
720
$this->form_button_border_style
721
$this->form_radio_color
722
$this->form_radio_background_color
723
 
724
PLUS: see additional values added to $this->allowedCSStags close to bottom of file - required for Active forms
725
 
726
 
727
Updated files
728
-------------
729
mpdf.php
730
config.php  (NB as well as form stuff at top, 5.2.07 $this->allowedCSStags close to bottom of file)
731
compress.php
732
classes/ttfontsuni.php
733
examples/example57...
734
examples/formsubmit.php
735
 
736
 
737
 
738
===========================
739
mPDF v5.2   (18/06/2011)
740
===========================
741
 
742
New Features
743
------------------
744
Improvements in font handling resulting in clearer display of fonts on screen, and improved compatibility with PostScript drivers
745
	(e.g. use with GSView/GhostScript, see below)
746
 
747
CJK line-breaking implemented (roughly) according to rules. Configurable variables allow control of behaviour (except in tables).
748
 
749
Viewer preferences: added options for initial 2 page display where you can specify whether
750
	1st page is on left or right (cf. SetDisplayMode).
751
 
752
Custom list-style-type for a list (ul,ol) or a list-item (li) in which you can determine the character and colour of the bullet:
753
	list-style-type: U+263Argb(255,0,0); - where U+263A is the Unicode HEX value of the character you want for the bullet
754
	- character MUST be included in the font used for that list item. rgb() bit is optional
755
 
756
 
757
Bug fixes
758
---------
759
- Fonts: embedding a BMP TTC font (e.g. Cambria) as a full font caused error
760
- Table: If cell width set by CSS as %, and page-break-inside avoid requires a new page, was losing the sizing
761
- Table: table borders CSS parsing error; if border-width, border-style, border-color set, not inherited correctly
762
- Table: Table background image or gradient not working in HTMLHeader/Footer
763
- Table: background color set on table (anywhere) will overwrite image/gradient
764
- Table Background image/gradient: If left/right margin is set on table, gradient/image set on table is too wide
765
- Table: rotated table - height (after first page does not correctly allow for thead i.e. too much)
766
- Table: blank <tr></tr> causes error
767
- Table/Letter-spacing: If letter-spacing set inside table, not calculating table width correctly, and if oversized, freezes
768
- ToC: ToC at top of page (non-mirrored or already ODD) did not reset page_number if told
769
- Character subsititutions: characters missed if first element in a $html code e.g. WriteHTML('Not in a tag &#10003;');
770
- Kerning: kerning info: if reading font file for first time (or if not cached in ttfontdata/) did not register kerning info
771
- Textarea: multiple new lines run into only one newline
772
- QRCode - colors wrong because QRcode class only accepts RGB input (hardcoded now to always give black on white)
773
- QRCode always producing "Your message here"
774
- Columns: if transforming height of column, not always closing transform Q
775
- CakePHP compatibility
776
- compress.php - error due to markup comments in mpdf.php script file
777
 
778
Backwards compatibility
779
-----------------------
780
Changes in mPDF 5.2 are backwards compatible with version 5.1
781
Your document fonts may appear slightly different in the PDF viewer because of the changes to embedded font subsets (cf.)
782
The new Indic fonts may result in a change in spacing (due to the different character width of the space character from the original font)
783
 
784
PostScript e.g. GSView/GhostScript
785
----------------------------------
786
A number of errors have been reported when opening mPDF-created PDF files with a PostScript programme. Some of the errors were due to mPDF,
787
but others were due to peculiarities of GSView/GhostScript.
788
- Diacritic Characters were not displayed when embedding a font subset
789
- Fonts containing SIP/SMP characters (supplementary Unicode planes) caused errors
790
- Error with text justification (word-spacing) when embedding a full font can occur in some fonts*
791
The first 2 problems should now be fixed in v5.2
792
*The error with text justification can be optionally fixed by setting the configurable variable in config.php:
793
	$this->repackageTTF = true;
794
	When mPDF embeds a full font, it simply embeds the whole original TTF file into the PDF document. For some fonts (containing
795
	a GSUB table) this was causing problems. $this->repackageTTF forces mPDF to repackage the original TTF file excluding some of
796
	the tables like GSUB.
797
(See ADDITIONAL INFO FONTS.txt in downloaded files)
798
 
799
 
800
Font appearance in PDF viewer
801
-----------------------------
802
Font subsetting has been improved to include additional information in the embedded file. Overall the effects are of greater clarity
803
when viewing the document on a screen (it will not affect print output), but the changes are dependent on:
804
- the original TTF font i.e. the options that the font's author has built into the file
805
- the PDF viewer i.e. whether the programme chooses to use the available information
806
- the resolution (zoom) of the page you are viewing
807
(See ADDITIONAL INFO FONTS.txt in downloaded files)
808
 
809
 
810
Indic fonts
811
-----------
812
A new set of Indic fonts (ind_xx_1_001) is distributed with version 5.2 containing the additional font information as described above.
813
In addition, some changes have been made to the ASCII characters in the font from the files previously distributed:
814
The original files (Raghu font files) do not contain the characters a-z and A-Z. When the first version indic files were created for mPDF,
815
ALL of the ASCII characters (32-127) were inserted/overwritten from DejaVuSansCondensed to make the font more usable.
816
In the latest version, only the missing characters are taken from DejaVuSansCondensed, leaving punctuation and numerals from the original
817
fonts. This also means that the space character has a different width, and this will cause slight changes to the word spacing in documents.
818
(See ADDITIONAL INFO FONTS.txt in downloaded files)
819
 
820
 
821
CJK line-breaking (text wrapping)
822
---------------------------------
823
CJK (chinese-japanese-korean) text often contains no spaces. mPDF previously has wrapped text whenever a character reached the end of
824
the line. mPDF version 5.2 attempts to follow the line-breaking rules described for each of the languages. Configurable variables
825
allow some control over this behaviour, especially whether to squeeze a character into the space available at the end of a line, or
826
whether to allow it to overflow the right margin.
827
 
828
 
829
Configurable variables (see config.php file):
830
----------------------
831
Control wrapping of CJK text:
832
	$this->allowCJKorphans = true;	// FALSE=always wrap to next line; TRUE=squeeze or overflow
833
	$this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only selected)
834
When Embedding full TTF font files, remakes the font file using only core tables
835
May improve function with PostScript printers
836
	$this->repackageTTF = false;
837
 
838
Updated files
839
-------------
840
mpdf.php
841
compress.php
842
utils/font_dump.php
843
classes/ttfontsuni.php
844
config.php (3 new variables - see above)
845
 
846
All ttfonts/ind_*
847
New set of Indic fonts for PostScript compatibilty - and clearer font display
848
 
849
 
850
 
851
===========================
852
mPDF v5.1   (27/02/2011)
853
===========================
854
 
855
New Features
856
------------
857
- CSS background (images, colours or gradients) on <TR> and <TABLE>
858
- CSS border on <TR> (only in border-collapsed mode)
859
- support for Mozilla and CSS3 gradient syntax:
860
	-moz-linear-gradient, linear-gradient
861
	-moz-radial-gradient, radial-gradient
862
	-moz-repeating-linear-gradient, linear-repeating-gradient
863
	-moz-repeating-radial-gradient, radial-repeating-gradient
864
- expanded support for gradients (including in SVG images):
865
	- multiple colour 'stops'
866
	- opacity (transparency)
867
	- angle and/or position can be specified
868
- gradient can be used as an image mask (custom mPDF styles: gradient-mask)
869
- image-orientation supported for <IMG> (similar to existing custom mPDF attribute: rotate) [CSS3]
870
- image-resolution supported for <IMG> [CSS3]
871
- background-image-resolution (custom mPDF CSS-type style) to define resolution of background images
872
- improved support for SVG images
873
- SVG and WMF images supported in background-image
874
- file attachments
875
- numeric list-styles added e.g. arabic-indic, bengali, devanagari, persian, thai [CSS3]
876
- font kerning supported (inter-character spacing between specific pairs)
877
- letter-spacing and word-spacing supported [CSS3]
878
- colors supported as rgb(), rgba(), hsl(), hsla(), cmyk(), cmyka(), or spot()
879
- spot colors supported e.g PANTONE 310 EC
880
- PDF/X compatible files
881
- optionally force use of grayscale, RGB or CMYK colorspace
882
- automatic colour conversion for most objects between grayscale, RGB and CMYK
883
 
884
Backwards compatibility
885
-----------------------
886
Most changes in mPDF 5.1 are backwards compatible with version 5.0 i.e. your documents should
887
look the same running 5.1   However some changes may alter display from previous versions:
888
- RTL (right-to-left) languages - see below
889
- bleed margins when using @page CSS - see below
890
- Default distance for "cross" from inner margin changed 10->5mm [hardcoded in fn. Footer()]
891
- If height set on a block element, will force a new page if set-height will not fit on page
892
- If table rotated, 5mm margin at bottom is now reduced to 1mm
893
- If image is too big for page and automatically sixed to maximum height of page, 10mm margin at bottom reduced to 1mm
894
 
895
Colours may appear more vibrant
896
-------------------------------
897
Unless specifically set, Adobe Reader uses the RGB colorSpace by default when displaying documents. However
898
if an image or gradient using transparency (or alpha channel) is included in the document, Adobe Reader
899
automatically sets the default colorSpace to CMYK - which makes the colours look less vibrant/bright on screen.
900
mPDF 5.1 now specifies by default a colorSpace RGB for each page, and this will maintain the more
901
vibrant colours. This is overridden if you use on of the options to restrict the colorSpace (cf.)
902
 
903
RTL
904
---
905
**** IMPORTANT - PLEASE READ IF USING RTL SCRIPTS ****
906
Handling of RTL (right-to-left) languages has been significantly rewritten, and is likely to cause
907
changes to the resulting files if you have previously been using mPDF. The changes have made mPDF
908
act more like a browser, respecting the HTML/CSS rules.
909
Changes include:
910
- the document now has a baseline direction; this determines the
911
	- behaviour of blocks for which text-align has not been specifically set
912
	- layout of mirrored page-margins, columns, ToC and Indexes, headers and footers
913
	- base direction can be set by any of:
914
		- $mpdf->SetDirectionality('rtl');
915
		- <html dir="rtl" or style="direction: rtl;">
916
		- <body dir="rtl" or style="direction: rtl;">
917
	- base direction is an inherited CSS property, so will affect all content, unless...
918
- direction can be set for all HTML block elements e.g. <DIV><P><TABLE><UL> etc using
919
	- CSS property < style="direction: rtl;">
920
	- direction can only be set on the top-level element of nested lists
921
	- direction can only be set on <TABLE>, NOT on THEAD, TBODY, TD etc.
922
	- nested tables CAN have different directions
923
- NOTE that block/table margins/paddings are NOT reversed by direction
924
	NB mPDF <5.1 reversed the margins/paddings for blocks when RTL set.
925
- language (either CSS "lang", using Autofont, or through initial set-up e.g. $mpdf = new mPDF('ar') )
926
	no longer affects direction in any way.
927
	NB config_cp.php has been changed as a result; any values of "dir" set here are now ineffective
928
- default text-align is now as per CSS spec: "a nameless value which is dependent on direction"
929
	NB default text-align removed in default stylesheet in config.php
930
- once text-align is specified, it is respected and inherited
931
	NB mPDF <5.1 reversed the text-align property for all blocks when RTL set.
932
- the configurable value $rtlcss is depracated, as it is no longer required
933
- improved algorithm for dtermining text direction
934
	- english word blocks are handled in text reversal as one block i.e. dir="rtl"
935
	[arabic text] this will not be reversed [arabic text]
936
	- arabic numerals 0-9 handled correctly
937
 
938
Although the control of direction for block elements is now more configurable, the control of
939
text direction (RTL arabic characters) remains fully automatic and unconfigurable.
940
<BDO> etc has no effect. Enclosing text in silent tags can sometimes help e.g.
941
	content<span>[arabic text]</span>content
942
 
943
Justified text
944
--------------
945
Text-align: justify - no longer uses configurable variable $jSpacing= C | W | ''
946
The default value is for mixed letter- and word-spacing, set by jSWord and jSmaxChar
947
If a line contains a cursive script (RTL or Indic [devanagari, punjabi, bengali]) then it prevents letter-spacing
948
for justification on that line - effectively the same as setting letter-spacing:0
949
Spacing values have been removed from the config_cp.php configuration file, so the "lang" property
950
(in config_cp) no longer determines justification behaviour (this includes the use of Autofont()).
951
When using RTL or Indic [devanagari, punjabi, bengali] scripts, you should set CSS letter-spacing:0
952
whenever you use text-align:justify.
953
 
954
 
955
@page media
956
-----------
957
When using @page to create a print publication with page-size less than sheet-size
958
- bleed margin is now configurable (also crop- and cross-mark margins)
959
- backgrounds/gradients/images now use the bleed box as their "container box"
960
- odd-header-name: supports the value "_default" - allows current non-HTML header to remain unchanged
961
- marks: crop cross; i.e. both together supported
962
- background-image-opacity and background-image-resize now work with @page CSS
963
 
964
 
965
SVG images - extended support
966
-----------------------------
967
- support for spreadMethod property for gradients (repeat and reflect)
968
- support for style="font-family; font-size; font-style; font-weight" i.e. inline CSS
969
- when viewPort="" and width="" height="" all specified, uses width to set SVG size of a "pixel"
970
- support for opacity and multiple "stops" (and colorspace) in gradients
971
 
972
 
973
 
974
Minor Enhancements
975
------------------
976
- support for colors as rgb(87%, 56%, 25%) [used especially in SVG]
977
- added option of "NoPrintScaling" in SetDisplayPreferences
978
- compress.php - now combines BACKGROUND-IMAGES and GRADIENTS as BACKGROUNDS, and added PROGRESS-BAR
979
- table with THEAD row will force a new page if no room for the THEAD AND a row from TBODY
980
- Small-Caps now works properly together with text-align justify
981
- embedded font subsets restructured (minor) for greater compatibility e.g. with Postscript printers
982
- PDF/A will convert everything except grayscale to RGB (by default) or CMYK (optionally)
983
 
984
 
985
 
986
 
987
Bug fixes
988
---------
989
- Display changed to CMYK colour gamut when document contained an object with transparency set.
990
	Now will retain RGB colorspace (brighter colours)
991
- If using dir="rtl", tables containing nested tables were not properly reversed
992
- "text-rotate: 0" set in CSS stylesheet did not 'undo' any text-rotate set on the row (TR)
993
- Malayalam - character re-ordering
994
- If height set on a block element, was not taking account of padding top/bottom
995
- embedded font subsets: error in array of Font Widths fixed
996
- <style>..</style> containing /* import url() */ the comments were not ignored
997
- If call mPDF class more than once, error using multiple barcodes or gif files because classes not reinstantiated
998
- Floating blocks were collapsing bottom/top margins - incorrectly
999
- Table: if colspan>1 contents are wider than the width of the included columns, did not increase column width(s) to accommodate
1000
- Resizing table - script hanging and new page forced when not required (still)
1001
- If a table style="page-break-inside:avoid" not fit on the page, was adding new page before resizing EVEN IF on a blank page
1002
- End of 2 blocks (e.g. </div></div>) at very bottom of page, forcing unwanted pagebreak
1003
- Corrected handling of tags inside <pre>
1004
- RTL left-aligned text - line ending with <br /> not correctly left-aligned
1005
- <input type=submit|reset etc name="xxx" e.g. Google button showed as I&039;m feeling lucky
1006
- Annotations all linked to Page 1 (parent object)
1007
- Error "division by zero" using columns
1008
- MultiCell() and Write() [direct writing functions] - miscalculating length of line in non-core fonts (+ other bugs)
1009
- error if CJK space at end or beginning of line with 0x20 spaces in as well
1010
 
1011
Configurable variables (see config.php file):
1012
----------------------
1013
$this->printers_info
1014
$this->bleedMargin
1015
$this->crossMarkMargin
1016
$this->cropMarkMargin
1017
$this->cropMarkLength
1018
$this->nonPrintMargin
1019
$this->restrictColorSpace
1020
$this->PDFX
1021
$this->PDFXauto;
1022
$this->useKerning
1023
[$this->rtlcss removed]
1024
 
1025
Updated files
1026
-------------
1027
mpdf.php
1028
config.php
1029
config_cp.php (removed references to dir - but not essential to update - just redundant information)
1030
compress.php
1031
includes/out.php
1032
includes/functions.php
1033
classes/svg.php
1034
classes/ttfontsuni.php
1035
classes/indic.php
1036
/font/helvetica*.php and /times*.php
1037
 
1038
Added CSS support
1039
=================
1040
All Block elements including <BODY> <TABLE> <TR>
1041
------------------------------------------------
1042
background-image-resolution: normal | [ from-image || <dpi> ]
1043
direction: [ rtl | ltr ]	(HTML attribute dir also supported)
1044
background: [ gradients ]
1045
background-image: [gradients ]
1046
 
1047
For [ gradients ] syntax see:
1048
- Mozilla linear - https://developer.mozilla.org/en/CSS/-moz-linear-gradient
1049
- Mozilla radial - https://developer.mozilla.org/en/CSS/-moz-radial-gradient
1050
- Mozilla gradients use - https://developer.mozilla.org/en/Using_gradients
1051
- CSS3 linear gradients - http://dev.w3.org/csswg/css3-images/#linear-gradients
1052
- CSS3 radial gradients - http://dev.w3.org/csswg/css3-images/#radial-gradients
1053
 
1054
 
1055
Almost all elements - block and in-line
1056
---------------------------------------
1057
font-kerning: auto | normal | none	// need to set $mpdf->useKerning = true;
1058
letter-spacing: normal | <length>
1059
word-spacing: normal | <length>
1060
 
1061
Colours
1062
-------
1063
Anywhere that color is specified (e.g. color, background-color, borders)
1064
- rgb(255,255,255)
1065
- rgba(255,255,255,1)		// last value is transparency (alpha) - between 0-1
1066
- rgb(100%,100%,100%)
1067
- hsl(360,100%,100%)		// H: 0-360; S/L: 0-100%; a:0-1
1068
- hsla(360,100%,100%,1)
1069
- cmyk(100,100,100,100)		// or 0-100%
1070
- spot(COLOR NAME, 100%)	// e.g PANTONE 310 EC; use AddSpotColor() to define first
1071
 
1072
<TR>
1073
border:
1074
 
1075
<TABLE> <TR>
1076
background:
1077
background-color:
1078
background-image:
1079
 
1080
<IMG>
1081
gradient-mask: [can use any of the gradient syntax]
1082
image-orientation: <angle>				- supports deg, rad or grad
1083
image-resolution: normal | [ from-image || <dpi> ]
1084
 
1085
<OL|UL>
1086
list-style: arabic-indic | bengali | devanagari | gujarati | gurmukhi | kannada | malayalam | oriya |
1087
		persian | telugu | thai | urdu | tamil
1088
 
1089
 
1090
@page
1091
marks: [ crop || cross ]		- i.e. crop and cross can be used together
1092
odd-header-name: "_default"		- allows current non-HTML header to remain unchanged
1093
background-image-opacity: [ 0-1 ]
1094
background-image-resize: [ 1-6 ]	- see Manual
1095
 
1096
 
1097
===========================
1098
mPDF v5.0   (30/09/2010)
1099
===========================
1100
 
1101
New Features
1102
------------
1103
- Font handling simplified, reads TrueType font files directly
1104
 
1105
 
1106
Minor Enhancements
1107
------------------
1108
- rotation of fixed-position block elements (see example 10 and manual for supported CSS)
1109
- support for CSS Small-Caps font-variant added
1110
- utility scripts in /utils/ folder to help font management
1111
- new simplified functions AddPageByArray() and TOCPageBreakByArray() added
1112
- progress bar simplified and customisable
1113
- improved word-wrapping for CJK langauges
1114
- improved recognition of CJK/Indic/Arabic characters
1115
- invalid UTF-8 input now outputs a meaningful error by displaying input html with errors marked
1116
- GIF or PNG images with transparency/interlaced/non-standard compression handled as internal data
1117
	if /tmp/ folder is not present or writeable
1118
- support for <html dir="rtl">
1119
- support for "display: none" on inline elements
1120
- annotations supported in fixed-position block elements
1121
 
1122
 
1123
Bug fixes
1124
---------
1125
- <br /> preceded by space does not correctly text-align to right
1126
- zero-width character in middle of line caused line-break (e.g. diacritic or U+200C = ZWNJ)
1127
- HTML attributes not recognised if spaces e.g. 'src = "..."'
1128
- Headers changed for output - problem reported on IE8 64-bit using SSL
1129
- using SetAutoPageBreak(false) used caused unexpected behaviour with table rows at page break
1130
- (from Beta) incorrect check for temporary font data folder causing errors
1131
- artificial Bold/Italic not working in table cell when using rotated text
1132
- allow <dottab> to inherit font color correctly
1133
- SVG now works with Adobe 7
1134
- background in header overwriting text
1135
- vertical text in table header not correctly horizontally positioned when repeated
1136
- compatibility with PHP >= 4.3 (htmlspecialchars_decode, stripos)
1137
- updated depracated script PHP 5.3.0 ($string{1} to $string[1], $var =& new Object(), set_magic_quotes_runtime)
1138
- index (CreateIndex) number string incorrect if arabic(rtl) text anywhere in document
1139
- MultiCell incorrectly calculate string length/width when using core fonts
1140
- page-break-inside:avoid - used with non-HTML footer had space inserted for footer height
1141
- page-break-inside:avoid - error if more than 1 page height but not enough to trigger second pagebreak
1142
- page-break-inside:avoid - incorrectly layering page backgrounds (headers and content brought forward)
1143
 
1144
 
1145
Changes from 5.0 Beta
1146
---------------------
1147
If you are upgrading from the Beta version - you MUST delete all files in the  /ttfontdata/ temporary directory
1148
- config.php file has been changed (extra CJK characters to recognise CJK blocks)
1149
- $this->backupSubsFont (in config_fonts.php) optionally now takes an array
1150
- no need to define 'cjk'=>true or 'sip|smp'=>true in config_fonts.php (ignored; cf. $this->BMPonly)
1151
- Indic language fonts have been altered to add Latin and Latin-1 Supplement characters
1152
- progress bars now has an external progbar.css and configurable main heading
1153
- added initial parameter new mPDF('+aCJK') or '-aCJK' to override default useAdobeCJK at runtime
1154
- QRCode is not included in main download (but as an extra package)
1155
 
1156
BACKWARD COMPATIBILITY
1157
----------------------
1158
If you have been using earlier versions of mPDF, most scripts should work as before. But note:
1159
- Arial, Helvetica, Times and Courier are now treated like any other font
1160
- the whole CSS font string is parsed e.g. style="font-family:'Lucida Grande';" will look for a font 'lucidagrande'
1161
and not 'lucida'
1162
 
1163
Configurable variables (see config.php file):
1164
----------------------
1165
- $mpdf->useSubstitutionsMB is now depracated, but will work as an alias for $mpdf->useSubstitutions
1166
The initial parameters e.g. new mPDF('utf-8') have all changed. Old ones may be recognised, or will be ignored.
1167
- $mpdf->useOnlyCoreFonts is now depracated and is ignored. Use new mPDF('c')
1168
- $this->use_CJK_only is now depracated and is ignored. See $this->useAdobeCJK and new mPDF('+aCJK') or '-aCJK'
1169
Control SmallCaps appearance
1170
- $mpdf->smCapsScale = 0.75;	// Factor of 1 to scale capital letters
1171
- $mpdf->smCapsStretch = 115;	// % to stretch small caps horizontally
1172
Customisable Progress bar
1173
- $mpdf->progbar_heading = 'mPDF file progress';
1174
- $mpdf->progbar_altHTML = '';
1175
Control fonts/subsetting
1176
- $mpdf->maxTTFFilesize = 2000;
1177
- $mpdf->percentSubset = 30;
1178
- $mpdf->debugfonts			// show font errors and warnings
1179
Replaceable alias
1180
- $mpdf->iterationCounter = false;	// Allow use of {iteration varname} in THEAD
1181
 
1182
 
1183
===========================
1184
mPDF v5.0Beta   (21/07/2010)
1185
===========================
1186
 
1187
New features
1188
------------
1189
The main change in mPDF v5 is the handling of TTF and TTC fonts directly.
1190
See README.txt and FONT INFO.txt for more information
1191
 
1192
 
1193
QR-code (2-dimensional barcode) Added
1194
-------------------------------------
1195
type="QR"
1196
Size=1 is an arbitrary 25mm widthxheight. error="L|M|H|Q"
1197
text="" can be numeric, alphanumeric or binary(?)
1198
Required whitespace is always included around it
1199
 
1200
 
1201
Enhancements
1202
------------
1203
- progress-bar is simplified (no javascript class)
1204
- dir="rtl" supported in <html> or <body> tag
1205
 
1206
Bug fixes
1207
---------
1208
- artificial Bold/Italic now working in table cells with rotated text
1209
- "-" is now allowed in a font name e.g. sun-exta
1210
- <dottab> now inherits font color correctly
1211
- SVG class bugs fixed (was crashing in Adobe Reader v 7)
1212
- background color/image in header no longer overwrites the header text
1213
 
1214
Changed Config variables
1215
------------------------
1216
$this->useSubstitutionsMB is depracated
1217
Character substitution always occurs when using core fonts.
1218
Use $this->useSubstitutions for all cases.
1219
 
1220
 
1221
New Configurable variables
1222
--------------------------
1223
$this->useAdobeCJK = true;		// Uses Adobe CJK fonts for CJK languages
1224
			// default TRUE; only set false if you have defined some available fonts that support CJK
1225
			// If true this will not stop other CJK fonts if specified by font-family:
1226
			// and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
1227
 
1228
// Set maximum size of TTF font file to allow non-subsets - in kB
1229
// Used to avoid e.g. Arial Unicode MS (perhaps used for substituteCharsMB) to ever be fully embedded
1230
// NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
1231
$this->maxTTFFilesize = 2000;
1232
 
1233
// If not -s (i.e. forced subset) this value determines whether to subset or not
1234
// 0 - 100 = percent characters
1235
// i.e. if ==40, mPDF will embed whole font if >40% characters in that font
1236
// or embed subset if <40% characters
1237
// 0 will force whole file to be embedded
1238
// 100 will force always to subset
1239
$this->percentSubset = 30;
1240
 
1241
$this->debugfonts - show errors and warnings for font parsing
1242
 
1243
Config variables removed
1244
------------------------
1245
$this->use_CJK_only
1246
$this->useOnlyCoreFonts
1247
 
1248
================================================================================
1249
 
1250
====
1251
4.6
1252
====
1253
 
1254
mPDF
1255
 
1256
files changed:
1257
mpdf.php
1258
config.php
1259
makefonts/makefonts.php
1260
class/t1asm.php
1261
class/svg.php
1262
graph.php
1263
 
1264
examples_04 (images)
1265
 
1266
config var added:
1267
$this->tableMinSizePriority
1268
 
1269
4.5.015
1270
Bug fix:
1271
Complex page with ToC entries ++ (example_ToC_bug4_5_015.php) caused Apache to crash
1272
AdjustHTML() preg_pattern for matching <hx>... </hx>  <table for keep-together - altered and fixed ? matching
1273
Seemed to crash when content="Graph 12" between the <h> - 2 numbers (12) crash, 1 didn't!!!
1274
 
1275
 
1276
4.5.014
1277
Bug fix:
1278
Using TrueType fonts, unused font is not embedded in the PDF doc. This was fine except an error message appeared after printing in Adobe Reader,
1279
because Font reference /F1 still present in doc pointing to non-existent resource.
1280
Edited so that the reference is now removed from the page if font unused.
1281
 
1282
 
1283
4.5.013
1284
Enhancement
1285
TrueTypeUnicode fonts width array inserted as shortened form array (smaller file size)
1286
 
1287
4.5.012
1288
Bug fix: Incorrect handling orphan characters in table
1289
(cf. http://mpdf.bpm1.com/forum/comments.php?DiscussionID=193 fixed in 4.2 - but going back to it still problems)
1290
If xxxxx. fits but xxxxx.. doesn't: WriteFlowingBlock wraps it to next line, TableWordWrap sqeezed it onto one line
1291
TableWordWrap fixed to only allow one orphan char. even if it fits with that one.
1292
 
1293
 
1294
4.5.011
1295
Added Windows BMP image support
1296
 
1297
4.5.010
1298
SVG class:
1299
- improved recognition of lineargradients/radialgradients referenced by xlink:href
1300
- does not die if empty text string
1301
- support for many text properties as style="" as well as currently as attributes (bold, fill etc)
1302
- if using MB font, was respecting "Times" and "Courier" from the SVG file but using as ANSI not utf-8
1303
 
1304
4.5.009
1305
graph.php updated to include SVG - need to define in graph.php (as well as set up TTF fonts)
1306
(SVG graph does not include CSIM, 3D skew.)
1307
 
1308
4.5.008
1309
t1asm.php has an error in the error message if .dat fontfile not found (".char.dat")
1310
 
1311
4.5.007
1312
Bug fix: Using page-break-inside:avoid, if nothing would have been printed on page 1 before next page, elements going all over the place!
1313
	Also problem shifting images - fixed
1314
	Also wasn't shifting WMF/SVG images - fixed
1315
 
1316
4.5.006
1317
New config var
1318
$this->tableMinSizePriority = false;
1319
If page-break-inside:avoid but cannot fit on full page without
1320
exceeding autosize; setting this value to true will force respsect for
1321
autosize, and disable the page-break-inside:avoid
1322
[NB edit Manual Table>>autolayout algorithm]
1323
 
1324
 
1325
4.5.005
1326
Bug fix
1327
Table set to avoid page-break-inside: in some circumstances entered loop with recalculating size
1328
Fudge factor added of 0.001 in tbsqrt to calculate shrink factor
1329
 
1330
4.5.004
1331
Bug fix
1332
If table set to avoid page-break-inside and table height (resized) exactly==remaining page - was triggering page break
1333
Fudge factor added of 0.001 in tablewrite to query pagebreak
1334
 
1335
4.5.003
1336
Bug fix in makefonts/makefonts.php
1337
Also changed the links in Step4 & 8 which move the newly created files to the font directory - will now show error message if error -
1338
will NOT overwrite existing files. (Put in manual already)
1339
 
1340
4.5.002
1341
Bug fix in class/t1asm.php
1342
If you have magic_quotes_runtime set On - problems using embedded subset.
1343
 
1344
4.5.001
1345
JPG "Exif" file recognised from header, and handled much more quickly and efficiently (not using GD)
1346
 
1347
 
1348
 
1349
===========================
1350
mPDF v4.5   (21/04/2010)
1351
===========================
1352
 
1353
New Features
1354
------------
1355
The main change in 4.5 is the improved class for importing SVG images. (See details below)
1356
 
1357
Font files
1358
----------
1359
Some bugs in the "makefonts" utility caused some errors in the files produced for embedding font subsets.
1360
Surprisingly these are not easily detectable (I have yet to find one!).
1361
All the font files used for embedding font subsets (the .dat and .dat.php files in /unifont/ folder)
1362
have been re-generated. Download them if you are having problems with any fonts - otherwise, you probably
1363
don't need to bother.
1364
 
1365
Minor Enhancements
1366
------------------
1367
If keepColumns = true (i.e. disable readjustment of column length), mPDF will now reproduce
1368
table header/footer rows in each column [4.4.015]
1369
 
1370
A number of changes to improve processing time [4.4.012]
1371
[Thanks to carlholmberg http://mpdf.bpm1.com/forum/comments.php?DiscussionID=274&page=1#Item_3]
1372
 
1373
JPG files with header marked as "progressive DCT-based JPEG" are now supported [4.4.004]
1374
 
1375
Configurable variable (config.php) $dpi can be set to vary size interpreted from "px" values in HTML/CSS
1376
NB Recommended that $dpi should always be set the same as $img_dpi
1377
 
1378
Support added for "ex" as a size value (approximates "ex" as half of font height)
1379
 
1380
Configurable variable (config.php) $watermarkImgAlphaBlend will determine how watermark images
1381
will blend with underlying objects.
1382
 
1383
 
1384
Bug fixes
1385
---------
1386
- Make-fonts utility : makefonts/makefonts.php [4.4.016]
1387
	(All font files have been updated)
1388
- Table header of only one column width - not printing right border [4.4.014]
1389
- WMF and SVG images not rotating correctly to 90 or -90 degrees [4.4.013]
1390
- Using templates, error if imported doc contains templates itself [4.4.001]
1391
 
1392
 
1393
Updated Files
1394
-------------
1395
mpdf.php
1396
config.php
1397
classes/svg.php
1398
makefonts/makefonts.php
1399
ALL subset font files (/unifont/ .dat and .dat.php files), and all garuda and norasi files
1400
 
1401
New files
1402
---------
1403
None
1404
 
1405
New config variables
1406
--------------------
1407
$this->watermarkImgAlphaBlend
1408
$this->dpi
1409
 
1410
BACKWARD COMPATIBILITY
1411
----------------------
1412
All but one changes in mPDF 4.5 are fully backwards compatible.
1413
The configurable variable $this->watermarkImgBehind was introduced in v4.4 and was unintentionally set to TRUE
1414
In v4.5 this is set to FALSE in the config.php file.
1415
 
1416
 
1417
SVG Images
1418
----------
1419
[svg.php CHANGED]
1420
- Text stroke-width default changed to 1 [4.4.011]
1421
- Text stroke - line-join type changed [4.4.010]
1422
- Default value for fill changed to "black" [4.4.008]
1423
- Bug fixes:
1424
  * to correct calculation of text-length (and therefore alignment R and C) [4.4.009]
1425
  * Corrected errors in path implementation esp. quadratic Bezier curves
1426
  * rounded corners to rectangles - error corrected
1427
  * Recognition of font-family improved
1428
  * remove \n (and other non-printable chars) from text
1429
  * zero length shapes are not output e.g. zero-width rectangle, zero-length line, zero-radius circle
1430
- Support added for:
1431
  * gradient stop offsets and gradientUnits="userSpaceOnUse" [4.4.007]
1432
	In mpdf.php enabled define inner radius for radial gradients - only used internally by SVG at present
1433
  * user defined <ENTITY /> cf. 'render-elems-03-t.svg' in SVG Test Suite [4.4.006]
1434
  * "color" attribute and "currentColor" value for fill and stroke [4.4.005]
1435
  * fill:url(#...) in a style as well as attribute
1436
  * xlink:href for gradients
1437
  * 1.3002e-005 in svg path
1438
  * text-style changes (e.g. text-anchor) set on <g> element - not just on <text>
1439
  * fill-rule=evenodd|nozero
1440
  * dashed lines / stroke-dasharray & stroke-dashoffset
1441
  * gradientUnits=userSpaceOnUse;
1442
  * units e.g. 3mm or 14pt in Rectangle, Circle, Ellipse, Line and Text position
1443
  * transform on <text> element
1444
  * stroke as well as fill on text
1445
 
1446
NB The following are still NOT supported for SVG
1447
- filters
1448
- <marker>
1449
- images
1450
- DOM
1451
- <pattern>
1452
- textlength; lengthadjust; tspan, tref, toap, textPath;
1453
- <use ../>
1454
- gradient on stroke/text;
1455
- <clipPath>
1456
- text-underline and strikethrough
1457
- text opacity
1458
- colors as rgb(87%, 56%, 25%)
1459
- rect using units for dimensions
1460
- Only uses default spreadMethod = "pad" for gradients
1461
 
1462
 
1463
 
1464
 
1465
 
1466
===========================
1467
mPDF v4.4   (24/03/2010)
1468
===========================
1469
 
1470
New Features
1471
------------
1472
- Support SVG image files (partial)
1473
- Rotate images or graphs (by multiples of 90 degrees)
1474
- Set opacity (transparency) for background images
1475
- Control resizing of background images
1476
- Set whether to print watermark images behind or in front of page contents
1477
- Reduced memory usage when printing tables (partly configurable)
1478
- Option to set path to folder for temporary files
1479
- Improved compliance for CSS text-align justify
1480
- Increased support for CSS "media"
1481
- Improved performance when accessing local image files
1482
 
1483
 
1484
Minor Enhancements
1485
------------------
1486
- Allows space in output file name e.g. $mpdf->Output('t est.pdf','D'); [4.3.007B]
1487
- Header changed in Output to improve compatability with IE6 (affects 'D' and 'I') [4.3.012B]
1488
- background-images do not show noimage.jpg if missing [4.3.012D]
1489
- simpleTables (which improves performance) now also allows: background-color, -gradient and -image, padding
1490
	and rotated text to be set for each cell. Only borders are not supported cell-by-cell. [4.3.006]
1491
 
1492
 
1493
Bug fixes
1494
---------
1495
- Page width not correctly reset when defining default page margins (L/R) by @page [4.3.007C]
1496
- Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.3.005]
1497
	NB This should have been fixed in [4.2.028] but got left out!
1498
- UseSubstitutionsMB causes errors inside <textarea> and <select> so now disabled in these 2 situations [4.3.004]
1499
- CSS background: 'none' did not cancel background-image/background-color if it comes later [4.3.002, 4.3.011]
1500
- Warning message 'depracated' (as of PHP 5.3) when using Templates [4.3.007]
1501
- AutoFont incorrectly altering multibyte characters ending in \xa0 [4.3.012C]
1502
- "Initial" default value for border-width changed from 1px to 'medium' e.g. border-top: solid #000000; [4.3.010]
1503
- WMF image sometimes inverted [4.3.016]
1504
 
1505
Updated Files
1506
-------------
1507
mpdf.php
1508
config.php
1509
changelog.txt
1510
 
1511
 
1512
New files
1513
---------
1514
classes/svg.php
1515
 
1516
 
1517
New config variables
1518
--------------------
1519
$this->justifyB4br=false;
1520
$this->CSSselectMedia='print';
1521
$this->watermarkImgBehind = false;
1522
 
1523
BACKWARD COMPATIBILITY
1524
----------------------
1525
All changes are backwards compatible except the handling of some background-images - please see notes below.
1526
 
1527
 
1528
Watermark Image z-order
1529
-----------------------
1530
By default mPDF prints watermarks on top of the page contents to ensure that they are not hidden by backgrounds
1531
(especially table cells).
1532
You can specify watermark images to be printed behind page contents by setting a configurable variable:
1533
$this->watermarkImgBehind = true;  // default=false
1534
[4.3.018]
1535
 
1536
 
1537
Rotating Images and Graphs
1538
--------------------------
1539
Images or graphs can be rotated (by multiples of 90 degrees) using a custom HTML attribute e.g.
1540
<img rotate="90|-90|180" ... />
1541
<jpgraph rotate="90" ... />
1542
Valid options are: 90|-90|180.
1543
Positive values are clockwise.
1544
If width is specified e.g. width="3cm" this is applied to the rotated image i.e. will be width 3cm after rotating
1545
[4.3.016]
1546
 
1547
 
1548
Background Image Opacity
1549
------------------------
1550
A custom CSS property "background-image-opacity": is now supported on BODY, DIV+ (block elements) and TD
1551
Takes values between 0 and 1.0
1552
 
1553
 
1554
Resizing Background Images
1555
--------------------------
1556
A custom CSS property "background-image-resize": is now supported on BODY, DIV+ (block elements) and TD
1557
 
1558
1 - Shrink-to-fit w (keep aspect ratio)
1559
2 - Shrink-to-fit h (keep aspect ratio)
1560
3 - Shrink-to-fit w and/or h (keep aspect ratio)
1561
4 - Resize-to-fit w (keep aspect ratio)
1562
5 - Resize-to-fit h (keep aspect ratio)
1563
6 - Resize-to-fit w and h
1564
 
1565
N.B. Prior to v4.4 background-images were incorrectly constrained to maximum width of the containing block.
1566
The default is now to do NO resizing on background-images. Setting "background-image-resize:3" should be used
1567
for backwards compatibility.
1568
[4.3.015, 4.3.012D]
1569
 
1570
 
1571
SVG Image files
1572
---------------
1573
SVG image files are now partially supported (but as for WMF - not as background-images).
1574
viewBox (preserveAspectRatio is not supported)  viewBox="0 0 400 200"  width="400" height="200"
1575
Takes viewBox in preference to width/height if present on <svg>
1576
If neither present, will size to width of page (square) as the containing box.
1577
Units are interpreted as pixels if undefined.
1578
Doesn't recognise internal CSS <style> elements
1579
Gradients only take 2 colours which are taken as stop-offset 0% and 100%
1580
[4.3.013 & 4.3.017]
1581
 
1582
 
1583
Reduced Memory Usage printing Tables
1584
------------------------------------
1585
mPDF uses a lot of memory when processing large tables. Parts of the script have been rewritten to
1586
reduce memory consumption when writing tables which use collapsed borders (10-25% saving).
1587
 
1588
Memory usage can be reduced further by setting a configurable variable:
1589
$this->packTableData = true;  // default=false
1590
but note that this causes a significant increase in processing time.
1591
[4.3.008, 4.3.019, 4.3.014]
1592
 
1593
 
1594
 
1595
User-defined path to Temporary folder
1596
-------------------------------------
1597
mPDF uses a folder to write and store temporary files when processing images. By default this is the
1598
[your_path_to_mpdf]/tmp/
1599
This is now user-definable by defining the constant _MPDF_TEMP_PATH before including mpdf.php script.
1600
 
1601
 
1602
Text Justification
1603
------------------
1604
In a justified text block, an inline image, textarea, input, or select causing a new line will now force
1605
the previous line to be justified. HR and BR do NOT force justification (as in browsers).
1606
For optional compliance of MS Word behaviour, there is a new configurable variable:
1607
$this->justifyB4br = false;	// Change to true to force justification before a <BR> (as in MS Word)
1608
[4.3.003]
1609
 
1610
 
1611
CSS support for @media
1612
----------------------
1613
Now supports media-dependent CSS styles e.g.
1614
@media print {
1615
	p { color: red; }
1616
}
1617
as well as
1618
<style media="...">...</style> and
1619
<link rel="stylesheet" media="print" href="..." />
1620
Proper matching of CSS media to select using configurable variable:
1621
$this->CSSselectMedia='print';	//  default="print" set in config.php : screen, print, or any other CSS @media type (not "all")
1622
N.B. $this->disablePrintCSS in now depracated
1623
[4.3.001]
1624
 
1625
 
1626
 
1627
 
1628
===========================
1629
mPDF v4.3   (28/02/2010)
1630
===========================
1631
 
1632
NEW FEATURES
1633
------------
1634
- Page (sheet) size can be reset within document (http://mpdf1.com/manual/index.php?tid=436) [4.2.024, 4.2.025]
1635
- PDF/A1-b compliant files (http://mpdf1.com/manual/index.php?tid=420)
1636
- Improve performance using simpleTables (http://mpdf1.com/manual/index.php?tid=430)
1637
- mPDFI incorporated into main mPDF class (http://mpdf1.com/manual/index.php?tid=432)
1638
- <dottab> added as custom HTML tag: inserts dots to the following text, which is right-aligned [4.2.031]
1639
 
1640
See Example files 38 and 39 for PDFA compliant file and <dottab>
1641
 
1642
BACKWARD COMPATIBILITY
1643
----------------------
1644
All changes are backwards compatible except the use of mPDFI. You will need to make minor changes to your scripts.
1645
See the manual http://mpdf1.com/manual/index.php?tid=432 for details.
1646
 
1647
BUG FIXES
1648
---------
1649
- When using Table of Contents and not resetting page numbers: HTML headers/footers showed incorrect page number [4.2.020]
1650
- Table of Contents: last page not printing page background-color [4.2.023]
1651
- Image file with space " " in the file name failing [4.2.016]
1652
- Image file path unnecessarily resolved to full URI - changed to use relative path if possible [4.2.029] ***
1653
- Table - not calculating height of cell correctly [4.2.015, 4.2.012, 4.2.011, 4.2.009]
1654
- Table row breaking after/during cell when image in cell taller than font-height [4.2.008]
1655
- When Table row(cell) greater height than the page-height but requiring resizing greater than allowed by autosize - not resizing [4.2.005]
1656
- Table cell border not resized correctly [4.2.002]
1657
- Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.2.028] ****
1658
- Background-image in HTMLFooter not correctly setting 0,0 origin [4.2.014]
1659
- Background-image set as an in-line style not working [4.2.013]
1660
- Background-image set in CSS @page or <body> was being constrained to less than page size [4.2.032]
1661
- Imported Templates overwriting Headers (with images or gradients) [4.2.004]
1662
- When using imports/templates, HTML header with background-image causing page to disappear [4.2.001]
1663
- block-style element breaking over more than 2 pages incorrectly adjusting L/R margins [4.2.022]
1664
- CSS @page property "size" set on :left :right or :first pseudo-selectors - disabled [4.2.022]
1665
- Annotations default colour incorrectly set in PDF as [100 100 0] corrected to [1 1 0] (seemed to work ok?) [4.2.026]
1666
- Overwrite() now parses input file more tolerantly recognising more source files [4.2.030]
1667
 
1668
**** Bug fix 4.2.028 never got into the release of v4.3  Included in next release [4.3.005]
1669
**** Bug fix 4.2.029 never not fully implmented in v4.3  Included in next release [4.3.012]
1670
 
1671
Changed files
1672
-------------
1673
mpdf.php
1674
compress.php
1675
config.php
1676
classes/t1asm.php
1677
includes/functions.php
1678
mpdfi/fpdi_pdf_parser.php
1679
Added files/folder: /mpdfi/filters/*.*
1680
Added file/folder: /iccprofiles/sRGB_IEC61966-2-1.icc
1681
mpdfi/mpdfi.php (no longer required)
1682
 
1683
New Configuration variables
1684
---------------------------
1685
[config.php]
1686
$this->enableImports
1687
$this->simpleTables
1688
$this->PDFA
1689
$this->ICCProfile
1690
$this->PDFAauto
1691
 
1692
 
1693
Minor changes
1694
-------------
1695
Increased PDF file compatibility with spec 1.4
1696
- PDF version changed to 1.4
1697
- A binary file marker (a comment line with 4 characters > 127 ASCII) is added just after the first line
1698
- %%EOF no longer has line break after it [4.2.010]
1699
- /ID object is added to trailer object when not encrypted [4.2.010]
1700
 
1701
When using progress bars, one of the JS scripts is now referenced as an external file
1702
 to allow it to be cached by user's browser and improve performance for end-user [4.2.007]
1703
 
1704
Importing external PDF files: LZW encoded PDF files are now supported
1705
 
1706
When adding an annotation, the popup window can be set be either open or closed when the document is opened [4.2.027]
1707
- size and position of the popup can also be specified
1708
 
1709
 
1710
 
1711
===========================
1712
mPDF v4.2   (27/01/2010)
1713
===========================
1714
 
1715
NEW FEATURES
1716
------------
1717
- image handling improved
1718
- table layout - additional control over resizing
1719
- vertical-alignment of images - better support for all CSS types
1720
- top and bottom margins collapse between block elements
1721
- improved support for CSS line-height
1722
- display progress bar whilst generating file
1723
- CSS @page selector can be specified when adding a pagebreak
1724
- CSS @page selector allows different margins, backgrounds, headers/footers on :first :left and :right pages
1725
- PNG images with alpha channel fully supported
1726
- ability to generate italic and bold font variants from base font file
1727
- CJK fonts to embed as subsets
1728
- "double" border on block elements
1729
- character substitution for missing characters in UTF-8 fonts
1730
- direct passing of dynamically produced image data
1731
- background-gradient and background-image can now co-exist
1732
 
1733
 
1734
 
1735
Bug fixes
1736
---------
1737
- empty variable (undefined var, false, null, array() etc.) sent to WriteHTML produced error message "Invalid UTF-8"
1738
- CJK in tables when not using CJK (utf-8-s) autosized very small as characters did not word-wrap
1739
- parsing stylesheets: background image not recognised if containbed uppercase characters in file name
1740
- "double" border on table used white between the lines instead of current background colour
1741
- $this->shrink_tables_to_fit = 0 or false caused fatal errors
1742
- background color or images not printing correctly when breaking across pages
1743
- background not printed for List inside a block element
1744
- columns starting near end of page with no room for a line triggering column change (resulting in text misplaced) not page break
1745
- table cell not calculating cell height correctly when "orphan" characters (;:,.?! etc.) at end of line
1746
- table breaking page in column 2 when col 1 is rowspan'ned
1747
- margin-collapse at top of page not working if bookmark/annotation/indexentry/toc
1748
- column break triggered by HR triggering a second column break
1749
- an empty 'position:fixed' element with no/auto width or height caused fatal error
1750
- mPDFI: template documents were overwriting HTML headers
1751
- mPDFI: function Overwrite (to change text in existing PDF) - fatal error if using with encrypted file
1752
 
1753
Bug - not fixed
1754
- WriteHTML('',2) with '2' parameter not recognising 'margin-collapse:collapse' for DIVs or 'line-height' set in default CSS 'BODY'
1755
 
1756
 
1757
 
1758
New or Updated Files
1759
--------------------
1760
mpdf.php
1761
compress.php
1762
config.php
1763
config_cp.php
1764
config_fonts.php
1765
mpdf.css
1766
classes/gif.php
1767
classes/indic.php
1768
includes/subs_core.php
1769
mpdfi/mpdfi.php
1770
unifont/ar_k_001.uni2gn.php
1771
All files in new folder: /progress/*.*
1772
 
1773
NEW FOLDER /tmp/ required with read/write permissions - used for temporary image files or progress bars
1774
 
1775
 
1776
 
1777
 
1778
===========================
1779
mPDF v4.1.1  (21/12/2009)
1780
===========================
1781
Error corrected in /makefont/makefonts.php file (moved completed Unicode files to font folder instead of unifont)
1782
 
1783
===========================
1784
mPDF v4.1  (20/12/2009)
1785
===========================
1786
MySQL support for embedded font subsets abandoned, and replaced with file-based.
1787
 
1788
 
1789
Files no longer required
1790
------------------------
1791
config_db.php
1792
/unifont/RUNME.php
1793
/unifont/*.ufm and /unifont/*.t1a font files
1794
 
1795
MySQL Database no longer required
1796
 
1797
Files Updated
1798
-------------
1799
mpdf.php
1800
/classes/t1asm.php
1801
/makefont/makefonts.php
1802
 
1803
New files
1804
---------
1805
/unifont/*.dat and /unifont/*.dat.php font files
1806
 
1807
 
1808
Bug-fixes
1809
---------
1810
- Image - If automatically resizing to fit maximum page size incorrectly subtracted margin-header
1811
- Annotation and textarea in same HTML chunk causes mPDF to crash (preg_replace textarea with /u modifier in AdjustHTML)
1812
- set_magic_quotes_runtime error ($mgr not $mqr)
1813
- Table align did not reverse when using RTL document
1814
 
1815
Alteration: Image - if writing Image in fixedpos div position:absolute - to allow Image to be resized to full page size
1816
 
1817
 
1818
===========================
1819
mPDF v4.0  (17/12/2009)
1820
===========================
1821
 
1822
Major additions
1823
---------------
1824
- Ability to embed font subsets (creating much smaller files)
1825
- Much improved support for Arabic languages
1826
- Support for Indic languages including consonant conjuncts
1827
- Support for Fixed position block elements
1828
- New utility to help create your own fonts
1829
- PNG alpha channel transparency supported
1830
- New utility to create smaller mpdf script with reduced functionality (less memory)
1831
- Multiple Barcode types supported
1832
 
1833
**********************************************************************************************
1834
*  For more details see the documentation manual: http://mpdf1.com/manual/index.php?tid=410  *
1835
**********************************************************************************************
1836
 
1837
Bug fixes (parsing CSS)
1838
-----------------------
1839
- <link  href="" ... was not recognised if > 1 space between words
1840
- #Content p em { font-style:italic; } was applied to "#Content p"
1841
- @import url() embedded in a stylesheet file requires path fixed relative to stylesheet file
1842
- background-image url() embedded in a stylesheet file requires path fixed relative to stylesheet file
1843
- comment tags inside CSS <style> embedded in the HTML were removed
1844
    Now fixed so <style><!-- ... --></style> works; <!-- <style>...</style> --> is removed
1845
 
1846
Bug fixes (other)
1847
-----------------
1848
- clear (CSS property for floating elements) caused properties for that element to reset to defaults
1849
- width: auto caused collapse of border and padding on L & R of ordinary block elements
1850
- text-indent not inherited correctly (including em and % values)
1851
- named colour "steelblue" corrected RRGGBB hex code
1852
- table cell widths in %: if width of table cells set to >=100%, and not all columns are set
1853
	This was fixed in 3.2 but led to problem where 2 cols: 1) 80% and 2) not set (see Table sizing test)
1854
	Now fixed again to work for both(?)
1855
- parse PNG error fixed
1856
- bachground-image not correctly positioned in HTMLFooter and HTMLHeader (Not fixed properly in 3.2!)
1857
- fonts not supported with 0-9 in the name
1858
- font list in GetCodepage() in htmltoolkit.php (now config_cp.php) containing space " " not recognised
1859
- list number positioning
1860
- list font size set in CSS for UL/OL not working for first level list
1861
- table width (real value, not %) not working in nested table
1862
- GIF file failed if PDF file not compressed
1863
- list-style-type incorrectly inherited
1864
- line-height inheritance in lists
1865
- SetColumns added a new line - not required if at start of document/page
1866
- footer_line_spacing did not work
1867
- table cellPadding="" overwrote cell padding set on cell CSS
1868
- could not turn off Default non-HTML foter LINE
1869
- border specified as "em"
1870
- default values set in mpdf.css overriden by inherited properties e.g. <div><h1>Here</h1></div> lost font-size for H1
1871
 
1872
 
1873
 
1874
===========================
1875
mPDF v3.2  (25/10/2009)
1876
===========================
1877
Bug fixes
1878
---------
1879
- Table cell widths in %: if width of table cells set to >=100%, and not all columns are set -> froze, because tries to produce a column of no width
1880
- Ouput download file changed to allow compatability with IE6 (http://mpdf.bpm1.com/forum/comments.php?DiscussionID=120&page=1#Item_4)
1881
- Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com) [attempted fix in 3.1 not working]
1882
- Table: if font changed in cell, font was not retoring properly afterwards causing errors (restoreInlineProperties())
1883
- Lists: list items containing <br />, font not restoring after bullet
1884
- Graceful support for block elements inside list items e.g. <li><p>... (not supported, but tolerated)
1885
- Index: Created dividing letters separately for Uppercase and lowercase
1886
- Incorrectly changing input character set when encountering e.g. charset=iso-8859-1 in the text of the document
1887
	- Changed so only detects it if within <head>...</head>
1888
- If Keep-with-table (i.e. H1-6 before table and use_kwt true), if pagebreak forced anyway, borders did not print on previous page
1889
- Background-image used in HTML footer not appearing (correctly)
1890
- RTL tables: nested tables will not automatically transpose L->R
1891
- "Keep heading with table" - changed to allow <h1 style=".."> not just <h1>
1892
- "Keep heading with table" - backgrounds (bgcolor, image or gradient) incorrectly handled - now removed
1893
- Rotated table spread over more than 1 page caused enclosing block background colours to be be rotated along with table
1894
- CSS text-indent % now correctly suported (% of containing block width)
1895
- CSS width em on a block element e.g. DIV now correctly suported
1896
- calculating _tableheight, if remainingpage==0, get error (div by zero)
1897
- Table moved to next page with page-break-inside=avoid, produced an enlarged table (font)
1898
- RTL text-align override on BODY text was not working consistently
1899
- Arab characters: Character &#x647; (HEH) appearing in Final presentation form instead of Isolated
1900
- Vertical position of background-image on whole page incorrect
1901
- SetProtection can now be used with no permissions set (was not working unless at least one permission set)
1902
 
1903
 
1904
Developers
1905
----------
1906
Some more undefined indexes and variables declared (courtesy of DSmart http://mpdf.bpm1.com/forum/comments.php?DiscussionID=117&page=1#Item_0 )
1907
Comment lines removed for < v3.0 to tidy up code
1908
 
1909
 
1910
Enhancements
1911
------------
1912
CSS style height now partially supported on block elements DIV, P, H1 etc. --IF--
1913
	- block is all on one page
1914
	- will extend the block but not shorten it
1915
	- will not force a pagebreak (max. at bottom of page)
1916
	- % is interpreted as % of printable page height (inside margins)
1917
<TFOOT> now supported (placed at start as in HTML spec) displays at end of table, and repeats as a footer
1918
Background-image and background-gradient now supported in TD and TH (works in all cases except: background-image is not rotated or
1919
	positioned correctly if table is rotated)
1920
NB Background images and background-gradients do not work if Columns are being used, or if $use_kwt is TRUE (keep-with-table),
1921
	 or if page-break-inside:avoid is active.
1922
 
1923
 
1924
Updated files
1925
-------------
1926
mpdf.php
1927
htmltoolkit.php
1928
 
1929
 
1930
 
1931
 
1932
===========================
1933
mPDF v3.1  (30/08/2009)
1934
===========================
1935
 
1936
Bug fixes
1937
---------
1938
- Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com
1939
was giving http://www.yourdomain.com//image.png) [3.1]
1940
- Errors in parsing background CSS (background-repeat, background-position etc) [3.1]
1941
- Textarea did not corectly convert width or height in units relating to font e.g. em [3.0beta_01]
1942
- If page margin-bottom set to zero, SetHTMLfooter() crashes with "Division by zero" error [3.0beta_01]
1943
- Table with header row and rowspan in tbody, not calculating maxrowheightcorrectly
1944
- Prevent Index breaking column just after a dividing letter
1945
- Select or input form field when text around it is justified had text in the form field justified
1946
- TocBookMarkText needs to be htmlspecialchar-ed - decoded when entered inside <tocpagebreak>
1947
- <img src="" /> caused crash
1948
- DisplayPreferences used as a variable name and a function: function renamed to SetDisplayPreferences()
1949
- Image with src file not including a "." incorrectly parsed (e.g. http://www.domain.com/imagegenerator?params=23)
1950
 
1951
New Features
1952
------------
1953
- var $debug (true|false) default false; show or hide error reporting at output stage [3.1]
1954
- var $autoPageBreak (true|false) default true; allows overriding of automatic page breaks [3.0beta_02]
1955
- <indexinsert /> HTML equivalent of CreateIndex() [was CreateReference()]
1956
- 2nd attribute/parameter "xref" in IndexEntry() and <indexentry> - works like IndexEntrySee() as cross-reference entry
1957
- function SetWatermarkText allows null parameters to be passed i.e. SetWatermarkText() - will clear the WatermarkText
1958
- <watermarktext content="" alpha="" /> - HTML equivalent of SetWatermarkText()
1959
- <watermarkimage src="" alpha="" position="" size="" /> - HTML equivalent of SetWatermarkImage()
1960
 
1961
Documentation
1962
-------------
1963
See Manual at http://mpdf.bpm1.com/manual/ for more information - especially:
1964
- User's Guide>>What Else Can I Do?>>Backgrounds & Borders
1965
- User's Guide>>What Else Can I Do?>>Floating blocks
1966
 
1967
Files updated:
1968
-------------
1969
mpdf.php
1970
htmltoolkit.php
1971
graph.php
1972
 
1973
 
1974
Developers only
1975
---------------
1976
mPDF<=3.1 generated a large number of warning "Notices" if run with full eror_reporting on, due to array indexes not being initiated e.g.
1977
$arr = array();
1978
...
1979
if ($arr['index'] == 5 ) {...}
1980
 
1981
To prevent this, lines were added at the start of the mpdf.php script to turn error notices OFF.
1982
In a move towards making mPDF able to run with full error_reporting on, a large amount of the script has been altered
1983
e.g. the line above would be changed to:
1984
if (isset($arr['index'] && $arr['index'] == 5 ) {...}
1985
 
1986
Although I have tested this with a number of examples, it is almost certainly not complete. Therefore the error_reporting for Notices is still turned
1987
off in mPDF 3.1
1988
If you care to test it, please uncomment line 43 (//error_reporting(E_ALL);) and report any warning notices that you get.
1989
NB This has added about 40kB to the script size.
1990
 
1991
 
1992
 
1993
===========================
1994
mPDF v3.0beta  (14/06/2009)
1995
===========================
1996
 
1997
 
1998
New Features
1999
------------
2000
- CSS "float" partially supported (as well as clear:left|right|both)
2001
- CSS "background-image" "background-position" "background-repeat" "background-color" "background" supported for block-level elements
2002
- CSS background-color and background-image for <body > element added: this covers the whole page i.e. not just inside the "margins"
2003
- CSS background-color and background-image can be defined for CSS @page{}
2004
- Background gradients (linear or radial) can be defined using a custom CSS style property
2005
- Border radius can be defined to give rounded edges to block elements (uses draft CSS3 spec.)
2006
- page number can be reset to any value during the document (in AddPage() <pagebreak> etc.)
2007
- PNG images: Interlaced and alpha-channel-set PNG images now supported
2008
- internal links supported in Indexes (parameter added to CreateIndex()/CreateReference(): $useLinking=true;)
2009
- HTML Headers and footers now support hyperlinks
2010
- improved handling of <br>, block elements, and text lines inside table - approximates better to browser handling
2011
- borders of block-level elements & table cell borders supported (partially) in columns
2012
- optional error reporting for problems with Images ($showImageErrors)
2013
- ToC will word-wrap long entries
2014
- internal links (Bookmarks, IndexEntry and ToCEntry) rewritten to give more accurate positioning (when used as <tag>)
2015
- autofont algorithm improved for CJK languages
2016
- define text before and after page numbers ($pagenumPrefix; $pagenumSuffix; $nbpgPrefix; $nbpgSuffix;)
2017
- Additional color names supported - full list from SVG1.0
2018
 
2019
Bug fixes
2020
---------
2021
- Column width not resetting after an automatic pagebreak, or after setting HTMLheader
2022
- using AutoFont unnecssarily changed htmlspecialchars to code causing errors
2023
- Lists inside a table - incorrectly calculating table cell height
2024
- CJK - 4-byte utf-8 chars not displaying properly (includes HKCS characters)
2025
- mailto: links incorrectly handled
2026
- TOCpagebreak() - usePaging default clarified: true unless specified as '', 0, '0' or false; (null ->true)
2027
- <tocpagebreak> (as html tag) with no "name" defined, used at start of page, added a further blank page(s)
2028
- Lists - inaccurate calculation of space required for numbers in certain circumstances
2029
- Generated images (.php) only working if cURL enabled - (fixed, but rquires allow_url_fopen if remote file)
2030
- flag added to turn off error reporting when buffering used ($allow_output_buffering = false;)
2031
- RTL text in Bookmark, Title, Author, Creator, Keywords, and Subject was reversed - Adobe Reader 9 now correctly handles RTL text ( which Reader 8 did not)
2032
- TOC - if not using ODD/EVEN paging, did not add extra page and messed up
2033
- Rotated table which did not fit on remaining page resized to bigger than default
2034
- HR of width less than 100% - text continued on line after it
2035
- HR alignment not working (fixed so both CSS text-align and margin: 0 0 0 auto etc work)
2036
- HR in table did not correctly re-size when necessary
2037
- characters in symbols/zapfdingbats which in non-utf-8 mode are represented as chr(173) incorrectly handled as soft-hyphens
2038
      (bug introduced 2.5 with soft-hyphens - affects symbols &#8593; arrow-up and Zapfdingbats &#9313; encircled 2)
2039
- Internal links (anchors) - Annotation/Bookmarks etc. incorrectly positioned when page orientation changed
2040
- ToC - when using multiple ToCs, internal links were not correctly adjusted
2041
- anchor (a name="") used inside a table was incorrectly positioned at the end of table
2042
- Tables: cell height calculated incorrectly when BR used
2043
- Table rotated with "page-break-inside:avoid" not kept on one page
2044
- Table rotated and split over > 1 page - vertical alignment inaccurate
2045
- Headers/Footers (non_html) when no style set caused errors
2046
- Table: breaking page when using rowspan error (line 17142)
2047
- ToC: If no indent defined in HTML tag <tocpagebreak> or defined as 0 gave error
2048
 
2049
Note
2050
----
2051
In mPDF 3.0 the following sections of code have been significantly rewritten:
2052
- painting of borders and background colours for block-elements
2053
- table of contents
2054
- Index
2055
- vertical justification in columns (uses scaling to stretch vertically)
2056
 
2057
NB changed htmltoolkit AdjustHTML - does not now remove <br> before </div>
2058
	Warning - may display differently in normal text as well as tables
2059
 
2060
 
2061
Files updated:
2062
-------------
2063
mpdf.php
2064
htmltoolkit.php
2065
 
2066
 
2067
Developers only
2068
---------------
2069
- Background-color handling in CSS changed so only inherited/cascaded when Columns active or Keep-block-together
2070
      - otherwise would overwrite background image with inherited color
2071
- all %.2f used in sprintf() changed to %.3f in htmltoolkit.php and mpdf.php to increase accuracy of div border lines in columns etc.
2072
- variable $use_embeddedfonts_1252 renamed to $useOnlyCoreFonts as more precise: depracated but still supported.
2073
- this version included quite abit of tidying up/future-proofing some code:
2074
      $var{0} changed to substr($var,0,1) etc.  (due to go in PHP6)
2075
      ereg_ changed to preg_	(depracated in PHP5.3) - (NB mainly in htmltoolkit.php)
2076
 
2077
 
2078
 
2079
===========================
2080
mPDF v2.5  (01/05/2009)
2081
===========================
2082
 
2083
New Features
2084
------------
2085
- Automatic Hyphenation added, and support for soft-hyphens
2086
- Encryption works now for CJK language documents
2087
- Improved text justification
2088
- Support for 'generated' images e.g. "../ontheflyimage.php"
2089
 
2090
 
2091
Bug fixes
2092
---------
2093
- Tables: cell height did not reduce if font-size used was smaller than table default
2094
- Columns: if setcolumns() to the same number already active - did not print out last bit of previous columns
2095
- Page-break in the middle of a block caused incorrect margin and padding on next lines until end of block ($cMargin reset to 0 in AddPage)
2096
- <HR> in table cell was printing in incorrect position (bug introduced in mPDF 2.4)
2097
- Justification
2098
  - if only one word on line, did not respect maximum character spacing
2099
  - last character of line incorrectly had character spacing applied
2100
  - Space at the end of last line of a Right Justify block - e.g. "end. </p>" now correctly ignored
2101
  - &nbsp; incorrectly treated as a character when justifying text with word/char spacing
2102
  - CJK punctuation (.,) added as 'orphans' to keep at end of line
2103
- PNG files - was still buggy reading larger PNG files (due to fread)
2104
 
2105
 
2106
Files updated:
2107
-------------
2108
mpdf.php
2109
htmltoolkit.php
2110
CJKdata.php
2111
/patterns/.. (new files)
2112
 
2113
 
2114
Developers only
2115
---------------
2116
Variables renamed as more accurate or appropriate:
2117
- var $isunicode renamed as $is_MB
2118
- var $usingembeddedfonts renamed as $usingCoreFont
2119
CJK changed to act internally as UTF-8 encoded
2120
- (NB CJK Half-widths not supported from 2.5+ i.e. big5-hw gb-hw)
2121
 
2122
 
2123
 
2124
===========================
2125
mPDF v2.4  (23/04/2009)
2126
===========================
2127
Files updated
2128
-------------
2129
mpdf.php
2130
htmltoolkit.php
2131
mpdfi/mpdfi.php
2132
 
2133
New files
2134
---------
2135
graph.php
2136
Graphs - Requires new folder: path_to_mpdf/graph_cache/ (must be writeable)
2137
 
2138
New features
2139
------------
2140
Annotations improved so they appear as a pop-up
2141
Re-use Document Templates (cf. RestartDocTemplate() in manual)
2142
Limited support for CSS float property on an IMG element allowing text wrapping e.g. <img style="float: right;"> (cf. Images in manual)
2143
Utility function PreparePreText() allows output of a text file which may include <pre>
2144
Automatic generation of graphs from data in tables (requires integration with JPGraph) (cf. Graphs in manual)
2145
 
2146
Other Changes
2147
-------------
2148
IMPORTANT - User rights removed as not working with newer version of Adobe Reader 9 (affects Active forms and ability for users to modify annotations)
2149
Corrects text alignment when using {nb} or {nbpg} in (non-HTML) headers/footers
2150
Sets default timezone if not already set (at top of mpdf.php) to prevent E_STRICT ERROR message
2151
Suppresses E_NOTICE error reporting (at top of mpdf.php)
2152
Error capture in Output() to avoid PDF header being sent when error messages generated
2153
A function str_ireplace added to htmltoolkit to allow PHP4 to function
2154
 
2155
Bug fixes
2156
---------
2157
WMF images incorrectly positioned when in-line
2158
PNG images > 8kB failed to load - (fix in 2.3 didn't work - fixed properly this time)
2159
Annotations containing a new line (\n) causing an error
2160
Evaluation of <pre> text: "<code>[TAB] " evaluated incorrect number of spaces to follow to align tabs, because < was calculated as 4 chars (&lt;)
2161
 
2162
 
2163
 
2164
===========================
2165
mPDF v2.3  (22/03/2009)
2166
===========================
2167
 
2168
New Features
2169
------------
2170
- Optionally detect language and when to use special fonts i.e. RTL (arabic), CJK (chinese), Thai (see SetAutoFont() etc.)
2171
- Supports HTML attribute "lang" in all tags and uses special fonts when required (see $useLang)
2172
- Joins Arabic and Farsi/Persian text into presentation forms
2173
- Import another PDF file and use as templates in your document (see UseTemplate() and mPDFI in the manual.)
2174
- Replace specified text strings in an existing PDF file (see OverWrite() etc.)
2175
- More than one Table of Contents can be used in a document (see tocpagebreak etc.)
2176
- Restore properties of open HTML block elements after a page break (variable $restoreBlockPagebreaks or new tag <formfeed>)
2177
- <annotation> <bookmark> <indexentry> <tocentry> can now accept characters <>'"& as htmlentities - htmlspecialchars(..., ENT_QUOTES)
2178
- <annotation> can now accept "\n" for new line
2179
- support for opacity (CSS3 property) for images
2180
- specify the number of spaces to substitute for TAB when parsing <pre> tags
2181
- greater control over margins and display when changing page orientation during document (see $forcePortraitMargins and $displayDefaultOrientation)
2182
 
2183
 
2184
 
2185
Bug fixes
2186
---------
2187
Fonts in CSS - Not parsing font-family: Trebuchet MS; correctly as trebuchet
2188
Fonts in CSS - CSS font-family: [unknown]; setting first $available_unifont rather than ignoring
2189
Images - not displaying on IIS platform
2190
Images - .wmf not displaying if (allow_url_fopen) not set
2191
Table borders - in defaultCSS, 'MARGIN-COLLAPSE'=> collapase not quoted therefore not working
2192
Line-break inside table - printing a blank background across page rather than just going down a line
2193
Form fields inside tables - will now resize if the table is autosized (shrunk)
2194
<pre> containing a '<' was changed to '&lt;'
2195
Tabs inside <pre> were all changed to 8 spaces, not the remainder following a string
2196
Header on first page was inset by 1mm left and right ($cMarginL and $cMarginR not set to zero)
2197
Table nested inside a cell with colspan > 1 was incorrectly handled
2198
PNG file crashed (?incorrectly defined PNG file) [adapted _parsepng to account for unexpected]
2199
Table or Cell - if font-size not recognised, mPDF set font-size to zero
2200
Font-sizes - [xx-small|x-small|small|medium|large|x-large|xx-large] were not recognised in tables
2201
 
2202
 
2203
===========================
2204
mPDF v2.2.1  (17/02/2009)
2205
===========================
2206
Bug fix - (bug introduced in 2.2)
2207
Table - header row did not return to top of page when repeating across pages.
2208
 
2209
 
2210
===========================
2211
mPDF v2.2  (15/02/2009)
2212
===========================
2213
Updated files from mPDF 2.1
2214
mpdf.php
2215
htmltoolkit.php
2216
mpdf.css (new)
2217
===========================
2218
New files from mPDF <2.0 (only required for EAN Barcodes)
2219
font/ocrb.xx (several)
2220
unifont/ocrb.xx (several)
2221
IMPORTANT - you need to make sure the ocrb font is added to the config.php file
2222
 - add 'ocrb' to the end of 3 arrays: $this->available_fonts  $this->available_unifonts  and  $this->mono_fonts
2223
===========================
2224
 
2225
Summary of changes
2226
- external stylesheet file (mpdf.css) is used to configure default values ($useDefaultCSS2 and $defaultCSS2 are no longer used)
2227
- special comment tags to hide mPDF tags from browsers: <!--mpdf ...  mpdf-->
2228
- AddColumn() function added (equivalent to <columnbreak>)
2229
- annotations - pop-up messages the reader can move or delete (if you set permissions)
2230
- support for WMF images as well as GIF, JPG, PNG
2231
- watermark image can be set instead of, or as well as text
2232
- nested tables can include other content
2233
- improved control over table layout
2234
- margin: auto now supported for table and block elements
2235
 
2236
A number of methods and variables have been renamed or reCapitalised for consistency.
2237
Changes should be backwards comaptible.
2238
All user methods start with a Capital, all user-defined variables start with lowercase.
2239
Affected:
2240
Reference() -> IndexEntry()
2241
CreateReference() -> CreateIndex()
2242
$TopicIsUnvalidated -> $showWatermark
2243
setUnvalidatedText() -> SetWatermarkText()
2244
 
2245
PHP appears at present to be case-insensitive for function/method names
2246
All the following functions have been renamed in the script with a capital first letter:
2247
setUserRights()
2248
setBasePath()
2249
setAnchor2Bookmark()
2250
setHeader()
2251
setFooter()
2252
defHeaderByName()
2253
defFooterByName()
2254
setHeaderByName()
2255
setFooterByName()
2256
setHTMLHeader()
2257
setHTMLFooter()
2258
defHTMLHeaderByName()
2259
defHTMLFooterByName()
2260
setHTMLHeaderByName()
2261
setHTMLFooterByName()
2262
shaded_box()
2263
writeBarcode()
2264
 
2265
Variable names changed to lowercase first letter:
2266
(Variables are case-sensitive therefore aliases have been set up)
2267
Anchor2Bookmark
2268
BiDirectional
2269
KeepColumns
2270
AliasNbPg
2271
AliasNbPgGp
2272
 
2273
=========
2274
Bug fixes
2275
=========
2276
Columns - $keepColumns=true was incorrectly calculating the place to continue printing after 1 and half columns (of 3)
2277
Table cell height - incorrectly setting table cell height when cell contained a line of text of large size which wrapped to more than one line
2278
HR in Table cell - if table cell contains only HR (and column otherwise empty), HR was printed outside cell
2279
HR in Table cell - if table cell ended with a HR, height was one line too much
2280
Table page-break-inside:avoid - caused mPDF into permanent loop in some circumstances
2281
Paging - Total Pages/Group {nb} and {nbgp} didn't work in CJK
2282
CSS - Border size thin, medium and thick were only recognised in lowercase
2283
Table-header - rowspan not correctly output in THEAD
2284
Default CSS - table empty-cell:hide changed to show (CSS specification)
2285
 
2286
===========================
2287
mPDF v2.1  (24/01/2009)
2288
===========================
2289
 
2290
New Features in Version 2.1
2291
---------------------------
2292
- CSS support improved generally (especially for cascading CSS, lists)
2293
- TableHeader changed to allow multiple rows in THEAD
2294
 
2295
 
2296
CSS changes
2297
-----------
2298
- display: none (block elements only - not lists or tables, nor HR)
2299
- width (TD/TH)
2300
- list-style-type (will also recognise the list-style-type from list-style) (OL/UL)
2301
	recognised values: disc|circle|square|decimal|lower-roman|upper-roman|lower-latin|upper-latin|lower-alpha|upper-alpha|none
2302
- CSS support for <LI>: font-family, font-size, font-style, font-weight, color, background-color, text-decoration, text-transform, and list-style-type (will also recognise the list-style-type from list-style)
2303
- table cell borders - CSS rules have been adapted slightly - if a coloured/black line conflicts with a white line, and is the same width, coloured/black will overwrite even if Bottom or Right
2304
 
2305
 
2306
Numbered Lists
2307
--------------
2308
Variables set at the top of mpdf.php can be set to change:
2309
- text alignment of numbers in numbered lists (default Right)
2310
	var $list_align_style = 'R';
2311
- content to follow a numbered list marker e.g. '.' gives 1. or IV. whereas ')' gives 1) or a)
2312
	var $list_number_suffix = '.';
2313
(These can be altered at run time, but are not changeable through stylesheets or in-line style)
2314
 
2315
 
2316
Writing broken segments of HTML
2317
-------------------------------
2318
2 new parameters have been added to WriteHTML()
2319
function WriteHTML($html,$sub=0,$init=true,$close=true) {
2320
$close - Leaves buffers/variables etc. in current state, so that it can continue to write the HTML where it leaves off
2321
$init - Clears and resets buffers/variables
2322
(N.B.  You must end with a WriteHTML that calls $close=true)
2323
Example:
2324
$mpdf->WriteHTML('<p>This is the beginning...', 2, true, false);
2325
$mpdf->WriteHTML('...this is the middle...', 2, false, false);
2326
$mpdf->WriteHTML('...and this is the end</p>', 2, false, true);
2327
 
2328
 
2329
Rotated text in table cells
2330
---------------------------
2331
NB This UPDATE will change expected output from previous versions******
2332
 
2333
Prior to v2.1 any cell set to rotate text anticlockwise was forced to vertical align = bottom.
2334
This has been changed so that it only overrides when the rotate angle is between 45 and 89 degrees: text rotated exactly 90 degrees will respect the set value for vertical-align.
2335
 
2336
 
2337
=========
2338
Bug fixes
2339
=========
2340
- List - list starting after "<div>Then some text not in a block element<ol>" incorrectly output
2341
- Tables - if cell font-size set smaller than default for the table, does not shrink the cell height
2342
- Columns (tables) - columns breaking across rows e.g. in the middle of a table cell
2343
- Tables - if table width set to e.g. 100% but cols are less, was not making up to set width
2344
- Watermark - was not printing if using HTMLFooter
2345
- Lists - not aligning numbering correctly if different font sizes used for bullet & text etc.
2346
- Lists - indent of text did not correctly allow for Maximum number in <ol> list
2347
- Table does not always move correctly to a new page
2348
- Table cell incorrectly calculated height causing text to overflow cell when printed
2349
- Table borders in columns not being correctly handled (bug since 2.0 introduced a buffer to save the borders and print at the end of the table - fixed so does not use buffer if in columns - potentially does not deal with conflicting borders as well, but works in columns)
2350
- Table cell width if set as a percent was being downsized when autosizing table
2351
- Table CSS was buggy - improved
2352
- SetBasePath (when fetching remote website) - now handles string with query string on it e.g. http://www.domain.com/index.php?tid=42
2353
- Table cells with Rotated text - text not positioned correctly
2354
- Page number totals not working in utf-8 mode
2355
 
2356
 
2357
============================
2358
Code efficiency improvements
2359
============================
2360
- BIG speed improvement (compared with 2.0) with tables (especially large tables)
2361
- considerable increase in speed if writing long HTML segments to mPDF
2362
- speed improvement for tables (may be very significant if some cells have a lot of text in them causing uneven column widths)
2363
 
2364
NB To speed up program more, consider setting $mpdf->useSubstitutions=false; if you do not use any characters outside the codepage selected
2365
 
2366
 
2367
===============
2368
Keep-with-table
2369
===============
2370
(This was introduced in v2.0 but I forgot to document it)
2371
If you set $this->use_kwt = true;
2372
All H1-H6 elements will try to keep with a table that follows immediately afterwards - (this is done in htmltoolkit, by adding an attribute KEEP-WITH-TABLE)
2373
See Known Issues re: Using kwt inside a div with border/background (doesn't work)
2374
 
2375
 
2376
 
2377
 
2378
===========================
2379
mPDF v2.0  (07/12/2008)
2380
===========================
2381
Main New Features in Version 2.0
2382
- nested tables are supported
2383
- supports both models of table border: separate and collapsed
2384
- improved parsing of CSS stylesheets, and better handling of styles throughout
2385
- additional recognised CSS styles
2386
- page orientation, size, and margins can be changed within the document, using PHP script or custom HTML
2387
- some limited support for @page CSS to define page-box areas, with crop/cross marks for printing
2388
- improved control over headers and footers (including HTML headers/footers)
2389
- improved presentation of Form elements including image-type input fields
2390
- generates an EAN barcode suitable for a book/printed publication
2391
- active forms can be generated - EXPERIMENTAL at present
2392
- change document permissions to allow the user to make annotations - EXPERIMENTAL at present
2393
 
2394
NB Lines are commented in mPDF script as changes for mPDF 1.4 - this became v2.0
2395
 
2396
=========
2397
UPGRADING
2398
=========
2399
IMPORTANT - Before Upgrading: Please note that some of the changes will cause mPDF 2.0 to render the pages differently from earlier versions i.e. it is not totally backwards comaptible. Read the notes on Backward compatibility before deleting your original set-up.
2400
 
2401
To upgrade from v<=1.3 to v2.0 you only need to copy and overwrite the following 2 files:
2402
mpdf.php
2403
htmltoolkit.php
2404
 
2405
Plus (optionally) if you want to use the EAN Barcode function, you will also need:
2406
font/ocrb.xx (several)
2407
unifont/ocrb.xx (several)
2408
IMPORTANT - you need to make sure the ocrb font is added to the config.php file
2409
 - add 'ocrb' to the end of 3 arrays: $this->available_fonts  $this->available_unifonts  and  $this->mono_fonts
2410
 
2411
 
2412
==========
2413
Bug Fixes
2414
==========
2415
<columns column-count="0"> did not turn off columns - Fixed
2416
 
2417
Margins as % - e.g. margin-right: 50% set from CSS incorrectly applied 50% of the fontsize
2418
(Fixed - adding parameter to fn. ConvertSize in htmltoolkit.php and in calls to that function)
2419
 
2420
DIV Width - e.g. div style="width: 50% was not working
2421
(Fixed - fn.SetCSS and OpenTag()'DIV')
2422
 
2423
CSS values as Zero - p { margin: 0; } did not work in stylesheet unless 0 had a unit
2424
 
2425
Multiple Non-breaking spaces collapsed - e.g. "1&nbsp; &nbsp; &nbsp;2"  - was contracted to "1 2"
2426
(Fixed - fn.adjustHTML in htmltoolkit.php)
2427
 
2428
Table cell too narrow causing incorrect printing - If two characters are too wide to print (only likely within a table cf. example tables - Periodic table) the first character was not printed, just a new line
2429
(Fixed in fn.WriteFlowingBlock)
2430
 
2431
Font size by inline style for form elements <input> <textarea> gave wrong size when using a relative size 0.9em
2432
(Fixed - fn.ConvertSize in htmltoolkit.php)
2433
 
2434
Creation Date not correctly showing
2435
(Fixed - did not need to convert to UTF16)
2436
 
2437
New block element started at end of page  - block borders not painted
2438
(Fixed - fn.AddPage)
2439
 
2440
DL did not close block correctly
2441
(Fixed - mistype in fn. CloseTag)
2442
 
2443
Transparent not recognised as color/background-color
2444
(Attempted a fix by setting to ignore it! - fn. convertcolor in htmltoolkit.php)
2445
 
2446
Zero (0) not displaying if only thing in table cell or tags e.g. <td>0</td> <p>0</p>
2447
(Fixed - fn.WriteHTML)
2448
 
2449
Page Headers/Footers - Simple Headers or Footers defined as e.g. '|{PAGENO}|' were not split into 3 components, but output |6| in the outer margin.
2450
(Fixed)
2451
 
2452
Could not copy from a completed PDF doc to clipboard when using a TrueTypeUnicode font
2453
(Fixed - fn._puttruetypeunicode - added CIDToGIDMap)
2454
 
2455
Creating an Index (confusing called CreateReference in mPDF) based on only 1 column (i.e. columns off) caused it to print FAIL
2456
(Fixed - fn. CreateReference())
2457
 
2458
Table of Contents - If a ToC entry reached other side of page a warning notice was produced
2459
Fixed - printing is now suppressed and it is moved down a line (but not when using rtl)
2460
 
2461
"Keep Block Together" (i.e. page-break-inside: avoid for a block element)
2462
If this property causes some text to be moved to the next page, internal link targets (i.e. <a name="xxx">) were incremented pagenumber by +1 - as this used the calculated document page number, didn't work if using e.g. roman numerals
2463
(Fixed)
2464
NB This is now ALWAYS disabled when it meets a table - can use page-break-inside:avoid for the table
2465
 
2466
@import url(style.css) without quotation marks "" was not picked up, although it is valid HTML
2467
(Fixed - fn.ReadCSS())
2468
 
2469
Reading CSS from external style sheets included all media
2470
Now set by default to ignore media="aural|braille"
2471
Allows media="print" but can exclude by: $mpdf->disablePrintCSS = true; (default = false)
2472
Works on both <link... and <style media="print">@import...
2473
See the web page example - this stops the CSS stylesheets specifically marked for "print" to be ignored
2474
 
2475
Table borders (in collapsed model) incorrectly calculated which border had dominance (mPDF <=1.3 determined the overriding border by its color)
2476
(Fixed to follow CSS 2.1 specifications: width >> CSS dominance (cell>table) >> T & L > B & R)
2477
In the border-collapse=collapse mode, the following rules determine which border style "wins" in case of a conflict:
2478
1. Borders with the 'border-style' of 'hidden' take precedence over all other conflicting borders.
2479
2. narrow borders are discarded in favor of wider ones.
2480
3. styles are preferred in this order: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and the lowest: 'inset'.
2481
4. If border styles differ only in color, then a style set on a cell wins over one on a table.
2482
5. When two elements of the same type conflict, then the one further to the left or top wins out.
2483
 
2484
Parsing CSS, a missed level would not be picked up i.e. CSS = div.refstr1 p {...} would not pick up:
2485
<div class="refstr1"> <div class="another"> <p>...
2486
(Fixed - fn. MergeCSS by carrying everything forwards)
2487
	Note: I removed -  && !$this->blk[$this->blklvl-1]['cascadeCSS']['CLASS>>'.$attr['CLASS']]['depth']
2488
	Not sure why I put it there in the first place!
2489
	In a later bit of function -  && $this->blk[$this->blklvl-1]['cascadeCSS'][$tag]['depth']>1
2490
	Haven't removed this, but is it needed???
2491
 
2492
CSS inline style set in TD/TH (font-size, color, weight, font-family or italic) didn't turn off at the end of the cell (and also formatted the top left cell)
2493
(Fixed)
2494
 
2495
CSS properties color, font-weight, and font-style set on a table were not inherited by the table cells
2496
(Fixed - var $base_table_properties)
2497
 
2498
When rotating a table, the text following was positioned incorrectly
2499
(Fixed - fn. printtablebuffer)
2500
 
2501
When rotating a table, links were not adjusted in position e.g. <a href="">...
2502
(Fixed - fn. printtablebuffer)
2503
 
2504
If a larger border-thickness was set for a cell in the middle of a table, cells before that inaccurately calculated the cell wdith needed
2505
(Fixed)
2506
 
2507
Text in a table cell which was not in a block and followed a list, there was no line break e.g. </ol>Text following</td>
2508
(Fixed - var $listjustfinished;)
2509
 
2510
Setting the default font-family from the body tag using in-line CSS did not work e.g. <body style="font-family:mono"> (did work in external  stylesheets)
2511
(Fixed - fn.WriteHTML)
2512
 
2513
<link href="..." rel="stylesheet"> was not recognised (because the href comes before the rel)
2514
(Fixed)
2515
 
2516
Read linked CSS stylesheet OR @import stylesheet - now includes both.
2517
 
2518
<tag class="class1 class2"> did not set either class1 or class2. Fixed so that it will now pick out class1 (better than nothing!)
2519
 
2520
CSS line-height as % - interpreted 120% as 120 (x the font-size) - Fixed so it now accepts % and numbers
2521
 
2522
Setting the basepath (used for relative links/external stylesheets etc) with $mpdf->setBasePath() was generally buggy!
2523
Now allows a domain e.g. $mpdf->setBasePath("http://www.domain.com"); (previously needed slash on end)
2524
(Fixed - hopefully!)
2525
 
2526
If you were repeatedly calling mPDF in a loop to produce more than one PDF file, it would crash with error: "You have restricted the number of available fonts to 0". Fixed by editing line 751 require(_MPDF_PATH.'mpdf_config.php'); to require(...
2527
 
2528
 
2529
=============
2530
Improvements(?)
2531
=============
2532
Unsupported image files - mPDF died with an error message if image files didn't meet expected format e.g. an interlaced PNG file
2533
Changed so images are now replaced by the NOIMG image.
2534
 
2535
Footer margin (HTML and normal footers) now determines the lowest point that is printed (rather than the place to start printing the footer)
2536
NB IMPORTANT CHANGE - not backwards comaptible
2537
 
2538
Tabs in <pre> or <textarea> are now replaced by 8 spaces rather than 6 (consistent with http://www.w3.org/TR/1998/REC-html40-19980424/struct/text.html#edef-PRE)  [fn. AdjustHTML() in htmltoolkit.php]
2539
 
2540
To insert the total number of pages in the document anywhere in the doc, just use '{nb}'
2541
The line: 	$mpdf->AliasNbPages();
2542
has now been uncommented allowing {nb} to be used
2543
NB This will always give the total no. of pages in the whole document regardless of any changes you have made to page numbering.
2544
You can change the default placeholder '{nb}' to any string using:  $mpdf->AliasNbPages('[**my Chars**]');
2545
 
2546
$mpdf->AliasNbPageGroups();	default="{nbpg}"
2547
Can be used to set the total number of pages in the current group i.e. between where page numbering is reset
2548
 
2549
CSS border correctly fixes "solid 3mm #000000" i.e. (style width color) - (not a bug, but this is often incorrectly specified)
2550
 
2551
Can now print div background behind a rotated table.
2552
 
2553
You can keep columns as they are i.e. 1st column will finish page then start on second, by setting
2554
$mpdf->KeepColumns = true;
2555
 
2556
Image constrain
2557
===============
2558
Image size is constrained to current margins and page position. Extra parameter added to end of fn. allows you to override this.
2559
$mpdf->Image('files/images/frontcover.jpg',0,0,210,297,'jpg','',true, false);	// e.g. the last "false" allows a full page picture
2560
Useful for e.g. a cover page for your document
2561
 
2562
Cumulative CSS
2563
==============
2564
In version <=1.3, if you call:
2565
$mpdf->WriteHTML($stylesheet,1);
2566
$mpdf->WriteHTML($html);	// this one cleared the array $this->cascadeCSS; conatining cascaded CSS information from stylesheets
2567
You were meant to call:
2568
$mpdf->WriteHTML($html,2);	// which doesn't re-parse the CSS information
2569
v2.0 changed so that
2570
$mpdf->WriteHTML($html); no longers clears the array $this->cascadeCSS and so can be used repeatedly;
2571
 
2572
 
2573
 
2574
================================================
2575
Additional CSSstyles & HTML attributes supported
2576
================================================
2577
<BODY> - font-style, font-weight, color
2578
 
2579
<IMG> - html attributes width="" and height=""
2580
 
2581
<TABLE|TD|TH> - border: 'thin' 'medium' and 'thick' are now converted to 1px, 3px and 5px
2582
<TABLE|TD|TH> - border now respects all types - e.g. 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset'
2583
(NB mPDF only supports a full declaration of border e.g. "border: thin double #000000;")
2584
 
2585
<TD|TH> - CSS style="white-space: nowrap" and HTML attribute nowrap="nowrap"
2586
<TABLE> - page-break-inside: avoid
2587
<TABLE> - border-collapse: separate|collapse
2588
<TABLE> - border-spacing: 2px 2px;	(horizontal/vertical) or just one figure (both) NB same as cellSpacing
2589
<TABLE> - empty-cells: hide|show  (border-collapse:separate only)
2590
<TABLE> - margin-left and margin-right (previously only supported top and bottom)
2591
<TABLE> - padding: (this was incorrectly used for TD/TH before) (border-collapse:separate only)
2592
<TD|TH> - padding:
2593
<TABLE|TD|TH> - inline style "background" works (with a color only) the same as "background-color"
2594
 
2595
NB Table page-break-inside, autosize values and rotate are only respected for that set on first level table of nested tables
2596
 
2597
<TABLE> - cellSpacing and cellPadding HTML attributes:
2598
NB cellSpacing is the same as CSS style "border-spacing"
2599
NB cellPadding is a <table> attribute, but sets the cell padding - not table padding
2600
 
2601
<TABLE> - align="..." now works with a rotated table - but sets the alignment ignoring the rotation i.e. align=right sets the table to the right side of the page (looking as though it is bottom-aligned)
2602
 
2603
<BLOCK ELEMENTS> - page-break-before: always|left|right - NB any surrounding block tags will be closed before the new page is inserted.
2604
 
2605
@page - see notes on Paged Media
2606
 
2607
==========================
2608
Unsupported HTML attribute
2609
==========================
2610
<TD border="1"> - not valid HTML - no longer supported
2611
 
2612
 
2613
=========
2614
Additions
2615
=========
2616
"Keep-with-table"
2617
$mpdf->use_kwt = true;	// default=false
2618
If set to true, will force any H1-H6 header immediately preceding a table to be kept together with the table
2619
- automatically sets the table to fit on one page (i.e. page-break-inside=avoid) if it is a rotated table
2620
- ignored if: Columns on, Keep-block-together active (page-break-inside=avoid for surrounding BLOCK), active Forms
2621
 
2622
 
2623
=====
2624
Notes
2625
=====
2626
 
2627
NB Not a change - but note you can use this to allow you to feed html code encoded in other than utf-8:
2628
$mpdf->allow_charset_conversion=true;
2629
$mpdf->charset_in='windows-1252';	(needs suitable codes for iconv i.e. windows-1252 not win-1252)
2630
 
2631
Fixing Optional tags
2632
====================
2633
php.net website has illegal nesting of <dt>.. <dd> .. </dd> .. </dt>  and <p>.. <div> .. </div> .. </p>
2634
The example wich parses the php.net webpage will not show correctly unless you change: $mpdf->allow_html_optional_endtags=false;
2635
Trying to fix incorrect (X)HTML with $mpdf->allow_html_optional_endtags==true cancels the P when it meets a DIV etc.
2636
 
2637
 
2638
 
2639
EAN barcode
2640
===========
2641
An EAN barcode can be generated
2642
function writeBarcode($code, $showisbn=1, $x='', $y='', $size=1, $border=0, $paddingL=1, $paddingR=1, $paddingT=2, $paddingB=2) {
2643
It accepts 12 or 13 digits with or without - hyphens as $code e.g.
2644
$mpdf->writeBarcode('978-1234-567-890', 1, $mpdf->x, $mpdf->y);
2645
NB - IMPORTANT***
2646
A new font - OCR-B font/unifont is required, and needs to be added to the config.php file
2647
cf. http://www.gs1uk.org/downloads/bar_code/Bar coding getting it right.pdf
2648
Barcode size must be between 0.8 and 2.0 (80% to 200%)
2649
 
2650
CMYK Colors
2651
===========
2652
Functions - SetDrawColor, SetTextColor and SetFillColor all now take an optional 4th parameter.
2653
If defined this will interpret the input as CMYK color i.e.
2654
SetDrawColor(15,82,0,10)	// NB all values out of 100 - not 255 as for RGB
2655
 
2656
htmltoolkit.php fn.ConvertColor() - now interprets custom color definition: cmyk(15,82,0,10)
2657
like rgb(r,g,b) except values out of 100
2658
Intended to be used for calling the functions separately - BUT works in a limited way with CSS - does not get reset or inherited correctly
2659
<p style="color:cmyk(215,31,15,10)"> does work
2660
 
2661
 
2662
DEFAULT CSS
2663
===========
2664
$defaultCSS has been updated to reflect better the standard HTML default e.g. using serif, table borders separate, cell vertical-align top
2665
To keep mPDF 1.3 (my favourites) I have introduced:
2666
$mpdf->useDefaultCSS2 = true;
2667
 
2668
 
2669
===================================
2670
Permissions - forms and Annotations - Experimental!
2671
===================================
2672
You can set the Permissions for the PDF file to allow the user to make Comments (annotations)
2673
$mpdf->setUserRights($enabled=true[default]|false, $annots="/Create/Delete/Modify/Copy/Import/Export",
2674
		$form="/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate", $signature="/Modify") )
2675
 
2676
If you encrypt the file, make sure the permissions match e.g.:
2677
$mpdf->setUserRights();
2678
$mpdf->SetProtection(array('print','annots'),'yourPassword','myPassword');
2679
 
2680
To allow this, changed the PDF-file version to %PDF1.5 (NB Probably needs PDF version > 1.5 but can't test for this...)
2681
 
2682
NOTE: If you output the PDF file straight to the browser, it will only allow annotations after you save the document
2683
 
2684
 
2685
===========================
2686
Active Forms - Experimental!
2687
===========================
2688
At present , using active forms will prevent any internal and external links - that appear before active forms(?) - from working (why?)
2689
May need to save form for proper use - see example, when scroll forwards and back, the form disappears??
2690
Need to set Userrights (see above), and $mpdf->useActiveForms=true;
2691
For Output options, see separate notes.
2692
 
2693
 
2694
 
2695
============================
2696
Internal Programming changes
2697
============================
2698
NB fn. tablerotate in htmltoolkit no longer used; now uses a 'transform' to shift the whole block of PDF code
2699
 
2700
Graphics State
2701
==============
2702
ExtGState does not need to be redefined - e.g. if a watermark added on every page, turning on and off alpha/transparency
2703
Unnecessary file size.
2704
function AddExtGState() edited to check if graphics state already exists before adding new one
2705
 
2706
ASCII-proof code
2707
================
2708
"»¤¬" used as a special identifier in the program changed to "\xbb\xa4\xac" to make the mpdf.php script file immune from someone saving it as a utf-8 encoded file
2709
 
2710
Images
2711
======
2712
1) When copying remote images locally - incorrectly used "unset" now changed to "unlink"
2713
2) When parsing image files - was using CURL for any image src="http://... - even if this was on the local server - edited so it only uses CURL if necessary/appropriate.
2714
NB Handling images was updated in v1.3 because my ISP changed allow_url_fopen to false
2715
Fixed so mPDF tests if the file is available as a local call e.g. getimage('images/test.jpg') even if it is defined as a full URI e.g. http://www.mydomain.com/images/test.jpg as this is quicker(?), and permitted even if allow_url_fopen is false.
2716
If not available as a local file (and allow_url_fopen is set) mPDF tries to use fopen/file_get_contents using an http wrapper;
2717
Else, if CURL is available and allow_url_fopen is false: then tries using CURL.
2718
(Clear as mud???!!)
2719
 
2720
 
2721
===========================
2722
mPDF v1.3  (21/09/2008)
2723
===========================
2724
--------------
2725
Page Numbering
2726
--------------
2727
Program changes:
2728
fn. startPageNums() replaced with blank function
2729
fn. stopPageNums() - deleted
2730
fn. numPageNo() - deleted  (all it did was return this->page anyway).
2731
var $_numbering - deleted
2732
var $_numberingFooter - deleted
2733
var $_numPageNum - deleted
2734
 
2735
NEW
2736
New: fn. AddPages() (as for AddPage but with type=NEXT-ODD or NEXT-EVEN see below)
2737
Edited: fn. AddPage() - new parameters added
2738
AddPage(orientation(NO),type="E|O", resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off")
2739
New: fn. docPageNum() - returns the document page number (or '') based on...
2740
New : PageNumSubstitutions(array)
2741
New attributes:
2742
<pagebreak resetpagenum="1"	// resets document page numbering to 1 from the new page onwards
2743
<pagebreak suppress="on"	// turns on suppression of page numbering i.e. in headers and footers, {PAGENO} is replaced by blank string
2744
					// ="0" turns suppression off
2745
<pagebreak pagenumstyle="I|i|A|a|1"	// (re)sets page number stle/type from the new page onwards - as for lists
2746
					// 1 - decimal; A/a - alpha (uppercase/lowercase); I/i - Roman (uppercase/lowercase)
2747
<pagebreak type="NEXT-ODD"	// always adds a page + another if required to make odd
2748
<pagebreak type="NEXT-EVEN"	// always adds a page + another if required to make even
2749
 
2750
Edited: fn. TOC()	// sets the marker for a Table of Contents
2751
New parameters allow the page-numbering details to be set
2752
NB the page-numbering details set are for the page which follows on after the TOC marker is inserted. The page-numbering for the actual ToC is set later, when the ToC is generated and inserted here
2753
new parameters as above for pagebreak  resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off"
2754
 
2755
Can also be set by attribute in the <TOC>
2756
<TOC resetpagenum="1" pagenumstyle="I|i|A|a|1", suppress="on|off" />
2757
 
2758
--------------------------------------------
2759
Changes to allow Rotated Text in table Cells
2760
--------------------------------------------
2761
Edited:
2762
fn. OpenTag()
2763
fn. _tableColumnWidth()
2764
fn. _tableHeight()
2765
fn. _tableWrite()
2766
fn. tableHeader()
2767
 
2768
New custom style or attribute -- "text-rotate" -- can be set for either <tr> or <th|td>
2769
Allowed values: 45 - 90 (written as integers) - rotates text anticlockwise, and -90 (clockwise)
2770
Positive values less than 90 force cell to: vertical-align:bottom
2771
 
2772
Limitations:
2773
Only allows single line of text;
2774
Font, font-size, and style are determined by those set fro the cell, and cannot be changed;
2775
No changes in font (or any other in-line changes e.g. <sup>) are supported within the text
2776
 
2777
Example: <tr style="text-rotate:90">...
2778
 
2779
---------
2780
Bug fixes
2781
---------
2782
1) HTML footer containing table was triggering page break.
2783
Added $this->InHTMLFooter as flag to prevent page triggering in footers containing table
2784
Set in fn.writeHTMLFooters() -> in fn.tableWrite() stops the pageBreak being reset
2785
 
2786
2) Crashing when libcurl not installed.
2787
Edited OpenTag() curl_init - added if (function_exists) to exclude crash when libcurl not installed
2788
 
2789
3) Single cell with borders not showing the borders.
2790
e.g. <table><tr><td style="border:1px solid #000000?>Hi</td></tr></table>
2791
Problem: mPDF overrides cell border properties with table border properties for external borders. $defaultCSS had CSS defined for table as '0px solid #000000'
2792
Quick fix - line 273 removed. A more complete fix will require reprogramming to distinguish between "border property not set" and border property set as "none".
2793
 
2794
4) Empty textarea incorrectly handled (the following HTML code being output in the textarea)
2795
The html code for an empty textarea was incorrectly handled in htmltoolkit fn. AdjustHTML which has been edited
2796
 
2797
 
2798
===========================
2799
mPDF v1.2   (2008-05-01)
2800
===========================
2801
// Added v1.2 option to continue if invalid UTF-8 chars - used in function is_utf8()
2802
var $ignore_invalid_utf8 = false;
2803
 
2804
Reading CSS in fn. ReadCSS() and applying in fn. MergeCSS() -
2805
	Edited to allow Tags, class and id with the same name to be distinct i.e. h5 {...}  .h5 {...}  #h5 {...}
2806
* mPDF 1.2 This version supports:  .class {...} / #id { .... }
2807
* ADDED p {...}  h1[-h6] {...}  a {...}  table {...}   thead {...}  th {...}  td {...}  hr {...}
2808
* body {...} sets default font and fontsize
2809
* It supports some cascaded CSS e.g. div.topic table.type1 td
2810
* Does not support non-block level e.g. a#hover { ... }
2811
 
2812
Table: font-size, weight, style, family and color should all work
2813
TD/TH: font-size, weight, style, family and color should all work
2814
 
2815
Added to htmltoolkit - fn.array_merge_recursive_unique()
2816
 
2817
memory_opt Removed in mPDF v1.2 - not working properly
2818
 
2819
fn. _begindoc() - changed to %PDF1.4 (was 1.3) as PDF version
2820
 
2821
Write HTML Headers and Footers
2822
------------------------------
2823
fn. Close() - calls writeHTMLHeaders/Footers() before finishing doc
2824
fn. WriteHTML() - added parameter
2825
fn. _out - writes to outputbuffer when writing HTML footers/headers
2826
 
2827
New
2828
fn. writeHTMLHeaders()
2829
fn. writeHTMLFooters()
2830
 
2831
 
2832
 
2833
 
2834
=======================
2835
mPDF v1.1  (2008-05-01)
2836
=======================
2837
 
2838
Programming changes to increase efficiency
2839
------------------------------------------
2840
fn. WriteHTML() - added lines to combine substituted characters <tta> etc
2841
 
2842
Memory Optimization added (script from FPDF site) - edited fn. _putpages() and fn. _endpage()
2843
 
2844
fn. SetFont() edited to return val quicker if font already set (increase efficiency)
2845
 
2846
new vars chrs and ords are used to store chr() and ord() - quicker than using functions
2847
 
2848
fn.setMBencoding() - only call mb_internal_encoding if need to change
2849
 
2850
Bugs
2851
----
2852
fn. SetDefaultFontSize() - edited to allow to override that set in defaultCSS
2853
 
2854
fn. Output() - Added temporary(?) disablement of encryption in CJK as it doesn't work!
2855
 
2856
fn. OpenTag() [LI] $this->blockjustfinished=false to prevents newline after first bullet of list within table
2857
 
2858
Uses of mb_ereg_replace removed, and mb_split changed - requires regex_encoding (regex_encoding only used as UTF-8)
2859
 
2860
fn. WriteHTML: attributes are trimmed with trim() to allow correct handling of e.g. class="bpmBook "
2861
 
2862
fn. printbuffer() and fn. openTag() to ensure
2863
 <div><div><p> outputs top margins/padding for both 1st and 2nd div
2864
 and </p></div></div> ...
2865
 
2866
fn. SetFont() added line - bug fixing in CJK fonts
2867
 
2868
CSS functionality
2869
-----------------
2870
Added special CSS 'thead-underline' (similar to topntail)
2871
 
2872
var $thead_font_weight;	added (openTag) to enable setting of font-weight for <TH> cells
2873
 
2874
Fixed table border inheritance: Table border inherits border="1" to cells, but not table style="border..."
2875
 
2876
"page-break-inside: avoid" added (var keep_block_together) to allow a DIV or P to be kept on one page
2877
	- not compatible with table autosize or table rotate
2878
	- only works over maximum of 2 pages
2879
 
2880
Enhancements
2881
------------
2882
Orphans in line justification: R. Bracket ) added to defined list of orphans
2883
 
2884
allow_url_open
2885
--------------
2886
Following a change in the PHP ini config set on my website by my ISP, changes made to allow mPDF to work with allow_url_open=OFF.
2887
	- file_get_contents() changed to use libcurl (for CSS files)
2888
	- openTag('IMG') @fopen() and 3 functions _parsegif, _parseJPG, _parsePNG, edited to copy remote image files to local file to include images
2889
 
2890
FlowChart
2891
---------
2892
Changes to enable mPDF work with a custom script producing Flowcharts:
2893
	- WriteHTML() second parameter=3 will allow HTML to be parsed but not output
2894
	- fn. Arrow() added
2895
	- TableWordWrap() added parameter to force array return