CHANGELOG.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. ===========================
  2. mPDF 5.4
  3. 14/02/2012
  4. ===========================
  5. Files changed
  6. -------------
  7. mpdf.php
  8. config.php
  9. compress.php
  10. classes/ttfontsuni.php
  11. classes/barcode.php
  12. classes/indic.php
  13. classes/svg.php
  14. examples/show_code.php ----- SECURITY RISK**
  15. examples/example49_changelog.php
  16. examples/example57_new_mPDF_v5-3_active_forms_b (replace example57_new_mPDF_v5-3_active_forms)
  17. includes/out.php
  18. mpdfi/fpdi_pdf_parser.php
  19. Files added
  20. -----------
  21. classes/bmp.php
  22. classes/directw.php
  23. classes/form.php
  24. classes/grad.php
  25. classes/tocontents.php
  26. classes/wmf.php
  27. examples/example58_new_mPDF_v5-4_features
  28. config.php changes
  29. ------------------
  30. Edited: $this->allowedCSStags, $this->innerblocktags, $this->defaultCSS; (CAPTION added in each case)
  31. Moved: Numerous $form_.. variables are now in /classes/form.php
  32. New config variables
  33. --------------------
  34. $this->bookmarkStyles = array();
  35. $this->cacheTables = true;
  36. New methods
  37. -----------
  38. function CircularText()
  39. function SetVisibility()
  40. New/Extended CSS
  41. ----------------
  42. box-shadow (block elements - does NOT support "inset")
  43. text-shadow (all text elements - does NOT support "blur")
  44. visibility: visible|hidden|printonly|screenonly (block-level elements and images IMG only)
  45. text-transform: capitalize|uppercase|lowercase (extended to support TD/TH)
  46. tr|td|th:nth-child(odd|even|2n+1)
  47. color, strikethrough, underline and background-color (extended to support rotated TD/TH)
  48. underline and strike-through (extended to support TD/TH)
  49. underline (line colour) (extended to work correctly in watermark)
  50. page-break-after: left|right|always (block elements and tables)
  51. NB respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
  52. background[-color]: extended to support rgba|cmyka|cmyk|hsla|hsl|spot
  53. border(extended to support inline elements)
  54. New HTML
  55. --------
  56. <caption>
  57. <textcircle />
  58. New features / Improvements
  59. ---------------------------
  60. Tables - Zebra Stripes
  61. Tables: overlapping rowspans (partially) supported
  62. Tables - Disk caching
  63. Using progress bars (or $showStats) now reports 'real' memory usage i.e. get_memory_usage(true)
  64. Support for query string in the URLs for external stylesheets e.g. @import url("style.css?ltcyy7");
  65. Table caption partially supported
  66. CircularText
  67. BookMark styling
  68. Spread tables i.e. can split table (columns) across several pages width.
  69. Can use chelvetica, ctimes and ccourier to specify core fonts in a non-core font document
  70. Spread tables i.e. can split table (columns) across several pages width.
  71. {colsum} in <tfoot> cell will insert a column total per page.
  72. SVG embedded as island in HTML supported
  73. Active Forms
  74. textarea and input (text types) now accept javascript as:
  75. onKeystroke, onValidate, onCalculate and onFormat
  76. onChange is depracated but works as onCalculate (for textarea and input)
  77. (PS Select still accepts onChange cf. 5.3.37)
  78. Ledger and Tabloid added as page formats recognised. NB Ledger is same as tabloid but landscape. In mPDF, both give the same size (portrait)
  79. so need to add -L e.g. Ledger-L for landscape.
  80. Internal script changes
  81. -----------------------
  82. Changed this->k to _MPDFK throughout all scripts
  83. Changes to color (packed binary data in string rather than array) to reduce memory usage esp in tables
  84. Internal variables Removed
  85. $usetableheader;
  86. $tableheadernrows;
  87. $tablefooternrows;
  88. vars $ChangePage, $p_bottom_border, $img_margin_top(+) $issetcolor + other similar removed
  89. Removed a whole load of // comments
  90. Updates to remove some more Warning Notices (not all marked in text)
  91. Border set on TR - changed so set on each cell, rather than retrospectively at end of TR
  92. All references to table['text'] removed as not needed - uses ['textbuffer'] instead
  93. OpenTag(TD) changes to reduce memory usage with tables
  94. Includes different method to set a default timezone
  95. fn _smallCaps does not need (undefined) $space
  96. this->chrs and this->ords replaced by chr() and ord()
  97. Headers in out.php updated to match those used in Output()
  98. Change to SetFont() to improve performance time
  99. Change to GetStringWidth() to improve performance time
  100. Corrected copying of Glyphs 0,1,2, to all subset fonts (non-SMP/SIP), and only setting 32->127 in subset
  101. Subset fonts (non-SMP/SIP) have additionally Unicode CMap tables (0,0,4 and 0,3,4) as well as Microsoft (3,1,4)
  102. Subset fonts (SMP/SIP) have CMap tables (1,0,6 and 3,0,4) - rather than 1,0,6 and 3,0,6
  103. Subset fonts (SMP/SIP) have 'name' table changed to give 1,0 and 3,0. As it is a symbol font (not Unicode encoded) :
  104. needs to have a name entry in 3,0 (e.g. symbol) - original font will have 3,1 (i.e. Unicode)
  105. Automatically checks for HTML code length > 100000 characters and gives error warning if
  106. PHP < 5.2.0 (as not configurable) or increases pcre.backtrack_limit if PHP < 5.3.7
  107. Removed/Depracated
  108. ------------------
  109. function UseTableHeader($opt=true) fn removed / depracated
  110. function UsePRE($opt=true) removed
  111. $attr['REPEAT_HEADER'] == true CSS removed / depracated
  112. $this->usepre=true; removed / depracated as never needed - always respects PRE whitespace
  113. ToC: NB Values can no longer be set directly e.g. as in example
  114. $mpdf->TOCheader = array(); // array as for setting header/footer
  115. $mpdf->TOCfooter = array(); // array as for setting header/footer
  116. $mpdf->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
  117. $mpdf->TOCpostHTML = ''; // HTML text to appear after table of contents
  118. $mpdf->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
  119. Need to use TOCpagebreak either direct (or array version) or as HTML
  120. OR if absolutley necessary, could use:
  121. $mpdf->tocontents->TOCheader = array(); // array as for setting header/footer
  122. $mpdf->tocontents->TOCfooter = array(); // array as for setting header/footer
  123. $mpdf->tocontents->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
  124. $mpdf->tocontents->TOCpostHTML = ''; // HTML text to appear after table of contents
  125. $mpdf->tocontents->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
  126. Further Details
  127. ===============
  128. CSS border on inline elements
  129. -----------------------------
  130. Support for CSS border (and variants) on inline elements e.g. <span style="border-bottom: 1px dashed #000000;">
  131. Border styles solid|dotted|dashed|double only are supported. Border radius not supported.
  132. Nested inline elements will have repeat left|right borders on the nested content (unlike browsers)
  133. Tables - Zebra Stripes
  134. ----------------------
  135. TABLE - striped rows cf. http://dev.opera.com/articles/view/zebra-striping-tables-with-css3/
  136. tr:nth-child(odd) { background-color: #99ff99; }
  137. thead tr:nth-child(3n+2) { background-color: #FFBBFF; }
  138. td:nth-child(2n+1) { background-color: #BBBBFF; }
  139. table.zebraTable td:nth-child(2n+1) { background-color: #BBBBFF; }
  140. table.zebraTable th:nth-child(2n+1) { background-color: #BBBBFF; }
  141. NB mPDF does NOT correctly apply specificity to all CSS
  142. table.zebra tbody tr:nth-child(2n+1) td { background-color: #FFFFBB; }
  143. table.zebra tbody td:nth-child(odd) { background-color: #BBBBFF; }
  144. should make every odd row yellow, and every odd coloumn blue, but with the row/yellow overriding the column/blue.
  145. 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
  146. table.zebra tbody tr:nth-child(2n+1) td:nth-child(1n+0) { background-color: #FFFFBB; }
  147. (The :nth-child(1n+0) selector just selects every td cell.)
  148. Tables - Disk caching
  149. ---------------------
  150. TABLES: using disk caching
  151. // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
  152. // executon time and disk access (read and write)
  153. $this->cacheTables = true;
  154. NB $this->packTableData will be overridden to => true; // required for cacheTables
  155. $this->simpleTables will be overridden to => false; // Cannot co-exist with cacheTables
  156. Table caption
  157. -------------
  158. Must come immediately after <table...>
  159. CSS caption-side and HTML align attribute of top|bottom supported (not attribute left|right)
  160. Handled as a separate block element brought outside the table, so:
  161. CSS will not cascade correctly on the table
  162. width of caption block is that of page or of the block element containing the table
  163. so alignment will be to the page-width not the table width
  164. if table page-break-after: always, the caption will follow the pagebreak.
  165. This does work:
  166. <style>
  167. .tablecaption { caption-side: bottom; text-align: left; font-weight: bold; color: green; }
  168. </style>
  169. ...
  170. <table>
  171. <caption class="tablecaption">Caption title here</caption>
  172. <tbody>
  173. CSS visibility: printonly, screenonly
  174. -------------------------------------
  175. Roughly based on CSS
  176. Works on Block elements P, DIV etc, or Image
  177. Cannot nest / layer.
  178. Inner blocks/image with set visibility are ignored if already set on enclosing block element.
  179. (Block element) does not work inside table (image does)
  180. So 'visible' does nothing but is set as default
  181. (NB Changes output to PDF version 1.5)
  182. Incompatible with PDFA / PDFX
  183. 'visibility'
  184. Value: visible | hidden | (collapse | inherit)
  185. Initial: visible
  186. Applies to: all elements
  187. Inherited: yes
  188. The 'visibility' property specifies whether the boxes generated by an element are rendered.
  189. Invisible boxes still affect layout (set the 'display' property to 'none' to suppress box generation altogether).
  190. Values have the following meanings:
  191. visible
  192. The generated box is visible.
  193. hidden
  194. The generated box is invisible (fully transparent, nothing is drawn), but still affects layout.
  195. Furthermore, descendants of the element will be visible if they have 'visibility: visible'.
  196. collapse | inherit
  197. NOT supported in mPDF
  198. CUSTOM:
  199. printonly | screenonly
  200. Added VISIBILITY function
  201. $mpdf->SetVisibility('screenonly'); or 'printonly' 'visible' or 'hidden'
  202. (NB Changes output to PDF version 1.5)
  203. Incompatible with PDFA / PDFX
  204. CircularText
  205. ------------
  206. function CircularText($x, $y, $r, $text, $align='top', $kerning=120, $fontwidth=100) {
  207. x: abscissa of center
  208. y: ordinate of center
  209. r: radius of circle
  210. text: text to be printed
  211. align: text alignment: top or bottom. Default value: top
  212. kerning: spacing between letters in percentage. Default value: 120. Zero is not allowed.
  213. fontwidth: width of letters in percentage. Default value: 100. Zero is not allowed
  214. - now uses Kerning between letters if useKerning == true (set manually see example)
  215. BookMark styling
  216. ----------------
  217. New configurable variable to control appearance of Bookmarks e.g.
  218. $this->bookmarkStyles = array(
  219. 0 => array('color'=> array(0,64,128), 'style'=>'B'),
  220. 1 => array('color'=> array(128,0,0), 'style'=>''),
  221. 2 => array('color'=> array(0,128,0), 'style'=>'I'),
  222. );
  223. Column sums
  224. -----------
  225. (Also changed some preg_replace to str_replace to improve performance)
  226. To use: just add {colsum} to any cells of the table footer <tfoot>
  227. Add a number to specify a fixed number of decimal points e.g. <td>£{colsum2}</td> will give you £123.40
  228. The width of the column will be calculated using the actual string {colsum} as a placeholder.
  229. If you need the column to be wider, use underscores "_" to pad it e.g. {colsum2_____}
  230. Spread tables
  231. -------------
  232. i.e. can split table (columns) across several pages width.
  233. CSS <table style="overflow: visible">
  234. Cannot use with:
  235. $this->kwt - ignored
  236. $this->table_rotate - ignored
  237. $this->table_keep_together - ignored
  238. $this->ColActive - cancels spread tables
  239. Messes up with:
  240. $mpdf->forcePortraitHeaders = true;
  241. $mpdf->forcePortraitMargins = true;
  242. Problems with CJK, and RTL
  243. Will do no resizing of fonts at all.
  244. Maximum width of column = page width i.e. will not split columns across pages - NB will keep colspan>1 on one page
  245. If table row too high for page will die with error message.
  246. Will override some specs for width if this creates conflicts
  247. Recommended to specify absolute value of width on each column.
  248. Bug fixes
  249. =========
  250. Dottab - if text after dottab is hyperlinked <a></a> then dots are underlined
  251. page-break-before now respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
  252. Annotation() function called directly with colorarray(r,g,b)
  253. Added urldecode to _getImage to cope with ../name%20of%20image.jpg
  254. 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
  255. [barcode.php] Allow &nbsp; in C39 codes - will be changed to spaces
  256. <table> inside a <div position:fixed, left:300px;> not calculating table width correctly
  257. - leading to either upside down table or error width less than 1 character
  258. Depracated magic_quotes_runtime() in compress.php
  259. DIRECTW included twice in compress.php
  260. FORMS mark up for compress.php corrected
  261. double backslashes not preserved inside <pre> or <textarea>
  262. font-weight and font-style not recognised in <pageheader>
  263. Progress bars causing corrupt PDF file (out.php) changed fopen from "r" mode to "rb" (binary)
  264. Target around image - <a href="#internaltarget"><img ... /></a> - not working
  265. SmallCaps in <thead> error
  266. Fonts with "name" table in format 1 not recognised correctly
  267. Rotated table which does not fit on remaining page, forces a new page even if already at top of page
  268. Locale causing problems - all instances of sprintf() using %.3f changed to %.3F so not locale aware
  269. CSS border radius not implemented on fixed/absolute positioned block element
  270. Background color in rotated table extending way beyond bottom of table
  271. Nested table containing <thead> or <tfoot> was confused with <thead> or <tfoot> of parent table
  272. Correct handling of spaces, < or & in textarea
  273. <option> and <input ..> attributes value/title decoded with fn lesser_entity_decode instead of htmlspecialchars_decode to include &apos;
  274. line width not restored to correct value after "line-through" text in Cell()
  275. Kannada - incorrect positioning of Reph
  276. Forms - In <input> or <option> (select) not correctly handling HTML named entities e.g. &lt; in value or title
  277. Active forms - &nbsp; as Value or Title incorrectly showing as Euro - PDFDocEncoding fixed
  278. Unicode data in embedded fonts not encrypted when doc encrypted
  279. Nested block elements which are empty including innermost one, top margin of innermost block was ignored
  280. font-size: xx% inside a block was setting on block's parent font-size
  281. Active forms - radio buttons (removed name from Widget - leave on Radio group)
  282. causing problems accessing field for radio buttons
  283. When using simple tables and border-collapse, if table border set, but cell borders not set, should display table border (fixed)
  284. position:fixed block - if neither top nor bottom nor height specified, was positioned incorrectly (y)
  285. Leave - if top, bottom, margin-top, margiin-bottom and height are all left unspecified (or auto), will centre vertically
  286. on the page (specific to mPDF - not consistent with CSS2.1)
  287. But if any one of them are specified (including e.g. margin-top=0), follows CSS spec, so top is the current "static" position
  288. background-image-opacity=0 not working on BODY or BLOCK
  289. Lists - if LI continues after a nested List, would add as a new LI item (should continue as part of earlier LI item)
  290. fn WriteCell() converts to 'windows-1252' when required
  291. if multiple calls to mPDF used, cannot redefine function cmp()
  292. internal link targets <a name="xx" /> in ToC not moved when using: page-break-inside:avoid
  293. internal link targets <a name="xx" /> not moved when using: columns, page-break-inside:avoid, keep-with-table or table rotate
  294. 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
  295. Bug is fixed, but example file needed updating to onCalculate for the display field.
  296. Table cell: if height set as %, currently sets it as % of page-width; instead this now ignores it.
  297. 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)
  298. so mPDF converts to this string and seems to work.
  299. OCR characters wrong size in barcodes if using different ocr font