CHANGELOG.txt 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185
  1. ===========================
  2. mPDF v4.2 (27/01/2010)
  3. ===========================
  4. NEW FEATURES
  5. ------------
  6. - image handling improved
  7. - table layout - additional control over resizing
  8. - vertical-alignment of images - better support for all CSS types
  9. - top and bottom margins collapse between block elements
  10. - improved support for CSS line-height
  11. - display progress bar whilst generating file
  12. - CSS @page selector can be specified when adding a pagebreak
  13. - CSS @page selector allows different margins, backgrounds, headers/footers on :first :left and :right pages
  14. - PNG images with alpha channel fully supported
  15. - ability to generate italic and bold font variants from base font file
  16. - CJK fonts to embed as subsets
  17. - "double" border on block elements
  18. - character substitution for missing characters in UTF-8 fonts
  19. - direct passing of dynamically produced image data
  20. - background-gradient and background-image can now co-exist
  21. Bug fixes
  22. ---------
  23. - empty variable (undefined var, false, null, array() etc.) sent to WriteHTML produced error message "Invalid UTF-8"
  24. - CJK in tables when not using CJK (utf-8-s) autosized very small as characters did not word-wrap
  25. - parsing stylesheets: background image not recognised if containbed uppercase characters in file name
  26. - "double" border on table used white between the lines instead of current background colour
  27. - mPDFI: template documents overwriting HTML headers
  28. - $this->shrink_tables_to_fit = 0 or false caused fatal errors
  29. - background color or images not printing correctly when breaking across pages
  30. - background not printed for List inside a block element
  31. - columns starting near end of page with no room for a line triggering column change (resulting in text misplaced) not page break
  32. - table cell not calculating cell height correctly when "orphan" characters (;:,.?! etc.) at end of line
  33. - table breaking page in column 2 when col 1 is rowspan'ned
  34. - margin-collapse at top of page not working if bookmark/annotation/indexentry/toc
  35. - column break triggered by HR triggering a second column break
  36. - an empty 'position:fixed' element with no/auto width or height caused fatal error
  37. - mPDFI: function Overwrite (to change text in existing PDF) - fatal error if using with encrypted file
  38. Bug - not fixed - see below
  39. - WriteHTML('',2) with '2' parameter not recognising 'margin-collapse:collapse' for DIVs or 'line-height' set in default CSS 'BODY'
  40. New or Updated Files
  41. --------------------
  42. mpdf.php
  43. classes/gif.php
  44. classes/indic.php
  45. compress.php
  46. config.php
  47. config_cp.php
  48. config_fonts.php
  49. mpdf.css
  50. includes/sub_core.php
  51. mpdfi/mpdfi.php
  52. unifont/ar_k_001.uni2gn.php
  53. All files in new folder: /progress/*.*
  54. NEW FOLDER /tmp/ required with read/write permissions - used for temporary image files or progress bars
  55. ===========================
  56. mPDF v4.1.1 (21/12/2009)
  57. ===========================
  58. Error corrected in /makefont/makefonts.php file (moved completed Unicode files to font folder instead of unifont)
  59. ===========================
  60. mPDF v4.1 (20/12/2009)
  61. ===========================
  62. MySQL support for embedded font subsets abandoned, and replaced with file-based.
  63. Files no longer required
  64. ------------------------
  65. config_db.php
  66. /unifont/RUNME.php
  67. /unifont/*.ufm and /unifont/*.t1a font files
  68. MySQL Database no longer required
  69. Files Updated
  70. -------------
  71. mpdf.php
  72. /classes/t1asm.php
  73. /makefont/makefonts.php
  74. New files
  75. ---------
  76. /unifont/*.dat and /unifont/*.dat.php font files
  77. Bug-fixes
  78. ---------
  79. - Image - If automatically resizing to fit maximum page size incorrectly subtracted margin-header
  80. - Annotation and textarea in same HTML chunk causes mPDF to crash (preg_replace textarea with /u modifier in AdjustHTML)
  81. - set_magic_quotes_runtime error ($mgr not $mqr)
  82. - Table align did not reverse when using RTL document
  83. Alteration: Image - if writing Image in fixedpos div position:absolute - to allow Image to be resized to full page size
  84. ===========================
  85. mPDF v4.0 (17/12/2009)
  86. ===========================
  87. Major additions
  88. ---------------
  89. - Ability to embed font subsets (creating much smaller files)
  90. - Much improved support for Arabic languages
  91. - Support for Indic languages including consonant conjuncts
  92. - Support for Fixed position block elements
  93. - New utility to help create your own fonts
  94. - PNG alpha channel transparency supported
  95. - New utility to create smaller mpdf script with reduced functionality (less memory)
  96. - Multiple Barcode types supported
  97. **********************************************************************************************
  98. * For more details see the documentation manual: http://mpdf1.com/manual/index.php?tid=410 *
  99. **********************************************************************************************
  100. Bug fixes (parsing CSS)
  101. -----------------------
  102. - <link href="" ... was not recognised if > 1 space between words
  103. - #Content p em { font-style:italic; } was applied to "#Content p"
  104. - @import url() embedded in a stylesheet file requires path fixed relative to stylesheet file
  105. - background-image url() embedded in a stylesheet file requires path fixed relative to stylesheet file
  106. - comment tags inside CSS <style> embedded in the HTML were removed
  107. Now fixed so <style><!-- ... --></style> works; <!-- <style>...</style> --> is removed
  108. Bug fixes (other)
  109. -----------------
  110. - clear (CSS property for floating elements) caused properties for that element to reset to defaults
  111. - width: auto caused collapse of border and padding on L & R of ordinary block elements
  112. - text-indent not inherited correctly (including em and % values)
  113. - named colour "steelblue" corrected RRGGBB hex code
  114. - table cell widths in %: if width of table cells set to >=100%, and not all columns are set
  115. This was fixed in 3.2 but led to problem where 2 cols: 1) 80% and 2) not set (see Table sizing test)
  116. Now fixed again to work for both(?)
  117. - parse PNG error fixed
  118. - bachground-image not correctly positioned in HTMLFooter and HTMLHeader (Not fixed properly in 3.2!)
  119. - fonts not supported with 0-9 in the name
  120. - font list in GetCodepage() in htmltoolkit.php (now config_cp.php) containing space " " not recognised
  121. - list number positioning
  122. - list font size set in CSS for UL/OL not working for first level list
  123. - table width (real value, not %) not working in nested table
  124. - GIF file failed if PDF file not compressed
  125. - list-style-type incorrectly inherited
  126. - line-height inheritance in lists
  127. - SetColumns added a new line - not required if at start of document/page
  128. - footer_line_spacing did not work
  129. - table cellPadding="" overwrote cell padding set on cell CSS
  130. - could not turn off Default non-HTML foter LINE
  131. - border specified as "em"
  132. - default values set in mpdf.css overriden by inherited properties e.g. <div><h1>Here</h1></div> lost font-size for H1
  133. ===========================
  134. mPDF v3.2 (25/10/2009)
  135. ===========================
  136. Bug fixes
  137. ---------
  138. - 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
  139. - Ouput download file changed to allow compatability with IE6 (http://mpdf.bpm1.com/forum/comments.php?DiscussionID=120&page=1#Item_4)
  140. - 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]
  141. - Table: if font changed in cell, font was not retoring properly afterwards causing errors (restoreInlineProperties())
  142. - Lists: list items containing <br />, font not restoring after bullet
  143. - Graceful support for block elements inside list items e.g. <li><p>... (not supported, but tolerated)
  144. - Index: Created dividing letters separately for Uppercase and lowercase
  145. - Incorrectly changing input character set when encountering e.g. charset=iso-8859-1 in the text of the document
  146. - Changed so only detects it if within <head>...</head>
  147. - 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
  148. - Background-image used in HTML footer not appearing (correctly)
  149. - RTL tables: nested tables will not automatically transpose L->R
  150. - "Keep heading with table" - changed to allow <h1 style=".."> not just <h1>
  151. - "Keep heading with table" - backgrounds (bgcolor, image or gradient) incorrectly handled - now removed
  152. - Rotated table spread over more than 1 page caused enclosing block background colours to be be rotated along with table
  153. - CSS text-indent % now correctly suported (% of containing block width)
  154. - CSS width em on a block element e.g. DIV now correctly suported
  155. - calculating _tableheight, if remainingpage==0, get error (div by zero)
  156. - Table moved to next page with page-break-inside=avoid, produced an enlarged table (font)
  157. - RTL text-align override on BODY text was not working consistently
  158. - Arab characters: Character &#x647; (HEH) appearing in Final presentation form instead of Isolated
  159. - Vertical position of background-image on whole page incorrect
  160. - SetProtection can now be used with no permissions set (was not working unless at least one permission set)
  161. Developers
  162. ----------
  163. Some more undefined indexes and variables declared (courtesy of DSmart http://mpdf.bpm1.com/forum/comments.php?DiscussionID=117&page=1#Item_0 )
  164. Comment lines removed for < v3.0 to tidy up code
  165. Enhancements
  166. ------------
  167. CSS style height now partially supported on block elements DIV, P, H1 etc. --IF--
  168. - block is all on one page
  169. - will extend the block but not shorten it
  170. - will not force a pagebreak (max. at bottom of page)
  171. - % is interpreted as % of printable page height (inside margins)
  172. <TFOOT> now supported (placed at start as in HTML spec) displays at end of table, and repeats as a footer
  173. Background-image and background-gradient now supported in TD and TH (works in all cases except: background-image is not rotated or
  174. positioned correctly if table is rotated)
  175. NB Background images and background-gradients do not work if Columns are being used, or if $use_kwt is TRUE (keep-with-table),
  176. or if page-break-inside:avoid is active.
  177. Updated files
  178. -------------
  179. mpdf.php
  180. htmltoolkit.php
  181. ===========================
  182. mPDF v3.1 (30/08/2009)
  183. ===========================
  184. Bug fixes
  185. ---------
  186. - Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com
  187. was giving http://www.yourdomain.com//image.png) [3.1]
  188. - Errors in parsing background CSS (background-repeat, background-position etc) [3.1]
  189. - Textarea did not corectly convert width or height in units relating to font e.g. em [3.0beta_01]
  190. - If page margin-bottom set to zero, SetHTMLfooter() crashes with "Division by zero" error [3.0beta_01]
  191. - Table with header row and rowspan in tbody, not calculating maxrowheightcorrectly
  192. - Prevent Index breaking column just after a dividing letter
  193. - Select or input form field when text around it is justified had text in the form field justified
  194. - TocBookMarkText needs to be htmlspecialchar-ed - decoded when entered inside <tocpagebreak>
  195. - <img src="" /> caused crash
  196. - DisplayPreferences used as a variable name and a function: function renamed to SetDisplayPreferences()
  197. - Image with src file not including a "." incorrectly parsed (e.g. http://www.domain.com/imagegenerator?params=23)
  198. New Features
  199. ------------
  200. - var $debug (true|false) default false; show or hide error reporting at output stage [3.1]
  201. - var $autoPageBreak (true|false) default true; allows overriding of automatic page breaks [3.0beta_02]
  202. - <indexinsert /> HTML equivalent of CreateIndex() [was CreateReference()]
  203. - 2nd attribute/parameter "xref" in IndexEntry() and <indexentry> - works like IndexEntrySee() as cross-reference entry
  204. - function SetWatermarkText allows null parameters to be passed i.e. SetWatermarkText() - will clear the WatermarkText
  205. - <watermarktext content="" alpha="" /> - HTML equivalent of SetWatermarkText()
  206. - <watermarkimage src="" alpha="" position="" size="" /> - HTML equivalent of SetWatermarkImage()
  207. Documentation
  208. -------------
  209. See Manual at http://mpdf.bpm1.com/manual/ for more information - especially:
  210. - User's Guide>>What Else Can I Do?>>Backgrounds & Borders
  211. - User's Guide>>What Else Can I Do?>>Floating blocks
  212. Files updated:
  213. -------------
  214. mpdf.php
  215. htmltoolkit.php
  216. graph.php
  217. Developers only
  218. ---------------
  219. 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.
  220. $arr = array();
  221. ...
  222. if ($arr['index'] == 5 ) {...}
  223. To prevent this, lines were added at the start of the mpdf.php script to turn error notices OFF.
  224. In a move towards making mPDF able to run with full error_reporting on, a large amount of the script has been altered
  225. e.g. the line above would be changed to:
  226. if (isset($arr['index'] && $arr['index'] == 5 ) {...}
  227. 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
  228. off in mPDF 3.1
  229. If you care to test it, please uncomment line 43 (//error_reporting(E_ALL);) and report any warning notices that you get.
  230. NB This has added about 40kB to the script size.
  231. ===========================
  232. mPDF v3.0beta (14/06/2009)
  233. ===========================
  234. New Features
  235. ------------
  236. - CSS "float" partially supported (as well as clear:left|right|both)
  237. - CSS "background-image" "background-position" "background-repeat" "background-color" "background" supported for block-level elements
  238. - CSS background-color and background-image for <body > element added: this covers the whole page i.e. not just inside the "margins"
  239. - CSS background-color and background-image can be defined for CSS @page{}
  240. - Background gradients (linear or radial) can be defined using a custom CSS style property
  241. - Border radius can be defined to give rounded edges to block elements (uses draft CSS3 spec.)
  242. - page number can be reset to any value during the document (in AddPage() <pagebreak> etc.)
  243. - PNG images: Interlaced and alpha-channel-set PNG images now supported
  244. - internal links supported in Indexes (parameter added to CreateIndex()/CreateReference(): $useLinking=true;)
  245. - HTML Headers and footers now support hyperlinks
  246. - improved handling of <br>, block elements, and text lines inside table - approximates better to browser handling
  247. - borders of block-level elements & table cell borders supported (partially) in columns
  248. - optional error reporting for problems with Images ($showImageErrors)
  249. - ToC will word-wrap long entries
  250. - internal links (Bookmarks, IndexEntry and ToCEntry) rewritten to give more accurate positioning (when used as <tag>)
  251. - autofont algorithm improved for CJK languages
  252. - define text before and after page numbers ($pagenumPrefix; $pagenumSuffix; $nbpgPrefix; $nbpgSuffix;)
  253. - Additional color names supported - full list from SVG1.0
  254. Bug fixes
  255. ---------
  256. - Column width not resetting after an automatic pagebreak, or after setting HTMLheader
  257. - using AutoFont unnecssarily changed htmlspecialchars to code causing errors
  258. - Lists inside a table - incorrectly calculating table cell height
  259. - CJK - 4-byte utf-8 chars not displaying properly (includes HKCS characters)
  260. - mailto: links incorrectly handled
  261. - TOCpagebreak() - usePaging default clarified: true unless specified as '', 0, '0' or false; (null ->true)
  262. - <tocpagebreak> (as html tag) with no "name" defined, used at start of page, added a further blank page(s)
  263. - Lists - inaccurate calculation of space required for numbers in certain circumstances
  264. - Generated images (.php) only working if cURL enabled - (fixed, but rquires allow_url_fopen if remote file)
  265. - flag added to turn off error reporting when buffering used ($allow_output_buffering = false;)
  266. - 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)
  267. - TOC - if not using ODD/EVEN paging, did not add extra page and messed up
  268. - Rotated table which did not fit on remaining page resized to bigger than default
  269. - HR of width less than 100% - text continued on line after it
  270. - HR alignment not working (fixed so both CSS text-align and margin: 0 0 0 auto etc work)
  271. - HR in table did not correctly re-size when necessary
  272. - characters in symbols/zapfdingbats which in non-utf-8 mode are represented as chr(173) incorrectly handled as soft-hyphens
  273. (bug introduced 2.5 with soft-hyphens - affects symbols &#8593; arrow-up and Zapfdingbats &#9313; encircled 2)
  274. - Internal links (anchors) - Annotation/Bookmarks etc. incorrectly positioned when page orientation changed
  275. - ToC - when using multiple ToCs, internal links were not correctly adjusted
  276. - anchor (a name="") used inside a table was incorrectly positioned at the end of table
  277. - Tables: cell height calculated incorrectly when BR used
  278. - Table rotated with "page-break-inside:avoid" not kept on one page
  279. - Table rotated and split over > 1 page - vertical alignment inaccurate
  280. - Headers/Footers (non_html) when no style set caused errors
  281. - Table: breaking page when using rowspan error (line 17142)
  282. - ToC: If no indent defined in HTML tag <tocpagebreak> or defined as 0 gave error
  283. Note
  284. ----
  285. In mPDF 3.0 the following sections of code have been significantly rewritten:
  286. - painting of borders and background colours for block-elements
  287. - table of contents
  288. - Index
  289. - vertical justification in columns (uses scaling to stretch vertically)
  290. NB changed htmltoolkit AdjustHTML - does not now remove <br> before </div>
  291. Warning - may display differently in normal text as well as tables
  292. Files updated:
  293. -------------
  294. mpdf.php
  295. htmltoolkit.php
  296. Developers only
  297. ---------------
  298. - Background-color handling in CSS changed so only inherited/cascaded when Columns active or Keep-block-together
  299. - otherwise would overwrite background image with inherited color
  300. - all %.2f used in sprintf() changed to %.3f in htmltoolkit.php and mpdf.php to increase accuracy of div border lines in columns etc.
  301. - variable $use_embeddedfonts_1252 renamed to $useOnlyCoreFonts as more precise: depracated but still supported.
  302. - this version included quite abit of tidying up/future-proofing some code:
  303. $var{0} changed to substr($var,0,1) etc. (due to go in PHP6)
  304. ereg_ changed to preg_ (depracated in PHP5.3) - (NB mainly in htmltoolkit.php)
  305. ===========================
  306. mPDF v2.5 (01/05/2009)
  307. ===========================
  308. New Features
  309. ------------
  310. - Automatic Hyphenation added, and support for soft-hyphens
  311. - Encryption works now for CJK language documents
  312. - Improved text justification
  313. - Support for 'generated' images e.g. "../ontheflyimage.php"
  314. Bug fixes
  315. ---------
  316. - Tables: cell height did not reduce if font-size used was smaller than table default
  317. - Columns: if setcolumns() to the same number already active - did not print out last bit of previous columns
  318. - 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)
  319. - <HR> in table cell was printing in incorrect position (bug introduced in mPDF 2.4)
  320. - Justification
  321. - if only one word on line, did not respect maximum character spacing
  322. - last character of line incorrectly had character spacing applied
  323. - Space at the end of last line of a Right Justify block - e.g. "end. </p>" now correctly ignored
  324. - &nbsp; incorrectly treated as a character when justifying text with word/char spacing
  325. - CJK punctuation (.,) added as 'orphans' to keep at end of line
  326. - PNG files - was still buggy reading larger PNG files (due to fread)
  327. Files updated:
  328. -------------
  329. mpdf.php
  330. htmltoolkit.php
  331. CJKdata.php
  332. /patterns/.. (new files)
  333. Developers only
  334. ---------------
  335. Variables renamed as more accurate or appropriate:
  336. - var $isunicode renamed as $is_MB
  337. - var $usingembeddedfonts renamed as $usingCoreFont
  338. CJK changed to act internally as UTF-8 encoded
  339. - (NB CJK Half-widths not supported from 2.5+ i.e. big5-hw gb-hw)
  340. ===========================
  341. mPDF v2.4 (23/04/2009)
  342. ===========================
  343. Files updated
  344. -------------
  345. mpdf.php
  346. htmltoolkit.php
  347. mpdfi/mpdfi.php
  348. New files
  349. ---------
  350. graph.php
  351. Graphs - Requires new folder: path_to_mpdf/graph_cache/ (must be writeable)
  352. New features
  353. ------------
  354. Annotations improved so they appear as a pop-up
  355. Re-use Document Templates (cf. RestartDocTemplate() in manual)
  356. Limited support for CSS float property on an IMG element allowing text wrapping e.g. <img style="float: right;"> (cf. Images in manual)
  357. Utility function PreparePreText() allows output of a text file which may include <pre>
  358. Automatic generation of graphs from data in tables (requires integration with JPGraph) (cf. Graphs in manual)
  359. Other Changes
  360. -------------
  361. IMPORTANT - User rights removed as not working with newer version of Adobe Reader 9 (affects Active forms and ability for users to modify annotations)
  362. Corrects text alignment when using {nb} or {nbpg} in (non-HTML) headers/footers
  363. Sets default timezone if not already set (at top of mpdf.php) to prevent E_STRICT ERROR message
  364. Suppresses E_NOTICE error reporting (at top of mpdf.php)
  365. Error capture in Output() to avoid PDF header being sent when error messages generated
  366. A function str_ireplace added to htmltoolkit to allow PHP4 to function
  367. Bug fixes
  368. ---------
  369. WMF images incorrectly positioned when in-line
  370. PNG images > 8kB failed to load - (fix in 2.3 didn't work - fixed properly this time)
  371. Annotations containing a new line (\n) causing an error
  372. Evaluation of <pre> text: "<code>[TAB] " evaluated incorrect number of spaces to follow to align tabs, because < was calculated as 4 chars (&lt;)
  373. ===========================
  374. mPDF v2.3 (22/03/2009)
  375. ===========================
  376. New Features
  377. ------------
  378. - Optionally detect language and when to use special fonts i.e. RTL (arabic), CJK (chinese), Thai (see SetAutoFont() etc.)
  379. - Supports HTML attribute "lang" in all tags and uses special fonts when required (see $useLang)
  380. - Joins Arabic and Farsi/Persian text into presentation forms
  381. - Import another PDF file and use as templates in your document (see UseTemplate() and mPDFI in the manual.)
  382. - Replace specified text strings in an existing PDF file (see OverWrite() etc.)
  383. - More than one Table of Contents can be used in a document (see tocpagebreak etc.)
  384. - Restore properties of open HTML block elements after a page break (variable $restoreBlockPagebreaks or new tag <formfeed>)
  385. - <annotation> <bookmark> <indexentry> <tocentry> can now accept characters <>'"& as htmlentities - htmlspecialchars(..., ENT_QUOTES)
  386. - <annotation> can now accept "\n" for new line
  387. - support for opacity (CSS3 property) for images
  388. - specify the number of spaces to substitute for TAB when parsing <pre> tags
  389. - greater control over margins and display when changing page orientation during document (see $forcePortraitMargins and $displayDefaultOrientation)
  390. Bug fixes
  391. ---------
  392. Fonts in CSS - Not parsing font-family: Trebuchet MS; correctly as trebuchet
  393. Fonts in CSS - CSS font-family: [unknown]; setting first $available_unifont rather than ignoring
  394. Images - not displaying on IIS platform
  395. Images - .wmf not displaying if (allow_url_fopen) not set
  396. Table borders - in defaultCSS, 'MARGIN-COLLAPSE'=> collapase not quoted therefore not working
  397. Line-break inside table - printing a blank background across page rather than just going down a line
  398. Form fields inside tables - will now resize if the table is autosized (shrunk)
  399. <pre> containing a '<' was changed to '&lt;'
  400. Tabs inside <pre> were all changed to 8 spaces, not the remainder following a string
  401. Header on first page was inset by 1mm left and right ($cMarginL and $cMarginR not set to zero)
  402. Table nested inside a cell with colspan > 1 was incorrectly handled
  403. PNG file crashed (?incorrectly defined PNG file) [adapted _parsepng to account for unexpected]
  404. Table or Cell - if font-size not recognised, mPDF set font-size to zero
  405. Font-sizes - [xx-small|x-small|small|medium|large|x-large|xx-large] were not recognised in tables
  406. ===========================
  407. mPDF v2.2.1 (17/02/2009)
  408. ===========================
  409. Bug fix - (bug introduced in 2.2)
  410. Table - header row did not return to top of page when repeating across pages.
  411. ===========================
  412. mPDF v2.2 (15/02/2009)
  413. ===========================
  414. Updated files from mPDF 2.1
  415. mpdf.php
  416. htmltoolkit.php
  417. mpdf.css (new)
  418. ===========================
  419. New files from mPDF <2.0 (only required for EAN Barcodes)
  420. font/ocrb.xx (several)
  421. unifont/ocrb.xx (several)
  422. IMPORTANT - you need to make sure the ocrb font is added to the config.php file
  423. - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
  424. ===========================
  425. Summary of changes
  426. - external stylesheet file (mpdf.css) is used to configure default values ($useDefaultCSS2 and $defaultCSS2 are no longer used)
  427. - special comment tags to hide mPDF tags from browsers: <!--mpdf ... mpdf-->
  428. - AddColumn() function added (equivalent to <columnbreak>)
  429. - annotations - pop-up messages the reader can move or delete (if you set permissions)
  430. - support for WMF images as well as GIF, JPG, PNG
  431. - watermark image can be set instead of, or as well as text
  432. - nested tables can include other content
  433. - improved control over table layout
  434. - margin: auto now supported for table and block elements
  435. A number of methods and variables have been renamed or reCapitalised for consistency.
  436. Changes should be backwards comaptible.
  437. All user methods start with a Capital, all user-defined variables start with lowercase.
  438. Affected:
  439. Reference() -> IndexEntry()
  440. CreateReference() -> CreateIndex()
  441. $TopicIsUnvalidated -> $showWatermark
  442. setUnvalidatedText() -> SetWatermarkText()
  443. PHP appears at present to be case-insensitive for function/method names
  444. All the following functions have been renamed in the script with a capital first letter:
  445. setUserRights()
  446. setBasePath()
  447. setAnchor2Bookmark()
  448. setHeader()
  449. setFooter()
  450. defHeaderByName()
  451. defFooterByName()
  452. setHeaderByName()
  453. setFooterByName()
  454. setHTMLHeader()
  455. setHTMLFooter()
  456. defHTMLHeaderByName()
  457. defHTMLFooterByName()
  458. setHTMLHeaderByName()
  459. setHTMLFooterByName()
  460. shaded_box()
  461. writeBarcode()
  462. Variable names changed to lowercase first letter:
  463. (Variables are case-sensitive therefore aliases have been set up)
  464. Anchor2Bookmark
  465. BiDirectional
  466. KeepColumns
  467. AliasNbPg
  468. AliasNbPgGp
  469. =========
  470. Bug fixes
  471. =========
  472. Columns - $keepColumns=true was incorrectly calculating the place to continue printing after 1 and half columns (of 3)
  473. 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
  474. HR in Table cell - if table cell contains only HR (and column otherwise empty), HR was printed outside cell
  475. HR in Table cell - if table cell ended with a HR, height was one line too much
  476. Table page-break-inside:avoid - caused mPDF into permanent loop in some circumstances
  477. Paging - Total Pages/Group {nb} and {nbgp} didn't work in CJK
  478. CSS - Border size thin, medium and thick were only recognised in lowercase
  479. Table-header - rowspan not correctly output in THEAD
  480. Default CSS - table empty-cell:hide changed to show (CSS specification)
  481. ===========================
  482. mPDF v2.1 (24/01/2009)
  483. ===========================
  484. New Features in Version 2.1
  485. ---------------------------
  486. - CSS support improved generally (especially for cascading CSS, lists)
  487. - TableHeader changed to allow multiple rows in THEAD
  488. CSS changes
  489. -----------
  490. - display: none (block elements only - not lists or tables, nor HR)
  491. - width (TD/TH)
  492. - list-style-type (will also recognise the list-style-type from list-style) (OL/UL)
  493. recognised values: disc|circle|square|decimal|lower-roman|upper-roman|lower-latin|upper-latin|lower-alpha|upper-alpha|none
  494. - 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)
  495. - 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
  496. Numbered Lists
  497. --------------
  498. Variables set at the top of mpdf.php can be set to change:
  499. - text alignment of numbers in numbered lists (default Right)
  500. var $list_align_style = 'R';
  501. - content to follow a numbered list marker e.g. '.' gives 1. or IV. whereas ')' gives 1) or a)
  502. var $list_number_suffix = '.';
  503. (These can be altered at run time, but are not changeable through stylesheets or in-line style)
  504. Writing broken segments of HTML
  505. -------------------------------
  506. 2 new parameters have been added to WriteHTML()
  507. function WriteHTML($html,$sub=0,$init=true,$close=true) {
  508. $close - Leaves buffers/variables etc. in current state, so that it can continue to write the HTML where it leaves off
  509. $init - Clears and resets buffers/variables
  510. (N.B. You must end with a WriteHTML that calls $close=true)
  511. Example:
  512. $mpdf->WriteHTML('<p>This is the beginning...', 2, true, false);
  513. $mpdf->WriteHTML('...this is the middle...', 2, false, false);
  514. $mpdf->WriteHTML('...and this is the end</p>', 2, false, true);
  515. Rotated text in table cells
  516. ---------------------------
  517. NB This UPDATE will change expected output from previous versions******
  518. Prior to v2.1 any cell set to rotate text anticlockwise was forced to vertical align = bottom.
  519. 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.
  520. =========
  521. Bug fixes
  522. =========
  523. - List - list starting after "<div>Then some text not in a block element<ol>" incorrectly output
  524. - Tables - if cell font-size set smaller than default for the table, does not shrink the cell height
  525. - Columns (tables) - columns breaking across rows e.g. in the middle of a table cell
  526. - Tables - if table width set to e.g. 100% but cols are less, was not making up to set width
  527. - Watermark - was not printing if using HTMLFooter
  528. - Lists - not aligning numbering correctly if different font sizes used for bullet & text etc.
  529. - Lists - indent of text did not correctly allow for Maximum number in <ol> list
  530. - Table does not always move correctly to a new page
  531. - Table cell incorrectly calculated height causing text to overflow cell when printed
  532. - 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)
  533. - Table cell width if set as a percent was being downsized when autosizing table
  534. - Table CSS was buggy - improved
  535. - SetBasePath (when fetching remote website) - now handles string with query string on it e.g. http://www.domain.com/index.php?tid=42
  536. - Table cells with Rotated text - text not positioned correctly
  537. - Page number totals not working in utf-8 mode
  538. ============================
  539. Code efficiency improvements
  540. ============================
  541. - BIG speed improvement (compared with 2.0) with tables (especially large tables)
  542. - considerable increase in speed if writing long HTML segments to mPDF
  543. - speed improvement for tables (may be very significant if some cells have a lot of text in them causing uneven column widths)
  544. NB To speed up program more, consider setting $mpdf->useSubstitutions=false; if you do not use any characters outside the codepage selected
  545. ===============
  546. Keep-with-table
  547. ===============
  548. (This was introduced in v2.0 but I forgot to document it)
  549. If you set $this->use_kwt = true;
  550. 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)
  551. See Known Issues re: Using kwt inside a div with border/background (doesn't work)
  552. ===========================
  553. mPDF v2.0 (07/12/2008)
  554. ===========================
  555. Main New Features in Version 2.0
  556. - nested tables are supported
  557. - supports both models of table border: separate and collapsed
  558. - improved parsing of CSS stylesheets, and better handling of styles throughout
  559. - additional recognised CSS styles
  560. - page orientation, size, and margins can be changed within the document, using PHP script or custom HTML
  561. - some limited support for @page CSS to define page-box areas, with crop/cross marks for printing
  562. - improved control over headers and footers (including HTML headers/footers)
  563. - improved presentation of Form elements including image-type input fields
  564. - generates an EAN barcode suitable for a book/printed publication
  565. - active forms can be generated - EXPERIMENTAL at present
  566. - change document permissions to allow the user to make annotations - EXPERIMENTAL at present
  567. NB Lines are commented in mPDF script as changes for mPDF 1.4 - this became v2.0
  568. =========
  569. UPGRADING
  570. =========
  571. 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.
  572. To upgrade from v<=1.3 to v2.0 you only need to copy and overwrite the following 2 files:
  573. mpdf.php
  574. htmltoolkit.php
  575. Plus (optionally) if you want to use the EAN Barcode function, you will also need:
  576. font/ocrb.xx (several)
  577. unifont/ocrb.xx (several)
  578. IMPORTANT - you need to make sure the ocrb font is added to the config.php file
  579. - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
  580. ==========
  581. Bug Fixes
  582. ==========
  583. <columns column-count="0"> did not turn off columns - Fixed
  584. Margins as % - e.g. margin-right: 50% set from CSS incorrectly applied 50% of the fontsize
  585. (Fixed - adding parameter to fn. ConvertSize in htmltoolkit.php and in calls to that function)
  586. DIV Width - e.g. div style="width: 50% was not working
  587. (Fixed - fn.SetCSS and OpenTag()'DIV')
  588. CSS values as Zero - p { margin: 0; } did not work in stylesheet unless 0 had a unit
  589. Multiple Non-breaking spaces collapsed - e.g. "1&nbsp; &nbsp; &nbsp;2" - was contracted to "1 2"
  590. (Fixed - fn.adjustHTML in htmltoolkit.php)
  591. 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
  592. (Fixed in fn.WriteFlowingBlock)
  593. Font size by inline style for form elements <input> <textarea> gave wrong size when using a relative size 0.9em
  594. (Fixed - fn.ConvertSize in htmltoolkit.php)
  595. Creation Date not correctly showing
  596. (Fixed - did not need to convert to UTF16)
  597. New block element started at end of page - block borders not painted
  598. (Fixed - fn.AddPage)
  599. DL did not close block correctly
  600. (Fixed - mistype in fn. CloseTag)
  601. Transparent not recognised as color/background-color
  602. (Attempted a fix by setting to ignore it! - fn. convertcolor in htmltoolkit.php)
  603. Zero (0) not displaying if only thing in table cell or tags e.g. <td>0</td> <p>0</p>
  604. (Fixed - fn.WriteHTML)
  605. 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.
  606. (Fixed)
  607. Could not copy from a completed PDF doc to clipboard when using a TrueTypeUnicode font
  608. (Fixed - fn._puttruetypeunicode - added CIDToGIDMap)
  609. Creating an Index (confusing called CreateReference in mPDF) based on only 1 column (i.e. columns off) caused it to print FAIL
  610. (Fixed - fn. CreateReference())
  611. Table of Contents - If a ToC entry reached other side of page a warning notice was produced
  612. Fixed - printing is now suppressed and it is moved down a line (but not when using rtl)
  613. "Keep Block Together" (i.e. page-break-inside: avoid for a block element)
  614. 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
  615. (Fixed)
  616. NB This is now ALWAYS disabled when it meets a table - can use page-break-inside:avoid for the table
  617. @import url(style.css) without quotation marks "" was not picked up, although it is valid HTML
  618. (Fixed - fn.ReadCSS())
  619. Reading CSS from external style sheets included all media
  620. Now set by default to ignore media="aural|braille"
  621. Allows media="print" but can exclude by: $mpdf->disablePrintCSS = true; (default = false)
  622. Works on both <link... and <style media="print">@import...
  623. See the web page example - this stops the CSS stylesheets specifically marked for "print" to be ignored
  624. Table borders (in collapsed model) incorrectly calculated which border had dominance (mPDF <=1.3 determined the overriding border by its color)
  625. (Fixed to follow CSS 2.1 specifications: width >> CSS dominance (cell>table) >> T & L > B & R)
  626. In the border-collapse=collapse mode, the following rules determine which border style "wins" in case of a conflict:
  627. 1. Borders with the 'border-style' of 'hidden' take precedence over all other conflicting borders.
  628. 2. narrow borders are discarded in favor of wider ones.
  629. 3. styles are preferred in this order: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and the lowest: 'inset'.
  630. 4. If border styles differ only in color, then a style set on a cell wins over one on a table.
  631. 5. When two elements of the same type conflict, then the one further to the left or top wins out.
  632. Parsing CSS, a missed level would not be picked up i.e. CSS = div.refstr1 p {...} would not pick up:
  633. <div class="refstr1"> <div class="another"> <p>...
  634. (Fixed - fn. MergeCSS by carrying everything forwards)
  635. Note: I removed - && !$this->blk[$this->blklvl-1]['cascadeCSS']['CLASS>>'.$attr['CLASS']]['depth']
  636. Not sure why I put it there in the first place!
  637. In a later bit of function - && $this->blk[$this->blklvl-1]['cascadeCSS'][$tag]['depth']>1
  638. Haven't removed this, but is it needed???
  639. 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)
  640. (Fixed)
  641. CSS properties color, font-weight, and font-style set on a table were not inherited by the table cells
  642. (Fixed - var $base_table_properties)
  643. When rotating a table, the text following was positioned incorrectly
  644. (Fixed - fn. printtablebuffer)
  645. When rotating a table, links were not adjusted in position e.g. <a href="">...
  646. (Fixed - fn. printtablebuffer)
  647. 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
  648. (Fixed)
  649. 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>
  650. (Fixed - var $listjustfinished;)
  651. 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)
  652. (Fixed - fn.WriteHTML)
  653. <link href="..." rel="stylesheet"> was not recognised (because the href comes before the rel)
  654. (Fixed)
  655. Read linked CSS stylesheet OR @import stylesheet - now includes both.
  656. <tag class="class1 class2"> did not set either class1 or class2. Fixed so that it will now pick out class1 (better than nothing!)
  657. CSS line-height as % - interpreted 120% as 120 (x the font-size) - Fixed so it now accepts % and numbers
  658. Setting the basepath (used for relative links/external stylesheets etc) with $mpdf->setBasePath() was generally buggy!
  659. Now allows a domain e.g. $mpdf->setBasePath("http://www.domain.com"); (previously needed slash on end)
  660. (Fixed - hopefully!)
  661. 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(...
  662. =============
  663. Improvements(?)
  664. =============
  665. Unsupported image files - mPDF died with an error message if image files didn't meet expected format e.g. an interlaced PNG file
  666. Changed so images are now replaced by the NOIMG image.
  667. Footer margin (HTML and normal footers) now determines the lowest point that is printed (rather than the place to start printing the footer)
  668. NB IMPORTANT CHANGE - not backwards comaptible
  669. 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]
  670. To insert the total number of pages in the document anywhere in the doc, just use '{nb}'
  671. The line: $mpdf->AliasNbPages();
  672. has now been uncommented allowing {nb} to be used
  673. NB This will always give the total no. of pages in the whole document regardless of any changes you have made to page numbering.
  674. You can change the default placeholder '{nb}' to any string using: $mpdf->AliasNbPages('[**my Chars**]');
  675. $mpdf->AliasNbPageGroups(); default="{nbpg}"
  676. Can be used to set the total number of pages in the current group i.e. between where page numbering is reset
  677. CSS border correctly fixes "solid 3mm #000000" i.e. (style width color) - (not a bug, but this is often incorrectly specified)
  678. Can now print div background behind a rotated table.
  679. You can keep columns as they are i.e. 1st column will finish page then start on second, by setting
  680. $mpdf->KeepColumns = true;
  681. Image constrain
  682. ===============
  683. Image size is constrained to current margins and page position. Extra parameter added to end of fn. allows you to override this.
  684. $mpdf->Image('files/images/frontcover.jpg',0,0,210,297,'jpg','',true, false); // e.g. the last "false" allows a full page picture
  685. Useful for e.g. a cover page for your document
  686. Cumulative CSS
  687. ==============
  688. In version <=1.3, if you call:
  689. $mpdf->WriteHTML($stylesheet,1);
  690. $mpdf->WriteHTML($html); // this one cleared the array $this->cascadeCSS; conatining cascaded CSS information from stylesheets
  691. You were meant to call:
  692. $mpdf->WriteHTML($html,2); // which doesn't re-parse the CSS information
  693. v2.0 changed so that
  694. $mpdf->WriteHTML($html); no longers clears the array $this->cascadeCSS and so can be used repeatedly;
  695. ================================================
  696. Additional CSSstyles & HTML attributes supported
  697. ================================================
  698. <BODY> - font-style, font-weight, color
  699. <IMG> - html attributes width="" and height=""
  700. <TABLE|TD|TH> - border: 'thin' 'medium' and 'thick' are now converted to 1px, 3px and 5px
  701. <TABLE|TD|TH> - border now respects all types - e.g. 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset'
  702. (NB mPDF only supports a full declaration of border e.g. "border: thin double #000000;")
  703. <TD|TH> - CSS style="white-space: nowrap" and HTML attribute nowrap="nowrap"
  704. <TABLE> - page-break-inside: avoid
  705. <TABLE> - border-collapse: separate|collapse
  706. <TABLE> - border-spacing: 2px 2px; (horizontal/vertical) or just one figure (both) NB same as cellSpacing
  707. <TABLE> - empty-cells: hide|show (border-collapse:separate only)
  708. <TABLE> - margin-left and margin-right (previously only supported top and bottom)
  709. <TABLE> - padding: (this was incorrectly used for TD/TH before) (border-collapse:separate only)
  710. <TD|TH> - padding:
  711. <TABLE|TD|TH> - inline style "background" works (with a color only) the same as "background-color"
  712. NB Table page-break-inside, autosize values and rotate are only respected for that set on first level table of nested tables
  713. <TABLE> - cellSpacing and cellPadding HTML attributes:
  714. NB cellSpacing is the same as CSS style "border-spacing"
  715. NB cellPadding is a <table> attribute, but sets the cell padding - not table padding
  716. <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)
  717. <BLOCK ELEMENTS> - page-break-before: always|left|right - NB any surrounding block tags will be closed before the new page is inserted.
  718. @page - see notes on Paged Media
  719. ==========================
  720. Unsupported HTML attribute
  721. ==========================
  722. <TD border="1"> - not valid HTML - no longer supported
  723. =========
  724. Additions
  725. =========
  726. "Keep-with-table"
  727. $mpdf->use_kwt = true; // default=false
  728. If set to true, will force any H1-H6 header immediately preceding a table to be kept together with the table
  729. - automatically sets the table to fit on one page (i.e. page-break-inside=avoid) if it is a rotated table
  730. - ignored if: Columns on, Keep-block-together active (page-break-inside=avoid for surrounding BLOCK), active Forms
  731. =====
  732. Notes
  733. =====
  734. NB Not a change - but note you can use this to allow you to feed html code encoded in other than utf-8:
  735. $mpdf->allow_charset_conversion=true;
  736. $mpdf->charset_in='windows-1252'; (needs suitable codes for iconv i.e. windows-1252 not win-1252)
  737. Fixing Optional tags
  738. ====================
  739. php.net website has illegal nesting of <dt>.. <dd> .. </dd> .. </dt> and <p>.. <div> .. </div> .. </p>
  740. The example wich parses the php.net webpage will not show correctly unless you change: $mpdf->allow_html_optional_endtags=false;
  741. Trying to fix incorrect (X)HTML with $mpdf->allow_html_optional_endtags==true cancels the P when it meets a DIV etc.
  742. EAN barcode
  743. ===========
  744. An EAN barcode can be generated
  745. function writeBarcode($code, $showisbn=1, $x='', $y='', $size=1, $border=0, $paddingL=1, $paddingR=1, $paddingT=2, $paddingB=2) {
  746. It accepts 12 or 13 digits with or without - hyphens as $code e.g.
  747. $mpdf->writeBarcode('978-1234-567-890', 1, $mpdf->x, $mpdf->y);
  748. NB - IMPORTANT***
  749. A new font - OCR-B font/unifont is required, and needs to be added to the config.php file
  750. cf. http://www.gs1uk.org/downloads/bar_code/Bar coding getting it right.pdf
  751. Barcode size must be between 0.8 and 2.0 (80% to 200%)
  752. CMYK Colors
  753. ===========
  754. Functions - SetDrawColor, SetTextColor and SetFillColor all now take an optional 4th parameter.
  755. If defined this will interpret the input as CMYK color i.e.
  756. SetDrawColor(15,82,0,10) // NB all values out of 100 - not 255 as for RGB
  757. htmltoolkit.php fn.ConvertColor() - now interprets custom color definition: cmyk(15,82,0,10)
  758. like rgb(r,g,b) except values out of 100
  759. Intended to be used for calling the functions separately - BUT works in a limited way with CSS - does not get reset or inherited correctly
  760. <p style="color:cmyk(215,31,15,10)"> does work
  761. DEFAULT CSS
  762. ===========
  763. $defaultCSS has been updated to reflect better the standard HTML default e.g. using serif, table borders separate, cell vertical-align top
  764. To keep mPDF 1.3 (my favourites) I have introduced:
  765. $mpdf->useDefaultCSS2 = true;
  766. ===================================
  767. Permissions - forms and Annotations - Experimental!
  768. ===================================
  769. You can set the Permissions for the PDF file to allow the user to make Comments (annotations)
  770. $mpdf->setUserRights($enabled=true[default]|false, $annots="/Create/Delete/Modify/Copy/Import/Export",
  771. $form="/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate", $signature="/Modify") )
  772. If you encrypt the file, make sure the permissions match e.g.:
  773. $mpdf->setUserRights();
  774. $mpdf->SetProtection(array('print','annots'),'yourPassword','myPassword');
  775. To allow this, changed the PDF-file version to %PDF1.5 (NB Probably needs PDF version > 1.5 but can't test for this...)
  776. NOTE: If you output the PDF file straight to the browser, it will only allow annotations after you save the document
  777. ===========================
  778. Active Forms - Experimental!
  779. ===========================
  780. At present , using active forms will prevent any internal and external links - that appear before active forms(?) - from working (why?)
  781. May need to save form for proper use - see example, when scroll forwards and back, the form disappears??
  782. Need to set Userrights (see above), and $mpdf->useActiveForms=true;
  783. For Output options, see separate notes.
  784. ============================
  785. Internal Programming changes
  786. ============================
  787. NB fn. tablerotate in htmltoolkit no longer used; now uses a 'transform' to shift the whole block of PDF code
  788. Graphics State
  789. ==============
  790. ExtGState does not need to be redefined - e.g. if a watermark added on every page, turning on and off alpha/transparency
  791. Unnecessary file size.
  792. function AddExtGState() edited to check if graphics state already exists before adding new one
  793. ASCII-proof code
  794. ================
  795. "»¤¬" 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
  796. Images
  797. ======
  798. 1) When copying remote images locally - incorrectly used "unset" now changed to "unlink"
  799. 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.
  800. NB Handling images was updated in v1.3 because my ISP changed allow_url_fopen to false
  801. 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.
  802. 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;
  803. Else, if CURL is available and allow_url_fopen is false: then tries using CURL.
  804. (Clear as mud???!!)
  805. ===========================
  806. mPDF v1.3 (21/09/2008)
  807. ===========================
  808. --------------
  809. Page Numbering
  810. --------------
  811. Program changes:
  812. fn. startPageNums() replaced with blank function
  813. fn. stopPageNums() - deleted
  814. fn. numPageNo() - deleted (all it did was return this->page anyway).
  815. var $_numbering - deleted
  816. var $_numberingFooter - deleted
  817. var $_numPageNum - deleted
  818. NEW
  819. New: fn. AddPages() (as for AddPage but with type=NEXT-ODD or NEXT-EVEN see below)
  820. Edited: fn. AddPage() - new parameters added
  821. AddPage(orientation(NO),type="E|O", resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off")
  822. New: fn. docPageNum() - returns the document page number (or '') based on...
  823. New : PageNumSubstitutions(array)
  824. New attributes:
  825. <pagebreak resetpagenum="1" // resets document page numbering to 1 from the new page onwards
  826. <pagebreak suppress="on" // turns on suppression of page numbering i.e. in headers and footers, {PAGENO} is replaced by blank string
  827. // ="0" turns suppression off
  828. <pagebreak pagenumstyle="I|i|A|a|1" // (re)sets page number stle/type from the new page onwards - as for lists
  829. // 1 - decimal; A/a - alpha (uppercase/lowercase); I/i - Roman (uppercase/lowercase)
  830. <pagebreak type="NEXT-ODD" // always adds a page + another if required to make odd
  831. <pagebreak type="NEXT-EVEN" // always adds a page + another if required to make even
  832. Edited: fn. TOC() // sets the marker for a Table of Contents
  833. New parameters allow the page-numbering details to be set
  834. 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
  835. new parameters as above for pagebreak resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off"
  836. Can also be set by attribute in the <TOC>
  837. <TOC resetpagenum="1" pagenumstyle="I|i|A|a|1", suppress="on|off" />
  838. --------------------------------------------
  839. Changes to allow Rotated Text in table Cells
  840. --------------------------------------------
  841. Edited:
  842. fn. OpenTag()
  843. fn. _tableColumnWidth()
  844. fn. _tableHeight()
  845. fn. _tableWrite()
  846. fn. tableHeader()
  847. New custom style or attribute -- "text-rotate" -- can be set for either <tr> or <th|td>
  848. Allowed values: 45 - 90 (written as integers) - rotates text anticlockwise, and -90 (clockwise)
  849. Positive values less than 90 force cell to: vertical-align:bottom
  850. Limitations:
  851. Only allows single line of text;
  852. Font, font-size, and style are determined by those set fro the cell, and cannot be changed;
  853. No changes in font (or any other in-line changes e.g. <sup>) are supported within the text
  854. Example: <tr style="text-rotate:90">...
  855. ---------
  856. Bug fixes
  857. ---------
  858. 1) HTML footer containing table was triggering page break.
  859. Added $this->InHTMLFooter as flag to prevent page triggering in footers containing table
  860. Set in fn.writeHTMLFooters() -> in fn.tableWrite() stops the pageBreak being reset
  861. 2) Crashing when libcurl not installed.
  862. Edited OpenTag() curl_init - added if (function_exists) to exclude crash when libcurl not installed
  863. 3) Single cell with borders not showing the borders.
  864. e.g. <table><tr><td style="border:1px solid #000000?>Hi</td></tr></table>
  865. Problem: mPDF overrides cell border properties with table border properties for external borders. $defaultCSS had CSS defined for table as '0px solid #000000'
  866. 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".
  867. 4) Empty textarea incorrectly handled (the following HTML code being output in the textarea)
  868. The html code for an empty textarea was incorrectly handled in htmltoolkit fn. AdjustHTML which has been edited
  869. ===========================
  870. mPDF v1.2 (2008-05-01)
  871. ===========================
  872. // Added v1.2 option to continue if invalid UTF-8 chars - used in function is_utf8()
  873. var $ignore_invalid_utf8 = false;
  874. Reading CSS in fn. ReadCSS() and applying in fn. MergeCSS() -
  875. Edited to allow Tags, class and id with the same name to be distinct i.e. h5 {...} .h5 {...} #h5 {...}
  876. * mPDF 1.2 This version supports: .class {...} / #id { .... }
  877. * ADDED p {...} h1[-h6] {...} a {...} table {...} thead {...} th {...} td {...} hr {...}
  878. * body {...} sets default font and fontsize
  879. * It supports some cascaded CSS e.g. div.topic table.type1 td
  880. * Does not support non-block level e.g. a#hover { ... }
  881. Table: font-size, weight, style, family and color should all work
  882. TD/TH: font-size, weight, style, family and color should all work
  883. Added to htmltoolkit - fn.array_merge_recursive_unique()
  884. memory_opt Removed in mPDF v1.2 - not working properly
  885. fn. _begindoc() - changed to %PDF1.4 (was 1.3) as PDF version
  886. Write HTML Headers and Footers
  887. ------------------------------
  888. fn. Close() - calls writeHTMLHeaders/Footers() before finishing doc
  889. fn. WriteHTML() - added parameter
  890. fn. _out - writes to outputbuffer when writing HTML footers/headers
  891. New
  892. fn. writeHTMLHeaders()
  893. fn. writeHTMLFooters()
  894. =======================
  895. mPDF v1.1 (2008-05-01)
  896. =======================
  897. Programming changes to increase efficiency
  898. ------------------------------------------
  899. fn. WriteHTML() - added lines to combine substituted characters <tta> etc
  900. Memory Optimization added (script from FPDF site) - edited fn. _putpages() and fn. _endpage()
  901. fn. SetFont() edited to return val quicker if font already set (increase efficiency)
  902. new vars chrs and ords are used to store chr() and ord() - quicker than using functions
  903. fn.setMBencoding() - only call mb_internal_encoding if need to change
  904. Bugs
  905. ----
  906. fn. SetDefaultFontSize() - edited to allow to override that set in defaultCSS
  907. fn. Output() - Added temporary(?) disablement of encryption in CJK as it doesn't work!
  908. fn. OpenTag() [LI] $this->blockjustfinished=false to prevents newline after first bullet of list within table
  909. Uses of mb_ereg_replace removed, and mb_split changed - requires regex_encoding (regex_encoding only used as UTF-8)
  910. fn. WriteHTML: attributes are trimmed with trim() to allow correct handling of e.g. class="bpmBook "
  911. fn. printbuffer() and fn. openTag() to ensure
  912. <div><div><p> outputs top margins/padding for both 1st and 2nd div
  913. and </p></div></div> ...
  914. fn. SetFont() added line - bug fixing in CJK fonts
  915. CSS functionality
  916. -----------------
  917. Added special CSS 'thead-underline' (similar to topntail)
  918. var $thead_font_weight; added (openTag) to enable setting of font-weight for <TH> cells
  919. Fixed table border inheritance: Table border inherits border="1" to cells, but not table style="border..."
  920. "page-break-inside: avoid" added (var keep_block_together) to allow a DIV or P to be kept on one page
  921. - not compatible with table autosize or table rotate
  922. - only works over maximum of 2 pages
  923. Enhancements
  924. ------------
  925. Orphans in line justification: R. Bracket ) added to defined list of orphans
  926. allow_url_open
  927. --------------
  928. 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.
  929. - file_get_contents() changed to use libcurl (for CSS files)
  930. - openTag('IMG') @fopen() and 3 functions _parsegif, _parseJPG, _parsePNG, edited to copy remote image files to local file to include images
  931. FlowChart
  932. ---------
  933. Changes to enable mPDF work with a custom script producing Flowcharts:
  934. - WriteHTML() second parameter=3 will allow HTML to be parsed but not output
  935. - fn. Arrow() added
  936. - TableWordWrap() added parameter to force array return