CHANGELOG.txt 143 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148
  1. ===========================
  2. mPDF 6.1.0
  3. 26/04/2016
  4. ===========================
  5. - Composer updates
  6. - First release officially supporting Composer
  7. - Updated license in composer.json
  8. - Chmod 777 on dirs ttfontdata, tmp, graph_cache after composer install
  9. - Requiring PHP 5.4.0+ with Composer
  10. - Code style
  11. - Reformated (almost) all PHP files to keep basic code style
  12. - Removed trailing whitespaces
  13. - Converted all txt, php, css, and htm files to utf8
  14. - Removed closing PHP tags
  15. - Change all else if calls to elseif
  16. - Added base PHPUnit tests
  17. - Added Travis CI integration with unit tests
  18. - Changed all mPDF::Error and die() calls to throwing MpdfException
  19. - PDF Import changes
  20. - FPDI updated to 1.6.0 to fix incompatible licenses
  21. - FPDI loaded from Composer or manually only
  22. - Removed iccprofiles/CMYK directory
  23. - Renamed example files: change spaces to underscores to make scripting easier
  24. - Fixed LEDGER and TABLOID paper sizes
  25. - Implemented static cache for mpdf function ConvertColor.
  26. - Removed PHP4 style constructors
  27. - Work with HTML tags separated to Tag class
  28. - Fixed most Strict standards PHP errors
  29. - Add config constant so we can define custom font data
  30. - HTML
  31. - fax & tel support in href attribute
  32. - Check $html in $mpdf->WriteHTML() to see if it is an integer, float, string, boolean or
  33. a class with __toString() and cast to a string, otherwise throw exception.
  34. - PHP 7
  35. - Fix getting image from internal variable in PHP7 (4dcc2b4)
  36. - Fix PHP7 Fatal error: 'break' not in the 'loop' or 'switch' context (002bb8a)
  37. - Fixed output file name for D and I output modes (issue #105, f297546)
  38. ===========================
  39. mPDF 6.0
  40. 20/12/2014
  41. ===========================
  42. New features / Improvements
  43. ---------------------------
  44. Support for OpenTypeLayout tables / features for complex scripts and Advances Typography.
  45. Improved bidirectional text handling.
  46. Improved line-breaking, including for complex scripts e.g. Lao, Thai and Khmer.
  47. Updated page-breaking options.
  48. Automatic language mark-up and font selection using autoScriptToLang and autoLangToFont.
  49. Kashida for text-justification in arabic scripts.
  50. Index collation for non-ASCII characters.
  51. Index mark-up allowing control over layout using CSS.
  52. {PAGENO} and {nbpg} can use any of the number types as in list-style e.g. set in <pagebreak> using pagenumstyle.
  53. CSS support for lists.
  54. Default stylesheet - mpdf.css - updated.
  55. Added CSS support
  56. -----------------
  57. - lang attribute selector e.g. :lang(fr), [lang="fr"]
  58. - font-variant-position
  59. - font-variant-caps
  60. - font-variant-ligatures
  61. - font-variant-numeric
  62. - font-variant-alternates - Only [normal | historical-forms] supported (i.e. most are NOT supported)
  63. - font-variant - as above, and except for: east-asian-variant-values, east-asian-width-values, ruby
  64. - font-language-override
  65. - font-feature-settings
  66. - text-outline is now supported on TD/TH tags
  67. - hebrew, khmer, cambodian, lao, and cjk-decimal recognised as values for "list-style-type" in numbered lists and page numbering.
  68. - list-style-image and list-style-position
  69. - transform (on <img> only)
  70. - text-decoration:overline
  71. - image-rendering
  72. - unicode-bidi (also <bdi> tag)
  73. - vertical-align can use lengths e.g. 0.5em
  74. - line-stacking-strategy
  75. - line-stacking-shift
  76. ================
  77. mPDF 5.7.4
  78. 15/12/2014
  79. ================
  80. Bug Fixes & Minor Additions
  81. ---------------------------
  82. - SVG images now support embedded images e.g. <image xlink:href="image.png" width="100px" height="100px" />
  83. - SVG images now supports <tspan> element e.g. <tspan x,y,dx,dy,text-anchor >, and also <tref>
  84. - SVG images now can use Autofont (see top of classes/svg.php file)
  85. - SVG images now has limited support for CSS classes (see top of classes/svg.php file)
  86. - SVG images - style inheritance improved
  87. - SVG images - improved handling of comments and other extraneous code
  88. - SVG images - fix to ensure opacity is reset before another element
  89. - SVG images - font-size not resetting after a <text> element
  90. - SVG radial gradients bug (if the focus [fx,fy] lies outside circle defined by [cx,cy] and r) cf. pservers-grad-15-b.svg
  91. - SVG allows spaces in attribute definitions in <use> or <defs> e.g. <use x = "0" y = "0" xlink:href = "#s3" />
  92. - SVG text which contains a < sign, it will break the text - now processed as &lt; (despite the fact that this does not conform to XML spec)
  93. - SVG images - support automatic font selection and (minimal) use of CSS classes - cf. the defined constants at top of svg.php file
  94. - SVG images - text-anchor now supported as a CSS style, as well as an HTML attribute
  95. - CSS support for :nth-child() selector improved to fully support the draft CSS3 spec - http://www.w3.org/TR/selectors/#nth-child-pseudo
  96. [NB only works on table columns or rows]
  97. - text-indent when set as "em" - incorrectly calculated if last text in line in different font size than for block
  98. - CSS not applying cascaded styles on <A> elements - [changed MergeCSS() type to INLINE for 'A', LEGEND, METER and PROGRESS]
  99. - fix for underline/strikethrough/overline so that line position(s) are based correctly on font-size/font in nested situations
  100. - Error: Strict warning: Only variables should be passed by reference - in PHP5.5.9
  101. - bug accessing images from some servers (HTTP 403 Forbidden whn accessed using fopen etc.)
  102. - Setting page format incorrectly set default twice and missed some options
  103. - bug fixed in Overwrite() when specifying replacement as a string
  104. - barcode C93 - updated C93 code from TCPDF because of bug - incorrect checksum character for "153-2-4"
  105. - Tables - bug when using colspan across columns which may have a cell width specified
  106. cf. http://www.mpdf1.com/forum/discussion/2221/colspan-bug
  107. - Tables - cell height (when specified) is not resized when table is shrunk
  108. - Tables - if table width specified, but narrower than minimum cell wdith, and less than page width - table will expand to
  109. minimum cell width(s) as long as $keep_table_proportions = true
  110. - Tables - if using packTableData, and borders-collapse, wider border is overwriting content of adjacent cell
  111. Test case:
  112. <table style="border-collapse: collapse;">
  113. <tr><td style="border-bottom: 42px solid #0FF; "> Hallo world </td></tr>
  114. <tr><td style="border-top: 14px solid #0F0; "> Hallo world </td></tr>
  115. </table>
  116. - Images - image height is reset proportional to original if width is set to maximum e.g. <img width="100%" height="20mm"
  117. - URL handling changed to work with special characters in path fragments; affects <a> links, <mg> images and
  118. CSS url() e.g background-image
  119. - also to ignore "../" included as a query value
  120. - Barcodes with bottom numerals e.g. EAN-13 - incorrect numeral size when using core fonts
  121. --------------------------------
  122. NB Spec. for embedded SVG images:
  123. as per http://www.w3.org/TR/2003/REC-SVG11-20030114/struct.html#ImageElement
  124. Attributes supported:
  125. x
  126. y
  127. xlink:href (required) - can be jpeg, png or gif image - not vector (SVG or WMF) image
  128. width (required)
  129. height (required)
  130. preserveAspectRatio
  131. Note: all attribute names and values are case-sensitive
  132. width and height cannot be assigned by CSS - must be attributes
  133. ---------------------------------
  134. ================
  135. mPDF 5.7.3
  136. 24/8/2014
  137. ================
  138. Bug Fixes & Minor Additions
  139. ---------------------------
  140. - Tables - cellSpacing and cellPadding taking preference over CSS stylesheet
  141. - Tables - background images in table inside HTML Footer incorrectly positioned
  142. - Tables - cell in a nested table with a specified width, should determine width of parent table cell
  143. (cf. http://www.mpdf1.com/forum/discussion/1648/nested-table-bug-)
  144. - Tables - colspan (on a row after first row) exceeds number of columns in table
  145. - Gradients in Imported documents (mPDFI) causing error in some browsers
  146. - Fatal error after page-break-after:always on root level block element
  147. - Support for 'https/SSL' if file_get_contents_by_socket required (e.g. getting images with allow_url_fopen turned off)
  148. - Improved support for specified ports when getting external CSS stylesheets e.g. www.domain.com:80
  149. - error accessing local .css files with dummy queries (cache-busting) e.g. mpdfstyleA4.css?v=2.0.18.9
  150. - start of end tag in PRE incorrectly changed to &lt;
  151. - error thrown when open.basedir restriction in effect (deleting temporary files)
  152. - image which forces pagebreak incorrectly positioned at top of page
  153. - [changes to avoid warning notices by checking if (isset(x)) before referencing it]
  154. - text with letter-spacing set inside table which needs to be resixed (shrunk) - letter-spacing was not adjusted
  155. - nested table incorrectly calculating width and unnecessarily wrapping text
  156. - vertical-align:super|sub can be nested using <span> elements
  157. - inline elements can be nested e.g. text <sup>text<sup>13</sup>text</sup> text
  158. - CSS vertical-align:0.5em (or %) now supported
  159. - underline and strikethrough now use the parent inline block baseline/fontsize/color for child inline elements *** change in behaviour
  160. (Adjusts line height to take account of superscript and subscript except in tables)
  161. - nested table incorrectly calculating width and unnecessarily wrapping text
  162. - tables - font size carrying over from one nested table to the next nested table
  163. - tables - border set as attribute on <TABLE> overrides border set as CSS on <TD>
  164. - tables - if table width set to 100% and one cell/column is empty with no padding/border, sizing incorrectly
  165. (http://www.mpdf1.com/forum/discussion/1886/td-fontsize-in-nested-table-bug-#Item_5)
  166. - <main> added as recognised tag
  167. - CSS style transform supported on <img> element (only)
  168. All transform functions are supported except matrix() i.e. translate(), translateX(), translateY(), skew(), skewX(), skewY(),
  169. scale(), scaleX(), scaleY(), rotate()
  170. NB When using Columns or Keep-with-table (use_kwt), cannot use transform
  171. - CSS background-color now supported on <img> element
  172. - @page :first not recognised unless @page {} has styles set
  173. - left/right margins not allowed on @page :first
  174. ================
  175. mPDF 5.7.2
  176. 28/12/2013
  177. ================
  178. Bug Fixes
  179. ---------
  180. - <tfoot> not printing at all (since v5.7)
  181. - list-style incorrectly overriding list-style-type in cascading CSS
  182. - page-break-after:avoid not taking into account bottom padding and margin when estimating if next line can fit on page
  183. - images not displayed when using "https://" if images are referenced by src="//domain.com/image"
  184. - +aCJK incorrectly parsed when instantiating class e.g. new mpDF('ja+aCJK')
  185. - line-breaking - zero-width object at end of line (e.g. index entry) causing a space left untrimmed at end of line
  186. - ToC since v5.7 incorrectly handling non-ascii characters, entities or tags
  187. - cell height miscalculated when using hard-hyphenate
  188. - border colors set with transparency not working
  189. - transparency settings for stroke and fill interfering with one another
  190. - 'float' inside a HTML header/footer - not clearing the float before first line of text
  191. - error if script run across date change at midnight
  192. - temporary file name collisions (e.g. when processing images) if numerous users
  193. - <watermarkimage> position attribute not working
  194. - < (less-than sign) inside a PRE element, and NOT start of a valid tag, was incorrectly removed
  195. - file attachments not opening in Reader XI
  196. - JPG images not recognised if not containing JFIF or Exif markers
  197. - instance of preg_replace with /e modifier causing error in PHP 5.5
  198. - correctly handle CSS URLs with no scheme
  199. - Index entries causing errors when repeat entries are used within page-break-inside:avoid, rotated tables etc.
  200. - table with fixed width column and long word in cell set to colspan across this column (adding spare width to all columns)
  201. - incorrect hyphenation if multiple soft-hyphens on line before break
  202. - SVG images - objects contained in <defs> being displayed
  203. - SVG images - multiple, or quoted fonts e.g. style="font-family:'lucida grande', verdana" not recognised
  204. - SVG images - line with opacity=0 still visible (only in some PDF viewers/browsers)
  205. - text in an SVG image displaying with incorrect font in some PDF viewers/browsers
  206. - SVG images - fill:RGB(0,0,0) not recognised when uppercase
  207. - background images using data:image\/(jpeg|gif|png);base64 format - error when reading in stylesheet
  208. New CSS support
  209. ---------------
  210. - added support for style="opacity:0.6;" in SVG images - previously only supported style="fill-opacity:0.6; stroke-opacity: 0.6;"
  211. - improved PNG image handling for some cases of alpha channel transparency
  212. - khmer, cambodian and lao recognised as list-style-type for numbered lists
  213. SVG Images
  214. ----------
  215. Limited support for <use> and <defs>
  216. ================
  217. mPDF 5.7.1
  218. 1/09/2013
  219. ================
  220. 1) FILES: mpdf.php
  221. Bug fix; Dollar sign enclosed by <pre> tag causing error.
  222. Test e.g.: <pre>Test $1.00 Test</pre> <pre>Test $2.00 Test</pre> <pre>Test $3.00 Test</pre> <pre>Test $4.00 Test</pre>
  223. -----------------------------
  224. 2) FILES: includes/functions.php AND mpdf.php
  225. Changes to preg_replace with /e modifier to use preg_replace_callback
  226. (/e depracated from PHP 5.5)
  227. -----------------------------
  228. 3) FILES: classes/barcode.php
  229. Small change to function barcode_c128() which allows ASCII 0 - 31 to be used in C128A e.g. chr(13) in:
  230. <barcode code="5432&#013;1068" type="C128A" />
  231. -----------------------------
  232. 4) FILES: mpdf.php
  233. Using $use_kwt ("keep-[heading]-with-table") if <h4></h4> before table is on 2 lines and pagebreak occurs after first line
  234. the first line is displayed at the bottom of the 2nd page.
  235. Edited so that $use_kwt only works if the HEADING is only one line. Else ignores (but prints correctly)
  236. -----------------------------
  237. 5) FILES: mpdf.php
  238. Clearing old temporary files from _MPDF_TEMP_PATH will now ignore "hidden" files e.g. starting with a "." .htaccess, .gitignore etc.
  239. and also leave dummy.txt alone
  240. -----------------------------
  241. ===========================
  242. mPDF 5.7
  243. 14/07/2013
  244. ===========================
  245. Files changed
  246. -------------
  247. config.php
  248. mpdf.php
  249. classes/tocontents.php
  250. classes/cssmgr.php
  251. classes/svg.php
  252. includes/functions.php
  253. includes/out.php
  254. examples/formsubmit.php [Important - Security update]
  255. Updated Example Files in /examples/
  256. -----------------------------------
  257. All example files
  258. mpdfstyleA4.css
  259. config.php
  260. ----------
  261. Removed:
  262. $this->hyphenateTables
  263. $this->hyphenate
  264. $this->orphansAllowed
  265. Edited:
  266. "hyphens: manual" - Added to $this->defaultCSS
  267. $this->allowedCSStags now includes '|TEXTCIRCLE|DOTTAB'
  268. New:
  269. $this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-');
  270. $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2);
  271. $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2);
  272. $this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin (used with CJK script)
  273. Backwards compatability
  274. -----------------------
  275. Changes in mPDF 5.7 may cause some changes to the way your documents appear. There are two main differences:
  276. 1) Hyphenation. To retain appearance compatible with earlier versions, set the CSS property "hyphens: auto" whenever
  277. you previously used $mpdf->hyphenate=true;
  278. 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:
  279. - No indent (previous default of 5mm) - ($tocindent is ignored)
  280. - Any font, font-size set ($tocfont or $tocfontsize) will not work
  281. - HyperLinks will appear with your default appearance - usually blue and underlined
  282. - line spacing will be narrower (can use line-height or margin-top in CSS)
  283. New features / Improvements
  284. ---------------------------
  285. Layout of Table of Content ToC now controlled using CSS styles
  286. Text alignment on decimal mark inside tables
  287. Automatically generated bookmarks and/or ToC entries from H1 - H6 tags
  288. Support for unit of "rem" as size e.g. font-size: 1rem;
  289. Origin and clipping for background images and gradients controlled by CSS i.e. background-origin, background-size, background-clip
  290. Text-outline controlled by CSS (compatible with CSS3 spec.)
  291. Use of <dottab> enhanced by custom CSS "outdent" property
  292. Image HTML attributes <img> added: max-height, max-width, min-height and min-width
  293. Spotcolor can now be defined as it is used e.g. color: spot(PANTONE 534 EC, 100%, 85, 65, 47, 9);
  294. Lists - added support for "start" attribute in <ol> e.g. <ol start="5">
  295. Hyphenation controlled using CSS, consistent with CSS3 spec.
  296. Line breaking improved to avoid breaks within words where HTML tags are used e.g. H<sub>2<sub>0
  297. Line breaking in CJK scripts improved (and ability to force hanging punctuation)
  298. Numerals in a CJK script are kept together
  299. RTL improved support for phrases containing numerals and \ and /
  300. Bidi override codes supported - Right-to-Left Embedding [RLE] U+202B, Left-to-Right Embedding [LRE] U+202A,
  301. U+202C POP DIRECTIONAL FORMATTING (PDF)
  302. Support for <base href=""> in HTML - uses it to SetBasePath for relative URLs.
  303. HTML tag - added support for <wbr> or <wbr /> - converted to a soft-hyphen
  304. CSS now takes precedence over HTML attribute e.g. <table bgcolor="black" style="background-color:yellow">
  305. Added CSS support
  306. -----------------
  307. - max-height, max-width, min-height and min-width for images <img>
  308. - "hyphens: none|manual|auto" as per CSS3 spec.
  309. - Decimal mark alignment e.g. text-align: "." center;
  310. - "rem" accepted as a valid (font)size in CSS e.g. font-size: 1.5rem
  311. - text-outline, text-outline-width and text-outline-color supported everywhere except in tables (blur not supported)
  312. - background-origin, background-size, background-clip are now supported everywhere except in tables
  313. - "visibility: hidden|visible|printonly|screenonly" for inline elements e.g. <span>
  314. - Colors: device-cmyk(c,m,y,k) as per CSS3 spec. For consistency, device-cmyka also supported (not CSS3 spec)
  315. - "z-index" can be used to utilise layers in the PDF document
  316. - Custom CSS property added: "outdent" - opposite of indent
  317. The HTML elements <dottab> and <textcircle> can now have CSS properties applied to them.
  318. Bug fixes
  319. ---------
  320. - SVG images - path including e.g. 1.234E-15 incorrectly parsed (not recognising capital E)
  321. - Tables - if a table starts when the Y position on page is below bottom margin caused endless loop
  322. - Float-ing DIVs - starting a float at bottom of page and it causes page break before anything output, second new page is forced
  323. - Tables - Warning notice now given in Table footer or header if <tfoot> placed after <tbody> and table spans page
  324. - Columns - block with border-width wider than the length of the border line, line overflows
  325. - Columns - block with no padding containing a block with borders but no backgound colour, borders not printed
  326. - Table in Columns - when background color set by surrounding block element - colour missing for height of half bottom border.
  327. - TOCpagebreakByArray() when called by function was not adding the pagebreak
  328. - Border around block element - dashed not showing correctly (not resetting linewidth between different edges)
  329. - Double border in table - when background colour set in surrounding block element - shows as black line between the 2 bits of double
  330. - Borders around DIVs - "double" border problem if not all 4 sides equally - fixed
  331. - Borders around DIVs - solid (and double) borders overlap as in tables - now fixed so mitred joins as in browser
  332. [Inadvertently improves borders in Columns because of change in LineCap]
  333. - Page numbering - $mpdf->pagenumSuffix etc not suppressed in HTML headers/footers if number suppressed
  334. - Page numbering - Page number total {nbpg} incorrect - e.g. showing decreasing numbers through document, when ToC present
  335. - RTL numerals - incorrectly reversing a number followed by a comma
  336. - Transform to uppercase/lowercase not working for chars > ASCII 128 when using core fonts
  337. - TOCpagebreak - Not setting TOC-FOOTER
  338. - TOCpagebreak - toc-even-header-name etc. not working
  339. - Parsing some relative URLs incorrectly
  340. - Textcircle - when moved to next page by "page-break-inside: avoid"
  341. - Bookmarks will now work if jump more than one level e.g. 0,2,1 Inserts a new blank entry at level 1
  342. - Paths to img or stylesheets - incorrectly reading "//www.domain.com" i.e. when starting with two /
  343. - data:image as background url() - incorrectly adjusting path on server if MPDF_PATH not specified (included in release mPDF 5.6.1)
  344. - Image problem if spaces or commas in path using http:// URL (included in release mPDF 5.6.1)
  345. - Image URL parsing rewritten to handle both urlencoded URLs and not urlencoded (included in release mPDF 5.6.1)
  346. - <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
  347. - Table {colsum} summed figures in table header
  348. - list-style-type (custom) colour not working
  349. - <tocpagebreak> toc-preHTML and toc-postHTML can now contain quotes
  350. ===========================
  351. mPDF 5.6
  352. 20/01/2013
  353. ===========================
  354. Files changed
  355. -------------
  356. mpdf.php
  357. config.php
  358. includes/functions.php
  359. classes/meter.php
  360. classes/directw.php
  361. config.php changes
  362. ------------------
  363. $this->allowedCSStags - added HTML5 tags + textcircle AND
  364. $this->outerblocktags - added HTML5 tags
  365. $this->defaultCSS - added default CSS properties
  366. New features / Improvements
  367. ---------------------------
  368. CSS support added for for min-height, min-width, max-height and max-width in <img>
  369. Images embedded in CSS
  370. <img src="data:image/gif;base64,...."> improved to make it more robust, and
  371. background: url(data:image... now added to work
  372. HTML5 tags supported
  373. - as generic block elements: <article><aside><details><figure><figcaption><footer><header><hgroup><nav><section><summary>
  374. - as in-line elements: <mark><time><meter><progress>
  375. - <mark> has a default CSS set in config.php to yellow highlight
  376. - <meter> and <progress> support attributes as for HTML5
  377. - custom appearances for <meter> and <progress> can be made by editing classes/meter.php file
  378. - <meter> and <progress> suppress text inside the tags
  379. Textcircle/Circular
  380. font: "auto" added: automatically sizes text to fill semicircle (if both set) or full circle (if only one set)
  381. NB for this AND ALL CSS on <textcircle>: does not inherit CSS styles
  382. attribute: divider="[characters including HTML entities]" added
  383. <textcircle r="30mm" top-text="Text Circular Text Circular" bottom-text="Text Circular Text Circular"
  384. divider="&nbsp;&bull;&nbsp;" style="font-size: auto" />
  385. &raquo; &rsquo; &sbquo; &bdquo; are now included in "orphan"-management at the end of lines
  386. Improved CJK line wrapping (if CJK character at end of line, breaks there rather than previous wordspace)
  387. NB mPDF 5.5 added support for <fieldset> and <legend> (omitted from ChangeLog)
  388. Bug fixes
  389. ---------
  390. - embedded fonts: Panose string incorrectly output as decimals - changed to hexadecimal
  391. Only a problem in limited circumstances.
  392. *****Need to delete all ttfontdata/ files in order for fix to have effect.
  393. - <textCircle> background white even when set to none/transparent
  394. - border="0" causing mPDF to add border to table CELLS as well as table
  395. - iteration counter in THEAD crashed in some circumstances
  396. - CSS color now supports spaces in the rgb() format e.g. border: 1px solid rgb(170, 170, 170);
  397. - CJK not working in table following changes made in v5.4
  398. - images fixed to work with Google Chart API (now mPDF does not urldecode the query part of the src)
  399. - CSS <style> within HTML page crashed if CSS is too large (? > 32Kb)
  400. - SVG image nested int eht HTML failed to show if code too large (? > 32Kb)
  401. - cyrillic character p &#1088; at end of table cell caused cell height to be incorrectly calculated
  402. ===========================
  403. mPDF 5.5
  404. 02/03/2012
  405. ===========================
  406. Files changed
  407. -------------
  408. mpdf.php
  409. classes/ttfontsuni.php
  410. classes/svg.php
  411. classes/tocontents.php
  412. config.php
  413. config_fonts.php
  414. utils/font_collections.php
  415. utils/font_coverage.php
  416. utils/font_dump.php
  417. Files added
  418. -----------
  419. classes/ttfontsuni_analysis.php
  420. config.php changes
  421. ------------------
  422. To avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>)
  423. $this->margBuffer = 0; // Allow an (empty) end of block to extend beyond the bottom margin by this amount (mm)
  424. config_fonts.php changes
  425. ------------------------
  426. Added to (arabic) fonts to allow "use non-mapped Arabic Glyphs" e.g. for Pashto
  427. 'unAGlyphs' => true,
  428. Arabic text
  429. -----------
  430. Arabic text (RTL) rewritten with improved support for Pashto/Sindhi/Urdu/Kurdish
  431. Presentation forms added:
  432. U+0649, U+0681, U+0682, U+0685, U+069A-U+069E, U+06A0, U+06A2, U+06A3, U+06A5, U+06AB-U+06AE,
  433. 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
  434. Joining improved:
  435. 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,
  436. 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
  437. Note -
  438. Some characters in Pashto/Sindhi/Urdu/Kurdish do not have Unicode values for the final/initial/medial forms of the characters.
  439. However, some fonts include these characters "un-mapped" to Unicode (including XB Zar and XB Riyaz, which are bundled with mPDF).
  440. 'unAGlyphs' => true,
  441. added to the config_fonts.php file for appropriate fonts will
  442. 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:
  443. e.g. XB Riyaz, XB Zar, Arabic Typesetting (MS), Arial (MS)
  444. 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"
  445. - if it exists, it may work!
  446. Using "unAGlyphs" forces subsetting of fonts, and will not work with SIP/SMP fonts (using characters beyond the Unicode BMP Plane).
  447. mPDF maps these characters to part of the Private Use Area allocated by Unicode U+F500-F7FF. This could interfere with correct use
  448. if the font already utilises these codes (unlikely).
  449. mPDF now deletes U+200C,U+200D,U+200E,U+200F zero-widthjoiner/non-joiner, LTR and RTL marks so they will not appear
  450. even though some fonts contain glyphs for these characters.
  451. Other New features / Improvements
  452. ---------------------------------
  453. Avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>)
  454. using configurable variable: $this->margBuffer;
  455. The TTFontsUni class contained a long function (extractcoreinfo) which is not used routinely in mPDF
  456. This has been moved to a new file: classes/ttfontsuni_analysis.php
  457. The 3 utility scripts have been updated to use the new extended class:
  458. - utils/font_collections.php
  459. - utils/font_coverage.php
  460. - utils/font_dump.php
  461. Bug fixes
  462. ---------
  463. - Border & background when closing 2 blocks (e.g. </div></div>) incorrectly being moved to next page because incorrectly
  464. calculating how much space required
  465. - Fixed/Absolute-positioned elements not inheriting letter-spacing style
  466. - Rotated cell - error if text-rotate set on a table cell, but no text content in cell
  467. - SVG images, text-anchor not working
  468. - Nested table - not resetting cell style (font, color etc) after nested table, if text follows immediately
  469. - Nested table - font-size 70% set in extenal style sheet; if repeated nested tables, sets 70% of 70% etc etc
  470. - SVG setting font-size as percent on successive <text> elements gives progressively smaller text
  471. - mPDF will check if magic_quotes_runtime set ON even >= PHP 5.3 (will now cause an error message)
  472. - not resetting after 2 nested tags of same type e.g. <b><b>bold</b></b> still bold
  473. - When using charset_in other than utf-8, HTML Footers using tags e.g. <htmlpageheader> do not decode correctly
  474. - ToC if nested > 3 levels, line spacing reduces and starts to overlap
  475. ===========================
  476. mPDF 5.4
  477. 14/02/2012
  478. ===========================
  479. Files changed
  480. -------------
  481. mpdf.php
  482. config.php
  483. compress.php
  484. classes/ttfontsuni.php
  485. classes/barcode.php
  486. classes/indic.php
  487. classes/svg.php
  488. examples/show_code.php ----- SECURITY RISK**
  489. examples/example49_changelog.php
  490. examples/example57_new_mPDF_v5-3_active_forms_b (replace example57_new_mPDF_v5-3_active_forms)
  491. includes/out.php
  492. mpdfi/fpdi_pdf_parser.php
  493. Files added
  494. -----------
  495. classes/bmp.php
  496. classes/directw.php
  497. classes/form.php
  498. classes/grad.php
  499. classes/tocontents.php
  500. classes/wmf.php
  501. examples/example58_new_mPDF_v5-4_features
  502. config.php changes
  503. ------------------
  504. Edited: $this->allowedCSStags, $this->innerblocktags, $this->defaultCSS; (CAPTION added in each case)
  505. Moved: Numerous $form_.. variables are now in /classes/form.php
  506. New config variables
  507. --------------------
  508. $this->bookmarkStyles = array();
  509. $this->cacheTables = true;
  510. New methods
  511. -----------
  512. function CircularText()
  513. function SetVisibility()
  514. New/Extended CSS
  515. ----------------
  516. box-shadow (block elements - does NOT support "inset")
  517. text-shadow (all text elements - does NOT support "blur")
  518. visibility: visible|hidden|printonly|screenonly (block-level elements and images IMG only)
  519. text-transform: capitalize|uppercase|lowercase (extended to support TD/TH)
  520. tr|td|th:nth-child(odd|even|2n+1)
  521. color, strikethrough, underline and background-color (extended to support rotated TD/TH)
  522. underline and strike-through (extended to support TD/TH)
  523. underline (line colour) (extended to work correctly in watermark)
  524. page-break-after: left|right|always (block elements and tables)
  525. NB respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
  526. background[-color]: extended to support rgba|cmyka|cmyk|hsla|hsl|spot
  527. border(extended to support inline elements)
  528. New HTML
  529. --------
  530. <caption>
  531. <textcircle />
  532. New features / Improvements
  533. ---------------------------
  534. Tables - Zebra Stripes
  535. Tables: overlapping rowspans (partially) supported
  536. Tables - Disk caching
  537. Using progress bars (or $showStats) now reports 'real' memory usage i.e. get_memory_usage(true)
  538. Support for query string in the URLs for external stylesheets e.g. @import url("style.css?ltcyy7");
  539. Table caption partially supported
  540. CircularText
  541. BookMark styling
  542. Spread tables i.e. can split table (columns) across several pages width.
  543. Can use chelvetica, ctimes and ccourier to specify core fonts in a non-core font document
  544. Spread tables i.e. can split table (columns) across several pages width.
  545. {colsum} in <tfoot> cell will insert a column total per page.
  546. SVG embedded as island in HTML supported
  547. Active Forms
  548. textarea and input (text types) now accept javascript as:
  549. onKeystroke, onValidate, onCalculate and onFormat
  550. onChange is depracated but works as onCalculate (for textarea and input)
  551. (PS Select still accepts onChange cf. 5.3.37)
  552. Ledger and Tabloid added as page formats recognised. NB Ledger is same as tabloid but landscape. In mPDF, both give the same size (portrait)
  553. so need to add -L e.g. Ledger-L for landscape.
  554. Internal script changes
  555. -----------------------
  556. Changed this->k to _MPDFK throughout all scripts
  557. Changes to color (packed binary data in string rather than array) to reduce memory usage esp in tables
  558. Internal variables Removed
  559. $usetableheader;
  560. $tableheadernrows;
  561. $tablefooternrows;
  562. vars $ChangePage, $p_bottom_border, $img_margin_top(+) $issetcolor + other similar removed
  563. Removed a whole load of // comments
  564. Updates to remove some more Warning Notices (not all marked in text)
  565. Border set on TR - changed so set on each cell, rather than retrospectively at end of TR
  566. All references to table['text'] removed as not needed - uses ['textbuffer'] instead
  567. OpenTag(TD) changes to reduce memory usage with tables
  568. Includes different method to set a default timezone
  569. fn _smallCaps does not need (undefined) $space
  570. this->chrs and this->ords replaced by chr() and ord()
  571. Headers in out.php updated to match those used in Output()
  572. Change to SetFont() to improve performance time
  573. Change to GetStringWidth() to improve performance time
  574. Corrected copying of Glyphs 0,1,2, to all subset fonts (non-SMP/SIP), and only setting 32->127 in subset
  575. Subset fonts (non-SMP/SIP) have additionally Unicode CMap tables (0,0,4 and 0,3,4) as well as Microsoft (3,1,4)
  576. Subset fonts (SMP/SIP) have CMap tables (1,0,6 and 3,0,4) - rather than 1,0,6 and 3,0,6
  577. Subset fonts (SMP/SIP) have 'name' table changed to give 1,0 and 3,0. As it is a symbol font (not Unicode encoded) :
  578. needs to have a name entry in 3,0 (e.g. symbol) - original font will have 3,1 (i.e. Unicode)
  579. Automatically checks for HTML code length > 100000 characters and gives error warning if
  580. PHP < 5.2.0 (as not configurable) or increases pcre.backtrack_limit if PHP < 5.3.7
  581. Removed/Depracated
  582. ------------------
  583. function UseTableHeader($opt=true) fn removed / depracated
  584. function UsePRE($opt=true) removed
  585. $attr['REPEAT_HEADER'] == true CSS removed / depracated
  586. $this->usepre=true; removed / depracated as never needed - always respects PRE whitespace
  587. ToC: NB Values can no longer be set directly e.g. as in example
  588. $mpdf->TOCheader = array(); // array as for setting header/footer
  589. $mpdf->TOCfooter = array(); // array as for setting header/footer
  590. $mpdf->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
  591. $mpdf->TOCpostHTML = ''; // HTML text to appear after table of contents
  592. $mpdf->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
  593. Need to use TOCpagebreak either direct (or array version) or as HTML
  594. OR if absolutley necessary, could use:
  595. $mpdf->tocontents->TOCheader = array(); // array as for setting header/footer
  596. $mpdf->tocontents->TOCfooter = array(); // array as for setting header/footer
  597. $mpdf->tocontents->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
  598. $mpdf->tocontents->TOCpostHTML = ''; // HTML text to appear after table of contents
  599. $mpdf->tocontents->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
  600. Further Details
  601. ===============
  602. CSS border on inline elements
  603. -----------------------------
  604. Support for CSS border (and variants) on inline elements e.g. <span style="border-bottom: 1px dashed #000000;">
  605. Border styles solid|dotted|dashed|double only are supported. Border radius not supported.
  606. Nested inline elements will have repeat left|right borders on the nested content (unlike browsers)
  607. Tables - Zebra Stripes
  608. ----------------------
  609. TABLE - striped rows cf. http://dev.opera.com/articles/view/zebra-striping-tables-with-css3/
  610. tr:nth-child(odd) { background-color: #99ff99; }
  611. thead tr:nth-child(3n+2) { background-color: #FFBBFF; }
  612. td:nth-child(2n+1) { background-color: #BBBBFF; }
  613. table.zebraTable td:nth-child(2n+1) { background-color: #BBBBFF; }
  614. table.zebraTable th:nth-child(2n+1) { background-color: #BBBBFF; }
  615. NB mPDF does NOT correctly apply specificity to all CSS
  616. table.zebra tbody tr:nth-child(2n+1) td { background-color: #FFFFBB; }
  617. table.zebra tbody td:nth-child(odd) { background-color: #BBBBFF; }
  618. should make every odd row yellow, and every odd coloumn blue, but with the row/yellow overriding the column/blue.
  619. 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
  620. table.zebra tbody tr:nth-child(2n+1) td:nth-child(1n+0) { background-color: #FFFFBB; }
  621. (The :nth-child(1n+0) selector just selects every td cell.)
  622. Tables - Disk caching
  623. ---------------------
  624. TABLES: using disk caching
  625. // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
  626. // executon time and disk access (read and write)
  627. $this->cacheTables = true;
  628. NB $this->packTableData will be overridden to => true; // required for cacheTables
  629. $this->simpleTables will be overridden to => false; // Cannot co-exist with cacheTables
  630. Table caption
  631. -------------
  632. Must come immediately after <table...>
  633. CSS caption-side and HTML align attribute of top|bottom supported (not attribute left|right)
  634. Handled as a separate block element brought outside the table, so:
  635. CSS will not cascade correctly on the table
  636. width of caption block is that of page or of the block element containing the table
  637. so alignment will be to the page-width not the table width
  638. if table page-break-after: always, the caption will follow the pagebreak.
  639. This does work:
  640. <style>
  641. .tablecaption { caption-side: bottom; text-align: left; font-weight: bold; color: green; }
  642. </style>
  643. ...
  644. <table>
  645. <caption class="tablecaption">Caption title here</caption>
  646. <tbody>
  647. CSS visibility: printonly, screenonly
  648. -------------------------------------
  649. Roughly based on CSS
  650. Works on Block elements P, DIV etc, or Image
  651. Cannot nest / layer.
  652. Inner blocks/image with set visibility are ignored if already set on enclosing block element.
  653. (Block element) does not work inside table (image does)
  654. So 'visible' does nothing but is set as default
  655. (NB Changes output to PDF version 1.5)
  656. Incompatible with PDFA / PDFX
  657. 'visibility'
  658. Value: visible | hidden | (collapse | inherit)
  659. Initial: visible
  660. Applies to: all elements
  661. Inherited: yes
  662. The 'visibility' property specifies whether the boxes generated by an element are rendered.
  663. Invisible boxes still affect layout (set the 'display' property to 'none' to suppress box generation altogether).
  664. Values have the following meanings:
  665. visible
  666. The generated box is visible.
  667. hidden
  668. The generated box is invisible (fully transparent, nothing is drawn), but still affects layout.
  669. Furthermore, descendants of the element will be visible if they have 'visibility: visible'.
  670. collapse | inherit
  671. NOT supported in mPDF
  672. CUSTOM:
  673. printonly | screenonly
  674. Added VISIBILITY function
  675. $mpdf->SetVisibility('screenonly'); or 'printonly' 'visible' or 'hidden'
  676. (NB Changes output to PDF version 1.5)
  677. Incompatible with PDFA / PDFX
  678. CircularText
  679. ------------
  680. function CircularText($x, $y, $r, $text, $align='top', $kerning=120, $fontwidth=100) {
  681. x: abscissa of center
  682. y: ordinate of center
  683. r: radius of circle
  684. text: text to be printed
  685. align: text alignment: top or bottom. Default value: top
  686. kerning: spacing between letters in percentage. Default value: 120. Zero is not allowed.
  687. fontwidth: width of letters in percentage. Default value: 100. Zero is not allowed
  688. - now uses Kerning between letters if useKerning == true (set manually see example)
  689. BookMark styling
  690. ----------------
  691. New configurable variable to control appearance of Bookmarks e.g.
  692. $this->bookmarkStyles = array(
  693. 0 => array('color'=> array(0,64,128), 'style'=>'B'),
  694. 1 => array('color'=> array(128,0,0), 'style'=>''),
  695. 2 => array('color'=> array(0,128,0), 'style'=>'I'),
  696. );
  697. Column sums
  698. -----------
  699. (Also changed some preg_replace to str_replace to improve performance)
  700. To use: just add {colsum} to any cells of the table footer <tfoot>
  701. Add a number to specify a fixed number of decimal points e.g. <td>£{colsum2}</td> will give you £123.40
  702. The width of the column will be calculated using the actual string {colsum} as a placeholder.
  703. If you need the column to be wider, use underscores "_" to pad it e.g. {colsum2_____}
  704. Spread tables
  705. -------------
  706. i.e. can split table (columns) across several pages width.
  707. CSS <table style="overflow: visible">
  708. Cannot use with:
  709. $this->kwt - ignored
  710. $this->table_rotate - ignored
  711. $this->table_keep_together - ignored
  712. $this->ColActive - cancels spread tables
  713. Messes up with:
  714. $mpdf->forcePortraitHeaders = true;
  715. $mpdf->forcePortraitMargins = true;
  716. Problems with CJK, and RTL
  717. Will do no resizing of fonts at all.
  718. Maximum width of column = page width i.e. will not split columns across pages - NB will keep colspan>1 on one page
  719. If table row too high for page will die with error message.
  720. Will override some specs for width if this creates conflicts
  721. Recommended to specify absolute value of width on each column.
  722. Bug fixes
  723. =========
  724. Dottab - if text after dottab is hyperlinked <a></a> then dots are underlined
  725. page-break-before now respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
  726. Annotation() function called directly with colorarray(r,g,b)
  727. Added urldecode to _getImage to cope with ../name%20of%20image.jpg
  728. 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
  729. [barcode.php] Allow &nbsp; in C39 codes - will be changed to spaces
  730. <table> inside a <div position:fixed, left:300px;> not calculating table width correctly
  731. - leading to either upside down table or error width less than 1 character
  732. Depracated magic_quotes_runtime() in compress.php
  733. DIRECTW included twice in compress.php
  734. FORMS mark up for compress.php corrected
  735. double backslashes not preserved inside <pre> or <textarea>
  736. font-weight and font-style not recognised in <pageheader>
  737. Progress bars causing corrupt PDF file (out.php) changed fopen from "r" mode to "rb" (binary)
  738. Target around image - <a href="#internaltarget"><img ... /></a> - not working
  739. SmallCaps in <thead> error
  740. Fonts with "name" table in format 1 not recognised correctly
  741. Rotated table which does not fit on remaining page, forces a new page even if already at top of page
  742. Locale causing problems - all instances of sprintf() using %.3f changed to %.3F so not locale aware
  743. CSS border radius not implemented on fixed/absolute positioned block element
  744. Background color in rotated table extending way beyond bottom of table
  745. Nested table containing <thead> or <tfoot> was confused with <thead> or <tfoot> of parent table
  746. Correct handling of spaces, < or & in textarea
  747. <option> and <input ..> attributes value/title decoded with fn lesser_entity_decode instead of htmlspecialchars_decode to include &apos;
  748. line width not restored to correct value after "line-through" text in Cell()
  749. Kannada - incorrect positioning of Reph
  750. Forms - In <input> or <option> (select) not correctly handling HTML named entities e.g. &lt; in value or title
  751. Active forms - &nbsp; as Value or Title incorrectly showing as Euro - PDFDocEncoding fixed
  752. Unicode data in embedded fonts not encrypted when doc encrypted
  753. Nested block elements which are empty including innermost one, top margin of innermost block was ignored
  754. font-size: xx% inside a block was setting on block's parent font-size
  755. Active forms - radio buttons (removed name from Widget - leave on Radio group)
  756. causing problems accessing field for radio buttons
  757. When using simple tables and border-collapse, if table border set, but cell borders not set, should display table border (fixed)
  758. position:fixed block - if neither top nor bottom nor height specified, was positioned incorrectly (y)
  759. Leave - if top, bottom, margin-top, margiin-bottom and height are all left unspecified (or auto), will centre vertically
  760. on the page (specific to mPDF - not consistent with CSS2.1)
  761. But if any one of them are specified (including e.g. margin-top=0), follows CSS spec, so top is the current "static" position
  762. background-image-opacity=0 not working on BODY or BLOCK
  763. Lists - if LI continues after a nested List, would add as a new LI item (should continue as part of earlier LI item)
  764. fn WriteCell() converts to 'windows-1252' when required
  765. if multiple calls to mPDF used, cannot redefine function cmp()
  766. internal link targets <a name="xx" /> in ToC not moved when using: page-break-inside:avoid
  767. internal link targets <a name="xx" /> not moved when using: columns, page-break-inside:avoid, keep-with-table or table rotate
  768. 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
  769. Bug is fixed, but example file needed updating to onCalculate for the display field.
  770. Table cell: if height set as %, currently sets it as % of page-width; instead this now ignores it.
  771. 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)
  772. so mPDF converts to this string and seems to work.
  773. OCR characters wrong size in barcodes if using different ocr font - fixed
  774. ===========================
  775. mPDF v5.3 (21/07/2011)
  776. ===========================
  777. New Features
  778. ------------
  779. - Active forms (see on-line manual for details)
  780. - 128-bit encryption (optional) with additional user-permissions (see on-line manual)
  781. PLEASE READ - Change in Font management
  782. ---------------------------------------
  783. The font name imported from the font and included by mPDF in the PDF file was stripping any '-' in the name.
  784. This is the PostScript name which is utilised by some PostScript programmes.
  785. mPDF has been changed to leave the PostScript font name unchanged. In 99% cases no difference will be noted, but
  786. you MUST delete all the temporary font data files cached in the /ttfontdata/ folder for this to be effective.
  787. Minor changes
  788. -------------
  789. If @page CSS is used to select a first page with settings different from the default, mPDF did create a blank page
  790. then pagebreak to the new @page settings - this has been changed so it now will start with the new page settings.
  791. New function added: DeletePages($start_page, $end_page=-1) e.g. $mpdf->DeletePages(1);
  792. Can be used just before calling Output()
  793. compress.php utility extended to exclude active forms and images-svg
  794. Bug fixes
  795. ---------
  796. - list-style-type: (custom version, user-defined bullet) colour change not working if colour is set on the list item line
  797. - background-image: SVG or WMF images as background-images in tables/tr/cells not working
  798. - font-weight: bold font not always reset after inline <b>...</b> thus miscalculating width
  799. - forms (inactive) in 'c' core fonts using unicode characters 127-255 incorrect display in input text and button text
  800. - form elements (inactive) if in-line with mixed size fonts, error in vertical positioning of text related to box
  801. - ToC: wrapped lines in ToC not retaining formatting e.g. bold style
  802. - HTMLHeaders: using setAutoTopMargin="pad"; not correctly setting top margin for first page
  803. - output headers changed: Content-length not used if server uses output compression
  804. - embedded font subsets from fonts which contain non-BMP plane 0 characters (incl. e.g. dejavusanscondensed)
  805. - causing Adobe Reader to create a CJK encoded font subset internally when loading interactive Forms
  806. - Changed so unsets the flag in the subset font to show no non-BMP characters.
  807. Configurable variables added (see config.php file):
  808. --------------------------------------------------
  809. All for Active Forms:
  810. $this->useActiveForms
  811. $this->formExportType
  812. $this->formSubmitNoValueFields
  813. $this->formSelectDefaultOption
  814. $this->form_border_color
  815. $this->form_background_color
  816. $this->form_border_width
  817. $this->form_border_style
  818. $this->form_button_border_color
  819. $this->form_button_background_color
  820. $this->form_button_border_width
  821. $this->form_button_border_style
  822. $this->form_radio_color
  823. $this->form_radio_background_color
  824. PLUS: see additional values added to $this->allowedCSStags close to bottom of file - required for Active forms
  825. Updated files
  826. -------------
  827. mpdf.php
  828. config.php (NB as well as form stuff at top, 5.2.07 $this->allowedCSStags close to bottom of file)
  829. compress.php
  830. classes/ttfontsuni.php
  831. examples/example57...
  832. examples/formsubmit.php
  833. ===========================
  834. mPDF v5.2 (18/06/2011)
  835. ===========================
  836. New Features
  837. ------------------
  838. Improvements in font handling resulting in clearer display of fonts on screen, and improved compatibility with PostScript drivers
  839. (e.g. use with GSView/GhostScript, see below)
  840. CJK line-breaking implemented (roughly) according to rules. Configurable variables allow control of behaviour (except in tables).
  841. Viewer preferences: added options for initial 2 page display where you can specify whether
  842. 1st page is on left or right (cf. SetDisplayMode).
  843. 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:
  844. list-style-type: U+263Argb(255,0,0); - where U+263A is the Unicode HEX value of the character you want for the bullet
  845. - character MUST be included in the font used for that list item. rgb() bit is optional
  846. Bug fixes
  847. ---------
  848. - Fonts: embedding a BMP TTC font (e.g. Cambria) as a full font caused error
  849. - Table: If cell width set by CSS as %, and page-break-inside avoid requires a new page, was losing the sizing
  850. - Table: table borders CSS parsing error; if border-width, border-style, border-color set, not inherited correctly
  851. - Table: Table background image or gradient not working in HTMLHeader/Footer
  852. - Table: background color set on table (anywhere) will overwrite image/gradient
  853. - Table Background image/gradient: If left/right margin is set on table, gradient/image set on table is too wide
  854. - Table: rotated table - height (after first page does not correctly allow for thead i.e. too much)
  855. - Table: blank <tr></tr> causes error
  856. - Table/Letter-spacing: If letter-spacing set inside table, not calculating table width correctly, and if oversized, freezes
  857. - ToC: ToC at top of page (non-mirrored or already ODD) did not reset page_number if told
  858. - Character subsititutions: characters missed if first element in a $html code e.g. WriteHTML('Not in a tag &#10003;');
  859. - Kerning: kerning info: if reading font file for first time (or if not cached in ttfontdata/) did not register kerning info
  860. - Textarea: multiple new lines run into only one newline
  861. - QRCode - colors wrong because QRcode class only accepts RGB input (hardcoded now to always give black on white)
  862. - QRCode always producing "Your message here"
  863. - Columns: if transforming height of column, not always closing transform Q
  864. - CakePHP compatibility
  865. - compress.php - error due to markup comments in mpdf.php script file
  866. Backwards compatibility
  867. -----------------------
  868. Changes in mPDF 5.2 are backwards compatible with version 5.1
  869. Your document fonts may appear slightly different in the PDF viewer because of the changes to embedded font subsets (cf.)
  870. 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)
  871. PostScript e.g. GSView/GhostScript
  872. ----------------------------------
  873. 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,
  874. but others were due to peculiarities of GSView/GhostScript.
  875. - Diacritic Characters were not displayed when embedding a font subset
  876. - Fonts containing SIP/SMP characters (supplementary Unicode planes) caused errors
  877. - Error with text justification (word-spacing) when embedding a full font can occur in some fonts*
  878. The first 2 problems should now be fixed in v5.2
  879. *The error with text justification can be optionally fixed by setting the configurable variable in config.php:
  880. $this->repackageTTF = true;
  881. When mPDF embeds a full font, it simply embeds the whole original TTF file into the PDF document. For some fonts (containing
  882. a GSUB table) this was causing problems. $this->repackageTTF forces mPDF to repackage the original TTF file excluding some of
  883. the tables like GSUB.
  884. (See ADDITIONAL INFO FONTS.txt in downloaded files)
  885. Font appearance in PDF viewer
  886. -----------------------------
  887. Font subsetting has been improved to include additional information in the embedded file. Overall the effects are of greater clarity
  888. when viewing the document on a screen (it will not affect print output), but the changes are dependent on:
  889. - the original TTF font i.e. the options that the font's author has built into the file
  890. - the PDF viewer i.e. whether the programme chooses to use the available information
  891. - the resolution (zoom) of the page you are viewing
  892. (See ADDITIONAL INFO FONTS.txt in downloaded files)
  893. Indic fonts
  894. -----------
  895. A new set of Indic fonts (ind_xx_1_001) is distributed with version 5.2 containing the additional font information as described above.
  896. In addition, some changes have been made to the ASCII characters in the font from the files previously distributed:
  897. 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,
  898. ALL of the ASCII characters (32-127) were inserted/overwritten from DejaVuSansCondensed to make the font more usable.
  899. In the latest version, only the missing characters are taken from DejaVuSansCondensed, leaving punctuation and numerals from the original
  900. fonts. This also means that the space character has a different width, and this will cause slight changes to the word spacing in documents.
  901. (See ADDITIONAL INFO FONTS.txt in downloaded files)
  902. CJK line-breaking (text wrapping)
  903. ---------------------------------
  904. CJK (chinese-japanese-korean) text often contains no spaces. mPDF previously has wrapped text whenever a character reached the end of
  905. the line. mPDF version 5.2 attempts to follow the line-breaking rules described for each of the languages. Configurable variables
  906. allow some control over this behaviour, especially whether to squeeze a character into the space available at the end of a line, or
  907. whether to allow it to overflow the right margin.
  908. Configurable variables (see config.php file):
  909. ----------------------
  910. Control wrapping of CJK text:
  911. $this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
  912. $this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only selected)
  913. When Embedding full TTF font files, remakes the font file using only core tables
  914. May improve function with PostScript printers
  915. $this->repackageTTF = false;
  916. Updated files
  917. -------------
  918. mpdf.php
  919. compress.php
  920. utils/font_dump.php
  921. classes/ttfontsuni.php
  922. config.php (3 new variables - see above)
  923. All ttfonts/ind_*
  924. New set of Indic fonts for PostScript compatibilty - and clearer font display
  925. ===========================
  926. mPDF v5.1 (27/02/2011)
  927. ===========================
  928. New Features
  929. ------------
  930. - CSS background (images, colours or gradients) on <TR> and <TABLE>
  931. - CSS border on <TR> (only in border-collapsed mode)
  932. - support for Mozilla and CSS3 gradient syntax:
  933. -moz-linear-gradient, linear-gradient
  934. -moz-radial-gradient, radial-gradient
  935. -moz-repeating-linear-gradient, linear-repeating-gradient
  936. -moz-repeating-radial-gradient, radial-repeating-gradient
  937. - expanded support for gradients (including in SVG images):
  938. - multiple colour 'stops'
  939. - opacity (transparency)
  940. - angle and/or position can be specified
  941. - gradient can be used as an image mask (custom mPDF styles: gradient-mask)
  942. - image-orientation supported for <IMG> (similar to existing custom mPDF attribute: rotate) [CSS3]
  943. - image-resolution supported for <IMG> [CSS3]
  944. - background-image-resolution (custom mPDF CSS-type style) to define resolution of background images
  945. - improved support for SVG images
  946. - SVG and WMF images supported in background-image
  947. - file attachments
  948. - numeric list-styles added e.g. arabic-indic, bengali, devanagari, persian, thai [CSS3]
  949. - font kerning supported (inter-character spacing between specific pairs)
  950. - letter-spacing and word-spacing supported [CSS3]
  951. - colors supported as rgb(), rgba(), hsl(), hsla(), cmyk(), cmyka(), or spot()
  952. - spot colors supported e.g PANTONE 310 EC
  953. - PDF/X compatible files
  954. - optionally force use of grayscale, RGB or CMYK colorspace
  955. - automatic colour conversion for most objects between grayscale, RGB and CMYK
  956. Backwards compatibility
  957. -----------------------
  958. Most changes in mPDF 5.1 are backwards compatible with version 5.0 i.e. your documents should
  959. look the same running 5.1 However some changes may alter display from previous versions:
  960. - RTL (right-to-left) languages - see below
  961. - bleed margins when using @page CSS - see below
  962. - Default distance for "cross" from inner margin changed 10->5mm [hardcoded in fn. Footer()]
  963. - If height set on a block element, will force a new page if set-height will not fit on page
  964. - If table rotated, 5mm margin at bottom is now reduced to 1mm
  965. - If image is too big for page and automatically sixed to maximum height of page, 10mm margin at bottom reduced to 1mm
  966. Colours may appear more vibrant
  967. -------------------------------
  968. Unless specifically set, Adobe Reader uses the RGB colorSpace by default when displaying documents. However
  969. if an image or gradient using transparency (or alpha channel) is included in the document, Adobe Reader
  970. automatically sets the default colorSpace to CMYK - which makes the colours look less vibrant/bright on screen.
  971. mPDF 5.1 now specifies by default a colorSpace RGB for each page, and this will maintain the more
  972. vibrant colours. This is overridden if you use on of the options to restrict the colorSpace (cf.)
  973. RTL
  974. ---
  975. **** IMPORTANT - PLEASE READ IF USING RTL SCRIPTS ****
  976. Handling of RTL (right-to-left) languages has been significantly rewritten, and is likely to cause
  977. changes to the resulting files if you have previously been using mPDF. The changes have made mPDF
  978. act more like a browser, respecting the HTML/CSS rules.
  979. Changes include:
  980. - the document now has a baseline direction; this determines the
  981. - behaviour of blocks for which text-align has not been specifically set
  982. - layout of mirrored page-margins, columns, ToC and Indexes, headers and footers
  983. - base direction can be set by any of:
  984. - $mpdf->SetDirectionality('rtl');
  985. - <html dir="rtl" or style="direction: rtl;">
  986. - <body dir="rtl" or style="direction: rtl;">
  987. - base direction is an inherited CSS property, so will affect all content, unless...
  988. - direction can be set for all HTML block elements e.g. <DIV><P><TABLE><UL> etc using
  989. - CSS property < style="direction: rtl;">
  990. - direction can only be set on the top-level element of nested lists
  991. - direction can only be set on <TABLE>, NOT on THEAD, TBODY, TD etc.
  992. - nested tables CAN have different directions
  993. - NOTE that block/table margins/paddings are NOT reversed by direction
  994. NB mPDF <5.1 reversed the margins/paddings for blocks when RTL set.
  995. - language (either CSS "lang", using Autofont, or through initial set-up e.g. $mpdf = new mPDF('ar') )
  996. no longer affects direction in any way.
  997. NB config_cp.php has been changed as a result; any values of "dir" set here are now ineffective
  998. - default text-align is now as per CSS spec: "a nameless value which is dependent on direction"
  999. NB default text-align removed in default stylesheet in config.php
  1000. - once text-align is specified, it is respected and inherited
  1001. NB mPDF <5.1 reversed the text-align property for all blocks when RTL set.
  1002. - the configurable value $rtlcss is depracated, as it is no longer required
  1003. - improved algorithm for dtermining text direction
  1004. - english word blocks are handled in text reversal as one block i.e. dir="rtl"
  1005. [arabic text] this will not be reversed [arabic text]
  1006. - arabic numerals 0-9 handled correctly
  1007. Although the control of direction for block elements is now more configurable, the control of
  1008. text direction (RTL arabic characters) remains fully automatic and unconfigurable.
  1009. <BDO> etc has no effect. Enclosing text in silent tags can sometimes help e.g.
  1010. content<span>[arabic text]</span>content
  1011. Justified text
  1012. --------------
  1013. Text-align: justify - no longer uses configurable variable $jSpacing= C | W | ''
  1014. The default value is for mixed letter- and word-spacing, set by jSWord and jSmaxChar
  1015. If a line contains a cursive script (RTL or Indic [devanagari, punjabi, bengali]) then it prevents letter-spacing
  1016. for justification on that line - effectively the same as setting letter-spacing:0
  1017. Spacing values have been removed from the config_cp.php configuration file, so the "lang" property
  1018. (in config_cp) no longer determines justification behaviour (this includes the use of Autofont()).
  1019. When using RTL or Indic [devanagari, punjabi, bengali] scripts, you should set CSS letter-spacing:0
  1020. whenever you use text-align:justify.
  1021. @page media
  1022. -----------
  1023. When using @page to create a print publication with page-size less than sheet-size
  1024. - bleed margin is now configurable (also crop- and cross-mark margins)
  1025. - backgrounds/gradients/images now use the bleed box as their "container box"
  1026. - odd-header-name: supports the value "_default" - allows current non-HTML header to remain unchanged
  1027. - marks: crop cross; i.e. both together supported
  1028. - background-image-opacity and background-image-resize now work with @page CSS
  1029. SVG images - extended support
  1030. -----------------------------
  1031. - support for spreadMethod property for gradients (repeat and reflect)
  1032. - support for style="font-family; font-size; font-style; font-weight" i.e. inline CSS
  1033. - when viewPort="" and width="" height="" all specified, uses width to set SVG size of a "pixel"
  1034. - support for opacity and multiple "stops" (and colorspace) in gradients
  1035. Minor Enhancements
  1036. ------------------
  1037. - support for colors as rgb(87%, 56%, 25%) [used especially in SVG]
  1038. - added option of "NoPrintScaling" in SetDisplayPreferences
  1039. - compress.php - now combines BACKGROUND-IMAGES and GRADIENTS as BACKGROUNDS, and added PROGRESS-BAR
  1040. - table with THEAD row will force a new page if no room for the THEAD AND a row from TBODY
  1041. - Small-Caps now works properly together with text-align justify
  1042. - embedded font subsets restructured (minor) for greater compatibility e.g. with Postscript printers
  1043. - PDF/A will convert everything except grayscale to RGB (by default) or CMYK (optionally)
  1044. Bug fixes
  1045. ---------
  1046. - Display changed to CMYK colour gamut when document contained an object with transparency set.
  1047. Now will retain RGB colorspace (brighter colours)
  1048. - If using dir="rtl", tables containing nested tables were not properly reversed
  1049. - "text-rotate: 0" set in CSS stylesheet did not 'undo' any text-rotate set on the row (TR)
  1050. - Malayalam - character re-ordering
  1051. - If height set on a block element, was not taking account of padding top/bottom
  1052. - embedded font subsets: error in array of Font Widths fixed
  1053. - <style>..</style> containing /* import url() */ the comments were not ignored
  1054. - If call mPDF class more than once, error using multiple barcodes or gif files because classes not reinstantiated
  1055. - Floating blocks were collapsing bottom/top margins - incorrectly
  1056. - Table: if colspan>1 contents are wider than the width of the included columns, did not increase column width(s) to accommodate
  1057. - Resizing table - script hanging and new page forced when not required (still)
  1058. - 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
  1059. - End of 2 blocks (e.g. </div></div>) at very bottom of page, forcing unwanted pagebreak
  1060. - Corrected handling of tags inside <pre>
  1061. - RTL left-aligned text - line ending with <br /> not correctly left-aligned
  1062. - <input type=submit|reset etc name="xxx" e.g. Google button showed as I&039;m feeling lucky
  1063. - Annotations all linked to Page 1 (parent object)
  1064. - Error "division by zero" using columns
  1065. - MultiCell() and Write() [direct writing functions] - miscalculating length of line in non-core fonts (+ other bugs)
  1066. - error if CJK space at end or beginning of line with 0x20 spaces in as well
  1067. Configurable variables (see config.php file):
  1068. ----------------------
  1069. $this->printers_info
  1070. $this->bleedMargin
  1071. $this->crossMarkMargin
  1072. $this->cropMarkMargin
  1073. $this->cropMarkLength
  1074. $this->nonPrintMargin
  1075. $this->restrictColorSpace
  1076. $this->PDFX
  1077. $this->PDFXauto;
  1078. $this->useKerning
  1079. [$this->rtlcss removed]
  1080. Updated files
  1081. -------------
  1082. mpdf.php
  1083. config.php
  1084. config_cp.php (removed references to dir - but not essential to update - just redundant information)
  1085. compress.php
  1086. includes/out.php
  1087. includes/functions.php
  1088. classes/svg.php
  1089. classes/ttfontsuni.php
  1090. classes/indic.php
  1091. /font/helvetica*.php and /times*.php
  1092. Added CSS support
  1093. =================
  1094. All Block elements including <BODY> <TABLE> <TR>
  1095. ------------------------------------------------
  1096. background-image-resolution: normal | [ from-image || <dpi> ]
  1097. direction: [ rtl | ltr ] (HTML attribute dir also supported)
  1098. background: [ gradients ]
  1099. background-image: [gradients ]
  1100. For [ gradients ] syntax see:
  1101. - Mozilla linear - https://developer.mozilla.org/en/CSS/-moz-linear-gradient
  1102. - Mozilla radial - https://developer.mozilla.org/en/CSS/-moz-radial-gradient
  1103. - Mozilla gradients use - https://developer.mozilla.org/en/Using_gradients
  1104. - CSS3 linear gradients - http://dev.w3.org/csswg/css3-images/#linear-gradients
  1105. - CSS3 radial gradients - http://dev.w3.org/csswg/css3-images/#radial-gradients
  1106. Almost all elements - block and in-line
  1107. ---------------------------------------
  1108. font-kerning: auto | normal | none // need to set $mpdf->useKerning = true;
  1109. letter-spacing: normal | <length>
  1110. word-spacing: normal | <length>
  1111. Colours
  1112. -------
  1113. Anywhere that color is specified (e.g. color, background-color, borders)
  1114. - rgb(255,255,255)
  1115. - rgba(255,255,255,1) // last value is transparency (alpha) - between 0-1
  1116. - rgb(100%,100%,100%)
  1117. - hsl(360,100%,100%) // H: 0-360; S/L: 0-100%; a:0-1
  1118. - hsla(360,100%,100%,1)
  1119. - cmyk(100,100,100,100) // or 0-100%
  1120. - spot(COLOR NAME, 100%) // e.g PANTONE 310 EC; use AddSpotColor() to define first
  1121. <TR>
  1122. border:
  1123. <TABLE> <TR>
  1124. background:
  1125. background-color:
  1126. background-image:
  1127. <IMG>
  1128. gradient-mask: [can use any of the gradient syntax]
  1129. image-orientation: <angle> - supports deg, rad or grad
  1130. image-resolution: normal | [ from-image || <dpi> ]
  1131. <OL|UL>
  1132. list-style: arabic-indic | bengali | devanagari | gujarati | gurmukhi | kannada | malayalam | oriya |
  1133. persian | telugu | thai | urdu | tamil
  1134. @page
  1135. marks: [ crop || cross ] - i.e. crop and cross can be used together
  1136. odd-header-name: "_default" - allows current non-HTML header to remain unchanged
  1137. background-image-opacity: [ 0-1 ]
  1138. background-image-resize: [ 1-6 ] - see Manual
  1139. ===========================
  1140. mPDF v5.0 (30/09/2010)
  1141. ===========================
  1142. New Features
  1143. ------------
  1144. - Font handling simplified, reads TrueType font files directly
  1145. Minor Enhancements
  1146. ------------------
  1147. - rotation of fixed-position block elements (see example 10 and manual for supported CSS)
  1148. - support for CSS Small-Caps font-variant added
  1149. - utility scripts in /utils/ folder to help font management
  1150. - new simplified functions AddPageByArray() and TOCPageBreakByArray() added
  1151. - progress bar simplified and customisable
  1152. - improved word-wrapping for CJK langauges
  1153. - improved recognition of CJK/Indic/Arabic characters
  1154. - invalid UTF-8 input now outputs a meaningful error by displaying input html with errors marked
  1155. - GIF or PNG images with transparency/interlaced/non-standard compression handled as internal data
  1156. if /tmp/ folder is not present or writeable
  1157. - support for <html dir="rtl">
  1158. - support for "display: none" on inline elements
  1159. - annotations supported in fixed-position block elements
  1160. Bug fixes
  1161. ---------
  1162. - <br /> preceded by space does not correctly text-align to right
  1163. - zero-width character in middle of line caused line-break (e.g. diacritic or U+200C = ZWNJ)
  1164. - HTML attributes not recognised if spaces e.g. 'src = "..."'
  1165. - Headers changed for output - problem reported on IE8 64-bit using SSL
  1166. - using SetAutoPageBreak(false) used caused unexpected behaviour with table rows at page break
  1167. - (from Beta) incorrect check for temporary font data folder causing errors
  1168. - artificial Bold/Italic not working in table cell when using rotated text
  1169. - allow <dottab> to inherit font color correctly
  1170. - SVG now works with Adobe 7
  1171. - background in header overwriting text
  1172. - vertical text in table header not correctly horizontally positioned when repeated
  1173. - compatibility with PHP >= 4.3 (htmlspecialchars_decode, stripos)
  1174. - updated depracated script PHP 5.3.0 ($string{1} to $string[1], $var =& new Object(), set_magic_quotes_runtime)
  1175. - index (CreateIndex) number string incorrect if arabic(rtl) text anywhere in document
  1176. - MultiCell incorrectly calculate string length/width when using core fonts
  1177. - page-break-inside:avoid - used with non-HTML footer had space inserted for footer height
  1178. - page-break-inside:avoid - error if more than 1 page height but not enough to trigger second pagebreak
  1179. - page-break-inside:avoid - incorrectly layering page backgrounds (headers and content brought forward)
  1180. Changes from 5.0 Beta
  1181. ---------------------
  1182. If you are upgrading from the Beta version - you MUST delete all files in the /ttfontdata/ temporary directory
  1183. - config.php file has been changed (extra CJK characters to recognise CJK blocks)
  1184. - $this->backupSubsFont (in config_fonts.php) optionally now takes an array
  1185. - no need to define 'cjk'=>true or 'sip|smp'=>true in config_fonts.php (ignored; cf. $this->BMPonly)
  1186. - Indic language fonts have been altered to add Latin and Latin-1 Supplement characters
  1187. - progress bars now has an external progbar.css and configurable main heading
  1188. - added initial parameter new mPDF('+aCJK') or '-aCJK' to override default useAdobeCJK at runtime
  1189. - QRCode is not included in main download (but as an extra package)
  1190. BACKWARD COMPATIBILITY
  1191. ----------------------
  1192. If you have been using earlier versions of mPDF, most scripts should work as before. But note:
  1193. - Arial, Helvetica, Times and Courier are now treated like any other font
  1194. - the whole CSS font string is parsed e.g. style="font-family:'Lucida Grande';" will look for a font 'lucidagrande'
  1195. and not 'lucida'
  1196. Configurable variables (see config.php file):
  1197. ----------------------
  1198. - $mpdf->useSubstitutionsMB is now depracated, but will work as an alias for $mpdf->useSubstitutions
  1199. The initial parameters e.g. new mPDF('utf-8') have all changed. Old ones may be recognised, or will be ignored.
  1200. - $mpdf->useOnlyCoreFonts is now depracated and is ignored. Use new mPDF('c')
  1201. - $this->use_CJK_only is now depracated and is ignored. See $this->useAdobeCJK and new mPDF('+aCJK') or '-aCJK'
  1202. Control SmallCaps appearance
  1203. - $mpdf->smCapsScale = 0.75; // Factor of 1 to scale capital letters
  1204. - $mpdf->smCapsStretch = 115; // % to stretch small caps horizontally
  1205. Customisable Progress bar
  1206. - $mpdf->progbar_heading = 'mPDF file progress';
  1207. - $mpdf->progbar_altHTML = '';
  1208. Control fonts/subsetting
  1209. - $mpdf->maxTTFFilesize = 2000;
  1210. - $mpdf->percentSubset = 30;
  1211. - $mpdf->debugfonts // show font errors and warnings
  1212. Replaceable alias
  1213. - $mpdf->iterationCounter = false; // Allow use of {iteration varname} in THEAD
  1214. ===========================
  1215. mPDF v5.0Beta (21/07/2010)
  1216. ===========================
  1217. New features
  1218. ------------
  1219. The main change in mPDF v5 is the handling of TTF and TTC fonts directly.
  1220. See README.txt and FONT INFO.txt for more information
  1221. QR-code (2-dimensional barcode) Added
  1222. -------------------------------------
  1223. type="QR"
  1224. Size=1 is an arbitrary 25mm widthxheight. error="L|M|H|Q"
  1225. text="" can be numeric, alphanumeric or binary(?)
  1226. Required whitespace is always included around it
  1227. Enhancements
  1228. ------------
  1229. - progress-bar is simplified (no javascript class)
  1230. - dir="rtl" supported in <html> or <body> tag
  1231. Bug fixes
  1232. ---------
  1233. - artificial Bold/Italic now working in table cells with rotated text
  1234. - "-" is now allowed in a font name e.g. sun-exta
  1235. - <dottab> now inherits font color correctly
  1236. - SVG class bugs fixed (was crashing in Adobe Reader v 7)
  1237. - background color/image in header no longer overwrites the header text
  1238. Changed Config variables
  1239. ------------------------
  1240. $this->useSubstitutionsMB is depracated
  1241. Character substitution always occurs when using core fonts.
  1242. Use $this->useSubstitutions for all cases.
  1243. New Configurable variables
  1244. --------------------------
  1245. $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
  1246. // default TRUE; only set false if you have defined some available fonts that support CJK
  1247. // If true this will not stop other CJK fonts if specified by font-family:
  1248. // and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
  1249. // Set maximum size of TTF font file to allow non-subsets - in kB
  1250. // Used to avoid e.g. Arial Unicode MS (perhaps used for substituteCharsMB) to ever be fully embedded
  1251. // NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
  1252. $this->maxTTFFilesize = 2000;
  1253. // If not -s (i.e. forced subset) this value determines whether to subset or not
  1254. // 0 - 100 = percent characters
  1255. // i.e. if ==40, mPDF will embed whole font if >40% characters in that font
  1256. // or embed subset if <40% characters
  1257. // 0 will force whole file to be embedded
  1258. // 100 will force always to subset
  1259. $this->percentSubset = 30;
  1260. $this->debugfonts - show errors and warnings for font parsing
  1261. Config variables removed
  1262. ------------------------
  1263. $this->use_CJK_only
  1264. $this->useOnlyCoreFonts
  1265. ================================================================================
  1266. ====
  1267. 4.6
  1268. ====
  1269. mPDF
  1270. files changed:
  1271. mpdf.php
  1272. config.php
  1273. makefonts/makefonts.php
  1274. class/t1asm.php
  1275. class/svg.php
  1276. graph.php
  1277. examples_04 (images)
  1278. config var added:
  1279. $this->tableMinSizePriority
  1280. 4.5.015
  1281. Bug fix:
  1282. Complex page with ToC entries ++ (example_ToC_bug4_5_015.php) caused Apache to crash
  1283. AdjustHTML() preg_pattern for matching <hx>... </hx> <table for keep-together - altered and fixed ? matching
  1284. Seemed to crash when content="Graph 12" between the <h> - 2 numbers (12) crash, 1 didn't!!!
  1285. 4.5.014
  1286. Bug fix:
  1287. 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,
  1288. because Font reference /F1 still present in doc pointing to non-existent resource.
  1289. Edited so that the reference is now removed from the page if font unused.
  1290. 4.5.013
  1291. Enhancement
  1292. TrueTypeUnicode fonts width array inserted as shortened form array (smaller file size)
  1293. 4.5.012
  1294. Bug fix: Incorrect handling orphan characters in table
  1295. (cf. http://mpdf.bpm1.com/forum/comments.php?DiscussionID=193 fixed in 4.2 - but going back to it still problems)
  1296. If xxxxx. fits but xxxxx.. doesn't: WriteFlowingBlock wraps it to next line, TableWordWrap sqeezed it onto one line
  1297. TableWordWrap fixed to only allow one orphan char. even if it fits with that one.
  1298. 4.5.011
  1299. Added Windows BMP image support
  1300. 4.5.010
  1301. SVG class:
  1302. - improved recognition of lineargradients/radialgradients referenced by xlink:href
  1303. - does not die if empty text string
  1304. - support for many text properties as style="" as well as currently as attributes (bold, fill etc)
  1305. - if using MB font, was respecting "Times" and "Courier" from the SVG file but using as ANSI not utf-8
  1306. 4.5.009
  1307. graph.php updated to include SVG - need to define in graph.php (as well as set up TTF fonts)
  1308. (SVG graph does not include CSIM, 3D skew.)
  1309. 4.5.008
  1310. t1asm.php has an error in the error message if .dat fontfile not found (".char.dat")
  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. 4.5.006
  1316. New config var
  1317. $this->tableMinSizePriority = false;
  1318. If page-break-inside:avoid but cannot fit on full page without
  1319. exceeding autosize; setting this value to true will force respsect for
  1320. autosize, and disable the page-break-inside:avoid
  1321. [NB edit Manual Table>>autolayout algorithm]
  1322. 4.5.005
  1323. Bug fix
  1324. Table set to avoid page-break-inside: in some circumstances entered loop with recalculating size
  1325. Fudge factor added of 0.001 in tbsqrt to calculate shrink factor
  1326. 4.5.004
  1327. Bug fix
  1328. If table set to avoid page-break-inside and table height (resized) exactly==remaining page - was triggering page break
  1329. Fudge factor added of 0.001 in tablewrite to query pagebreak
  1330. 4.5.003
  1331. Bug fix in makefonts/makefonts.php
  1332. Also changed the links in Step4 & 8 which move the newly created files to the font directory - will now show error message if error -
  1333. will NOT overwrite existing files. (Put in manual already)
  1334. 4.5.002
  1335. Bug fix in class/t1asm.php
  1336. If you have magic_quotes_runtime set On - problems using embedded subset.
  1337. 4.5.001
  1338. JPG "Exif" file recognised from header, and handled much more quickly and efficiently (not using GD)
  1339. ===========================
  1340. mPDF v4.5 (21/04/2010)
  1341. ===========================
  1342. New Features
  1343. ------------
  1344. The main change in 4.5 is the improved class for importing SVG images. (See details below)
  1345. Font files
  1346. ----------
  1347. Some bugs in the "makefonts" utility caused some errors in the files produced for embedding font subsets.
  1348. Surprisingly these are not easily detectable (I have yet to find one!).
  1349. All the font files used for embedding font subsets (the .dat and .dat.php files in /unifont/ folder)
  1350. have been re-generated. Download them if you are having problems with any fonts - otherwise, you probably
  1351. don't need to bother.
  1352. Minor Enhancements
  1353. ------------------
  1354. If keepColumns = true (i.e. disable readjustment of column length), mPDF will now reproduce
  1355. table header/footer rows in each column [4.4.015]
  1356. A number of changes to improve processing time [4.4.012]
  1357. [Thanks to carlholmberg http://mpdf.bpm1.com/forum/comments.php?DiscussionID=274&page=1#Item_3]
  1358. JPG files with header marked as "progressive DCT-based JPEG" are now supported [4.4.004]
  1359. Configurable variable (config.php) $dpi can be set to vary size interpreted from "px" values in HTML/CSS
  1360. NB Recommended that $dpi should always be set the same as $img_dpi
  1361. Support added for "ex" as a size value (approximates "ex" as half of font height)
  1362. Configurable variable (config.php) $watermarkImgAlphaBlend will determine how watermark images
  1363. will blend with underlying objects.
  1364. Bug fixes
  1365. ---------
  1366. - Make-fonts utility : makefonts/makefonts.php [4.4.016]
  1367. (All font files have been updated)
  1368. - Table header of only one column width - not printing right border [4.4.014]
  1369. - WMF and SVG images not rotating correctly to 90 or -90 degrees [4.4.013]
  1370. - Using templates, error if imported doc contains templates itself [4.4.001]
  1371. Updated Files
  1372. -------------
  1373. mpdf.php
  1374. config.php
  1375. classes/svg.php
  1376. makefonts/makefonts.php
  1377. ALL subset font files (/unifont/ .dat and .dat.php files), and all garuda and norasi files
  1378. New files
  1379. ---------
  1380. None
  1381. New config variables
  1382. --------------------
  1383. $this->watermarkImgAlphaBlend
  1384. $this->dpi
  1385. BACKWARD COMPATIBILITY
  1386. ----------------------
  1387. All but one changes in mPDF 4.5 are fully backwards compatible.
  1388. The configurable variable $this->watermarkImgBehind was introduced in v4.4 and was unintentionally set to TRUE
  1389. In v4.5 this is set to FALSE in the config.php file.
  1390. SVG Images
  1391. ----------
  1392. [svg.php CHANGED]
  1393. - Text stroke-width default changed to 1 [4.4.011]
  1394. - Text stroke - line-join type changed [4.4.010]
  1395. - Default value for fill changed to "black" [4.4.008]
  1396. - Bug fixes:
  1397. * to correct calculation of text-length (and therefore alignment R and C) [4.4.009]
  1398. * Corrected errors in path implementation esp. quadratic Bezier curves
  1399. * rounded corners to rectangles - error corrected
  1400. * Recognition of font-family improved
  1401. * remove \n (and other non-printable chars) from text
  1402. * zero length shapes are not output e.g. zero-width rectangle, zero-length line, zero-radius circle
  1403. - Support added for:
  1404. * gradient stop offsets and gradientUnits="userSpaceOnUse" [4.4.007]
  1405. In mpdf.php enabled define inner radius for radial gradients - only used internally by SVG at present
  1406. * user defined <ENTITY /> cf. 'render-elems-03-t.svg' in SVG Test Suite [4.4.006]
  1407. * "color" attribute and "currentColor" value for fill and stroke [4.4.005]
  1408. * fill:url(#...) in a style as well as attribute
  1409. * xlink:href for gradients
  1410. * 1.3002e-005 in svg path
  1411. * text-style changes (e.g. text-anchor) set on <g> element - not just on <text>
  1412. * fill-rule=evenodd|nozero
  1413. * dashed lines / stroke-dasharray & stroke-dashoffset
  1414. * gradientUnits=userSpaceOnUse;
  1415. * units e.g. 3mm or 14pt in Rectangle, Circle, Ellipse, Line and Text position
  1416. * transform on <text> element
  1417. * stroke as well as fill on text
  1418. NB The following are still NOT supported for SVG
  1419. - filters
  1420. - <marker>
  1421. - images
  1422. - DOM
  1423. - <pattern>
  1424. - textlength; lengthadjust; tspan, tref, toap, textPath;
  1425. - <use ../>
  1426. - gradient on stroke/text;
  1427. - <clipPath>
  1428. - text-underline and strikethrough
  1429. - text opacity
  1430. - colors as rgb(87%, 56%, 25%)
  1431. - rect using units for dimensions
  1432. - Only uses default spreadMethod = "pad" for gradients
  1433. ===========================
  1434. mPDF v4.4 (24/03/2010)
  1435. ===========================
  1436. New Features
  1437. ------------
  1438. - Support SVG image files (partial)
  1439. - Rotate images or graphs (by multiples of 90 degrees)
  1440. - Set opacity (transparency) for background images
  1441. - Control resizing of background images
  1442. - Set whether to print watermark images behind or in front of page contents
  1443. - Reduced memory usage when printing tables (partly configurable)
  1444. - Option to set path to folder for temporary files
  1445. - Improved compliance for CSS text-align justify
  1446. - Increased support for CSS "media"
  1447. - Improved performance when accessing local image files
  1448. Minor Enhancements
  1449. ------------------
  1450. - Allows space in output file name e.g. $mpdf->Output('t est.pdf','D'); [4.3.007B]
  1451. - Header changed in Output to improve compatability with IE6 (affects 'D' and 'I') [4.3.012B]
  1452. - background-images do not show noimage.jpg if missing [4.3.012D]
  1453. - simpleTables (which improves performance) now also allows: background-color, -gradient and -image, padding
  1454. and rotated text to be set for each cell. Only borders are not supported cell-by-cell. [4.3.006]
  1455. Bug fixes
  1456. ---------
  1457. - Page width not correctly reset when defining default page margins (L/R) by @page [4.3.007C]
  1458. - Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.3.005]
  1459. NB This should have been fixed in [4.2.028] but got left out!
  1460. - UseSubstitutionsMB causes errors inside <textarea> and <select> so now disabled in these 2 situations [4.3.004]
  1461. - CSS background: 'none' did not cancel background-image/background-color if it comes later [4.3.002, 4.3.011]
  1462. - Warning message 'depracated' (as of PHP 5.3) when using Templates [4.3.007]
  1463. - AutoFont incorrectly altering multibyte characters ending in \xa0 [4.3.012C]
  1464. - "Initial" default value for border-width changed from 1px to 'medium' e.g. border-top: solid #000000; [4.3.010]
  1465. - WMF image sometimes inverted [4.3.016]
  1466. Updated Files
  1467. -------------
  1468. mpdf.php
  1469. config.php
  1470. changelog.txt
  1471. New files
  1472. ---------
  1473. classes/svg.php
  1474. New config variables
  1475. --------------------
  1476. $this->justifyB4br=false;
  1477. $this->CSSselectMedia='print';
  1478. $this->watermarkImgBehind = false;
  1479. BACKWARD COMPATIBILITY
  1480. ----------------------
  1481. All changes are backwards compatible except the handling of some background-images - please see notes below.
  1482. Watermark Image z-order
  1483. -----------------------
  1484. By default mPDF prints watermarks on top of the page contents to ensure that they are not hidden by backgrounds
  1485. (especially table cells).
  1486. You can specify watermark images to be printed behind page contents by setting a configurable variable:
  1487. $this->watermarkImgBehind = true; // default=false
  1488. [4.3.018]
  1489. Rotating Images and Graphs
  1490. --------------------------
  1491. Images or graphs can be rotated (by multiples of 90 degrees) using a custom HTML attribute e.g.
  1492. <img rotate="90|-90|180" ... />
  1493. <jpgraph rotate="90" ... />
  1494. Valid options are: 90|-90|180.
  1495. Positive values are clockwise.
  1496. If width is specified e.g. width="3cm" this is applied to the rotated image i.e. will be width 3cm after rotating
  1497. [4.3.016]
  1498. Background Image Opacity
  1499. ------------------------
  1500. A custom CSS property "background-image-opacity": is now supported on BODY, DIV+ (block elements) and TD
  1501. Takes values between 0 and 1.0
  1502. Resizing Background Images
  1503. --------------------------
  1504. A custom CSS property "background-image-resize": is now supported on BODY, DIV+ (block elements) and TD
  1505. 0 - No resizing (default)
  1506. 1 - Shrink-to-fit w (keep aspect ratio)
  1507. 2 - Shrink-to-fit h (keep aspect ratio)
  1508. 3 - Shrink-to-fit w and/or h (keep aspect ratio)
  1509. 4 - Resize-to-fit w (keep aspect ratio)
  1510. 5 - Resize-to-fit h (keep aspect ratio)
  1511. 6 - Resize-to-fit w and h
  1512. N.B. Prior to v4.4 background-images were incorrectly constrained to maximum width of the containing block.
  1513. The default is now to do NO resizing on background-images. Setting "background-image-resize:3" should be used
  1514. for backwards compatibility.
  1515. [4.3.015, 4.3.012D]
  1516. SVG Image files
  1517. ---------------
  1518. SVG image files are now partially supported (but as for WMF - not as background-images).
  1519. viewBox (preserveAspectRatio is not supported) viewBox="0 0 400 200" width="400" height="200"
  1520. Takes viewBox in preference to width/height if present on <svg>
  1521. If neither present, will size to width of page (square) as the containing box.
  1522. Units are interpreted as pixels if undefined.
  1523. Doesn't recognise internal CSS <style> elements
  1524. Gradients only take 2 colours which are taken as stop-offset 0% and 100%
  1525. [4.3.013 & 4.3.017]
  1526. Reduced Memory Usage printing Tables
  1527. ------------------------------------
  1528. mPDF uses a lot of memory when processing large tables. Parts of the script have been rewritten to
  1529. reduce memory consumption when writing tables which use collapsed borders (10-25% saving).
  1530. Memory usage can be reduced further by setting a configurable variable:
  1531. $this->packTableData = true; // default=false
  1532. but note that this causes a significant increase in processing time.
  1533. [4.3.008, 4.3.019, 4.3.014]
  1534. User-defined path to Temporary folder
  1535. -------------------------------------
  1536. mPDF uses a folder to write and store temporary files when processing images. By default this is the
  1537. [your_path_to_mpdf]/tmp/
  1538. This is now user-definable by defining the constant _MPDF_TEMP_PATH before including mpdf.php script.
  1539. Text Justification
  1540. ------------------
  1541. In a justified text block, an inline image, textarea, input, or select causing a new line will now force
  1542. the previous line to be justified. HR and BR do NOT force justification (as in browsers).
  1543. For optional compliance of MS Word behaviour, there is a new configurable variable:
  1544. $this->justifyB4br = false; // Change to true to force justification before a <BR> (as in MS Word)
  1545. [4.3.003]
  1546. CSS support for @media
  1547. ----------------------
  1548. Now supports media-dependent CSS styles e.g.
  1549. @media print {
  1550. p { color: red; }
  1551. }
  1552. as well as
  1553. <style media="...">...</style> and
  1554. <link rel="stylesheet" media="print" href="..." />
  1555. Proper matching of CSS media to select using configurable variable:
  1556. $this->CSSselectMedia='print'; // default="print" set in config.php : screen, print, or any other CSS @media type (not "all")
  1557. N.B. $this->disablePrintCSS in now depracated
  1558. [4.3.001]
  1559. ===========================
  1560. mPDF v4.3 (28/02/2010)
  1561. ===========================
  1562. NEW FEATURES
  1563. ------------
  1564. - Page (sheet) size can be reset within document (https://mpdf.github.io/paging/different-page-sizes.html) [4.2.024, 4.2.025]
  1565. - PDF/A1-b compliant files (https://mpdf.github.io/what-else-can-i-do/pdf-a1-b-compliance.html)
  1566. - Improve performance using simpleTables (https://mpdf.github.io/reference/mpdf-variables/simpletables.html)
  1567. - mPDFI incorporated into main mPDF class (https://mpdf.github.io/reference/mpdf-functions/setimportuse.html)
  1568. - <dottab> added as custom HTML tag: inserts dots to the following text, which is right-aligned [4.2.031]
  1569. See Example files 38 and 39 for PDFA compliant file and <dottab>
  1570. BACKWARD COMPATIBILITY
  1571. ----------------------
  1572. All changes are backwards compatible except the use of mPDFI. You will need to make minor changes to your scripts.
  1573. See the manual https://mpdf.github.io/reference/mpdf-functions/setimportuse.html for details.
  1574. BUG FIXES
  1575. ---------
  1576. - When using Table of Contents and not resetting page numbers: HTML headers/footers showed incorrect page number [4.2.020]
  1577. - Table of Contents: last page not printing page background-color [4.2.023]
  1578. - Image file with space " " in the file name failing [4.2.016]
  1579. - Image file path unnecessarily resolved to full URI - changed to use relative path if possible [4.2.029] ***
  1580. - Table - not calculating height of cell correctly [4.2.015, 4.2.012, 4.2.011, 4.2.009]
  1581. - Table row breaking after/during cell when image in cell taller than font-height [4.2.008]
  1582. - When Table row(cell) greater height than the page-height but requiring resizing greater than allowed by autosize - not resizing [4.2.005]
  1583. - Table cell border not resized correctly [4.2.002]
  1584. - Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.2.028] ****
  1585. - Background-image in HTMLFooter not correctly setting 0,0 origin [4.2.014]
  1586. - Background-image set as an in-line style not working [4.2.013]
  1587. - Background-image set in CSS @page or <body> was being constrained to less than page size [4.2.032]
  1588. - Imported Templates overwriting Headers (with images or gradients) [4.2.004]
  1589. - When using imports/templates, HTML header with background-image causing page to disappear [4.2.001]
  1590. - block-style element breaking over more than 2 pages incorrectly adjusting L/R margins [4.2.022]
  1591. - CSS @page property "size" set on :left :right or :first pseudo-selectors - disabled [4.2.022]
  1592. - Annotations default colour incorrectly set in PDF as [100 100 0] corrected to [1 1 0] (seemed to work ok?) [4.2.026]
  1593. - Overwrite() now parses input file more tolerantly recognising more source files [4.2.030]
  1594. **** Bug fix 4.2.028 never got into the release of v4.3 Included in next release [4.3.005]
  1595. **** Bug fix 4.2.029 never not fully implmented in v4.3 Included in next release [4.3.012]
  1596. Changed files
  1597. -------------
  1598. mpdf.php
  1599. compress.php
  1600. config.php
  1601. classes/t1asm.php
  1602. includes/functions.php
  1603. mpdfi/fpdi_pdf_parser.php
  1604. Added files/folder: /mpdfi/filters/*.*
  1605. Added file/folder: /iccprofiles/sRGB_IEC61966-2-1.icc
  1606. mpdfi/mpdfi.php (no longer required)
  1607. New Configuration variables
  1608. ---------------------------
  1609. [config.php]
  1610. $this->enableImports
  1611. $this->simpleTables
  1612. $this->PDFA
  1613. $this->ICCProfile
  1614. $this->PDFAauto
  1615. Minor changes
  1616. -------------
  1617. Increased PDF file compatibility with spec 1.4
  1618. - PDF version changed to 1.4
  1619. - A binary file marker (a comment line with 4 characters > 127 ASCII) is added just after the first line
  1620. - %%EOF no longer has line break after it [4.2.010]
  1621. - /ID object is added to trailer object when not encrypted [4.2.010]
  1622. When using progress bars, one of the JS scripts is now referenced as an external file
  1623. to allow it to be cached by user's browser and improve performance for end-user [4.2.007]
  1624. Importing external PDF files: LZW encoded PDF files are now supported
  1625. When adding an annotation, the popup window can be set be either open or closed when the document is opened [4.2.027]
  1626. - size and position of the popup can also be specified
  1627. ===========================
  1628. mPDF v4.2 (27/01/2010)
  1629. ===========================
  1630. NEW FEATURES
  1631. ------------
  1632. - image handling improved
  1633. - table layout - additional control over resizing
  1634. - vertical-alignment of images - better support for all CSS types
  1635. - top and bottom margins collapse between block elements
  1636. - improved support for CSS line-height
  1637. - display progress bar whilst generating file
  1638. - CSS @page selector can be specified when adding a pagebreak
  1639. - CSS @page selector allows different margins, backgrounds, headers/footers on :first :left and :right pages
  1640. - PNG images with alpha channel fully supported
  1641. - ability to generate italic and bold font variants from base font file
  1642. - CJK fonts to embed as subsets
  1643. - "double" border on block elements
  1644. - character substitution for missing characters in UTF-8 fonts
  1645. - direct passing of dynamically produced image data
  1646. - background-gradient and background-image can now co-exist
  1647. Bug fixes
  1648. ---------
  1649. - empty variable (undefined var, false, null, array() etc.) sent to WriteHTML produced error message "Invalid UTF-8"
  1650. - CJK in tables when not using CJK (utf-8-s) autosized very small as characters did not word-wrap
  1651. - parsing stylesheets: background image not recognised if containbed uppercase characters in file name
  1652. - "double" border on table used white between the lines instead of current background colour
  1653. - $this->shrink_tables_to_fit = 0 or false caused fatal errors
  1654. - background color or images not printing correctly when breaking across pages
  1655. - background not printed for List inside a block element
  1656. - columns starting near end of page with no room for a line triggering column change (resulting in text misplaced) not page break
  1657. - table cell not calculating cell height correctly when "orphan" characters (;:,.?! etc.) at end of line
  1658. - table breaking page in column 2 when col 1 is rowspan'ned
  1659. - margin-collapse at top of page not working if bookmark/annotation/indexentry/toc
  1660. - column break triggered by HR triggering a second column break
  1661. - an empty 'position:fixed' element with no/auto width or height caused fatal error
  1662. - mPDFI: template documents were overwriting HTML headers
  1663. - mPDFI: function Overwrite (to change text in existing PDF) - fatal error if using with encrypted file
  1664. Bug - not fixed
  1665. - WriteHTML('',2) with '2' parameter not recognising 'margin-collapse:collapse' for DIVs or 'line-height' set in default CSS 'BODY'
  1666. New or Updated Files
  1667. --------------------
  1668. mpdf.php
  1669. compress.php
  1670. config.php
  1671. config_cp.php
  1672. config_fonts.php
  1673. mpdf.css
  1674. classes/gif.php
  1675. classes/indic.php
  1676. includes/subs_core.php
  1677. mpdfi/mpdfi.php
  1678. unifont/ar_k_001.uni2gn.php
  1679. All files in new folder: /progress/*.*
  1680. NEW FOLDER /tmp/ required with read/write permissions - used for temporary image files or progress bars
  1681. ===========================
  1682. mPDF v4.1.1 (21/12/2009)
  1683. ===========================
  1684. Error corrected in /makefont/makefonts.php file (moved completed Unicode files to font folder instead of unifont)
  1685. ===========================
  1686. mPDF v4.1 (20/12/2009)
  1687. ===========================
  1688. MySQL support for embedded font subsets abandoned, and replaced with file-based.
  1689. Files no longer required
  1690. ------------------------
  1691. config_db.php
  1692. /unifont/RUNME.php
  1693. /unifont/*.ufm and /unifont/*.t1a font files
  1694. MySQL Database no longer required
  1695. Files Updated
  1696. -------------
  1697. mpdf.php
  1698. /classes/t1asm.php
  1699. /makefont/makefonts.php
  1700. New files
  1701. ---------
  1702. /unifont/*.dat and /unifont/*.dat.php font files
  1703. Bug-fixes
  1704. ---------
  1705. - Image - If automatically resizing to fit maximum page size incorrectly subtracted margin-header
  1706. - Annotation and textarea in same HTML chunk causes mPDF to crash (preg_replace textarea with /u modifier in AdjustHTML)
  1707. - set_magic_quotes_runtime error ($mgr not $mqr)
  1708. - Table align did not reverse when using RTL document
  1709. Alteration: Image - if writing Image in fixedpos div position:absolute - to allow Image to be resized to full page size
  1710. ===========================
  1711. mPDF v4.0 (17/12/2009)
  1712. ===========================
  1713. Major additions
  1714. ---------------
  1715. - Ability to embed font subsets (creating much smaller files)
  1716. - Much improved support for Arabic languages
  1717. - Support for Indic languages including consonant conjuncts
  1718. - Support for Fixed position block elements
  1719. - New utility to help create your own fonts
  1720. - PNG alpha channel transparency supported
  1721. - New utility to create smaller mpdf script with reduced functionality (less memory)
  1722. - Multiple Barcode types supported
  1723. **********************************************************************************************
  1724. * For more details see the documentation manual: http://mpdf1.com/manual/index.php?tid=410 *
  1725. **********************************************************************************************
  1726. Bug fixes (parsing CSS)
  1727. -----------------------
  1728. - <link href="" ... was not recognised if > 1 space between words
  1729. - #Content p em { font-style:italic; } was applied to "#Content p"
  1730. - @import url() embedded in a stylesheet file requires path fixed relative to stylesheet file
  1731. - background-image url() embedded in a stylesheet file requires path fixed relative to stylesheet file
  1732. - comment tags inside CSS <style> embedded in the HTML were removed
  1733. Now fixed so <style><!-- ... --></style> works; <!-- <style>...</style> --> is removed
  1734. Bug fixes (other)
  1735. -----------------
  1736. - clear (CSS property for floating elements) caused properties for that element to reset to defaults
  1737. - width: auto caused collapse of border and padding on L & R of ordinary block elements
  1738. - text-indent not inherited correctly (including em and % values)
  1739. - named colour "steelblue" corrected RRGGBB hex code
  1740. - table cell widths in %: if width of table cells set to >=100%, and not all columns are set
  1741. This was fixed in 3.2 but led to problem where 2 cols: 1) 80% and 2) not set (see Table sizing test)
  1742. Now fixed again to work for both(?)
  1743. - parse PNG error fixed
  1744. - bachground-image not correctly positioned in HTMLFooter and HTMLHeader (Not fixed properly in 3.2!)
  1745. - fonts not supported with 0-9 in the name
  1746. - font list in GetCodepage() in htmltoolkit.php (now config_cp.php) containing space " " not recognised
  1747. - list number positioning
  1748. - list font size set in CSS for UL/OL not working for first level list
  1749. - table width (real value, not %) not working in nested table
  1750. - GIF file failed if PDF file not compressed
  1751. - list-style-type incorrectly inherited
  1752. - line-height inheritance in lists
  1753. - SetColumns added a new line - not required if at start of document/page
  1754. - footer_line_spacing did not work
  1755. - table cellPadding="" overwrote cell padding set on cell CSS
  1756. - could not turn off Default non-HTML foter LINE
  1757. - border specified as "em"
  1758. - default values set in mpdf.css overriden by inherited properties e.g. <div><h1>Here</h1></div> lost font-size for H1
  1759. ===========================
  1760. mPDF v3.2 (25/10/2009)
  1761. ===========================
  1762. Bug fixes
  1763. ---------
  1764. - 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
  1765. - Ouput download file changed to allow compatability with IE6 (http://mpdf.bpm1.com/forum/comments.php?DiscussionID=120&page=1#Item_4)
  1766. - 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]
  1767. - Table: if font changed in cell, font was not retoring properly afterwards causing errors (restoreInlineProperties())
  1768. - Lists: list items containing <br />, font not restoring after bullet
  1769. - Graceful support for block elements inside list items e.g. <li><p>... (not supported, but tolerated)
  1770. - Index: Created dividing letters separately for Uppercase and lowercase
  1771. - Incorrectly changing input character set when encountering e.g. charset=iso-8859-1 in the text of the document
  1772. - Changed so only detects it if within <head>...</head>
  1773. - 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
  1774. - Background-image used in HTML footer not appearing (correctly)
  1775. - RTL tables: nested tables will not automatically transpose L->R
  1776. - "Keep heading with table" - changed to allow <h1 style=".."> not just <h1>
  1777. - "Keep heading with table" - backgrounds (bgcolor, image or gradient) incorrectly handled - now removed
  1778. - Rotated table spread over more than 1 page caused enclosing block background colours to be be rotated along with table
  1779. - CSS text-indent % now correctly suported (% of containing block width)
  1780. - CSS width em on a block element e.g. DIV now correctly suported
  1781. - calculating _tableheight, if remainingpage==0, get error (div by zero)
  1782. - Table moved to next page with page-break-inside=avoid, produced an enlarged table (font)
  1783. - RTL text-align override on BODY text was not working consistently
  1784. - Arab characters: Character &#x647; (HEH) appearing in Final presentation form instead of Isolated
  1785. - Vertical position of background-image on whole page incorrect
  1786. - SetProtection can now be used with no permissions set (was not working unless at least one permission set)
  1787. Developers
  1788. ----------
  1789. Some more undefined indexes and variables declared (courtesy of DSmart http://mpdf.bpm1.com/forum/comments.php?DiscussionID=117&page=1#Item_0 )
  1790. Comment lines removed for < v3.0 to tidy up code
  1791. Enhancements
  1792. ------------
  1793. CSS style height now partially supported on block elements DIV, P, H1 etc. --IF--
  1794. - block is all on one page
  1795. - will extend the block but not shorten it
  1796. - will not force a pagebreak (max. at bottom of page)
  1797. - % is interpreted as % of printable page height (inside margins)
  1798. <TFOOT> now supported (placed at start as in HTML spec) displays at end of table, and repeats as a footer
  1799. Background-image and background-gradient now supported in TD and TH (works in all cases except: background-image is not rotated or
  1800. positioned correctly if table is rotated)
  1801. NB Background images and background-gradients do not work if Columns are being used, or if $use_kwt is TRUE (keep-with-table),
  1802. or if page-break-inside:avoid is active.
  1803. Updated files
  1804. -------------
  1805. mpdf.php
  1806. htmltoolkit.php
  1807. ===========================
  1808. mPDF v3.1 (30/08/2009)
  1809. ===========================
  1810. Bug fixes
  1811. ---------
  1812. - Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com
  1813. was giving http://www.yourdomain.com//image.png) [3.1]
  1814. - Errors in parsing background CSS (background-repeat, background-position etc) [3.1]
  1815. - Textarea did not corectly convert width or height in units relating to font e.g. em [3.0beta_01]
  1816. - If page margin-bottom set to zero, SetHTMLfooter() crashes with "Division by zero" error [3.0beta_01]
  1817. - Table with header row and rowspan in tbody, not calculating maxrowheightcorrectly
  1818. - Prevent Index breaking column just after a dividing letter
  1819. - Select or input form field when text around it is justified had text in the form field justified
  1820. - TocBookMarkText needs to be htmlspecialchar-ed - decoded when entered inside <tocpagebreak>
  1821. - <img src="" /> caused crash
  1822. - DisplayPreferences used as a variable name and a function: function renamed to SetDisplayPreferences()
  1823. - Image with src file not including a "." incorrectly parsed (e.g. http://www.domain.com/imagegenerator?params=23)
  1824. New Features
  1825. ------------
  1826. - var $debug (true|false) default false; show or hide error reporting at output stage [3.1]
  1827. - var $autoPageBreak (true|false) default true; allows overriding of automatic page breaks [3.0beta_02]
  1828. - <indexinsert /> HTML equivalent of CreateIndex() [was CreateReference()]
  1829. - 2nd attribute/parameter "xref" in IndexEntry() and <indexentry> - works like IndexEntrySee() as cross-reference entry
  1830. - function SetWatermarkText allows null parameters to be passed i.e. SetWatermarkText() - will clear the WatermarkText
  1831. - <watermarktext content="" alpha="" /> - HTML equivalent of SetWatermarkText()
  1832. - <watermarkimage src="" alpha="" position="" size="" /> - HTML equivalent of SetWatermarkImage()
  1833. Documentation
  1834. -------------
  1835. See Manual at http://mpdf.bpm1.com/manual/ for more information - especially:
  1836. - User's Guide>>What Else Can I Do?>>Backgrounds & Borders
  1837. - User's Guide>>What Else Can I Do?>>Floating blocks
  1838. Files updated:
  1839. -------------
  1840. mpdf.php
  1841. htmltoolkit.php
  1842. graph.php
  1843. Developers only
  1844. ---------------
  1845. 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.
  1846. $arr = array();
  1847. ...
  1848. if ($arr['index'] == 5 ) {...}
  1849. To prevent this, lines were added at the start of the mpdf.php script to turn error notices OFF.
  1850. In a move towards making mPDF able to run with full error_reporting on, a large amount of the script has been altered
  1851. e.g. the line above would be changed to:
  1852. if (isset($arr['index'] && $arr['index'] == 5 ) {...}
  1853. 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
  1854. off in mPDF 3.1
  1855. If you care to test it, please uncomment line 43 (//error_reporting(E_ALL);) and report any warning notices that you get.
  1856. NB This has added about 40kB to the script size.
  1857. ===========================
  1858. mPDF v3.0beta (14/06/2009)
  1859. ===========================
  1860. New Features
  1861. ------------
  1862. - CSS "float" partially supported (as well as clear:left|right|both)
  1863. - CSS "background-image" "background-position" "background-repeat" "background-color" "background" supported for block-level elements
  1864. - CSS background-color and background-image for <body > element added: this covers the whole page i.e. not just inside the "margins"
  1865. - CSS background-color and background-image can be defined for CSS @page{}
  1866. - Background gradients (linear or radial) can be defined using a custom CSS style property
  1867. - Border radius can be defined to give rounded edges to block elements (uses draft CSS3 spec.)
  1868. - page number can be reset to any value during the document (in AddPage() <pagebreak> etc.)
  1869. - PNG images: Interlaced and alpha-channel-set PNG images now supported
  1870. - internal links supported in Indexes (parameter added to CreateIndex()/CreateReference(): $useLinking=true;)
  1871. - HTML Headers and footers now support hyperlinks
  1872. - improved handling of <br>, block elements, and text lines inside table - approximates better to browser handling
  1873. - borders of block-level elements & table cell borders supported (partially) in columns
  1874. - optional error reporting for problems with Images ($showImageErrors)
  1875. - ToC will word-wrap long entries
  1876. - internal links (Bookmarks, IndexEntry and ToCEntry) rewritten to give more accurate positioning (when used as <tag>)
  1877. - autofont algorithm improved for CJK languages
  1878. - define text before and after page numbers ($pagenumPrefix; $pagenumSuffix; $nbpgPrefix; $nbpgSuffix;)
  1879. - Additional color names supported - full list from SVG1.0
  1880. Bug fixes
  1881. ---------
  1882. - Column width not resetting after an automatic pagebreak, or after setting HTMLheader
  1883. - using AutoFont unnecssarily changed htmlspecialchars to code causing errors
  1884. - Lists inside a table - incorrectly calculating table cell height
  1885. - CJK - 4-byte utf-8 chars not displaying properly (includes HKCS characters)
  1886. - mailto: links incorrectly handled
  1887. - TOCpagebreak() - usePaging default clarified: true unless specified as '', 0, '0' or false; (null ->true)
  1888. - <tocpagebreak> (as html tag) with no "name" defined, used at start of page, added a further blank page(s)
  1889. - Lists - inaccurate calculation of space required for numbers in certain circumstances
  1890. - Generated images (.php) only working if cURL enabled - (fixed, but rquires allow_url_fopen if remote file)
  1891. - flag added to turn off error reporting when buffering used ($allow_output_buffering = false;)
  1892. - 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)
  1893. - TOC - if not using ODD/EVEN paging, did not add extra page and messed up
  1894. - Rotated table which did not fit on remaining page resized to bigger than default
  1895. - HR of width less than 100% - text continued on line after it
  1896. - HR alignment not working (fixed so both CSS text-align and margin: 0 0 0 auto etc work)
  1897. - HR in table did not correctly re-size when necessary
  1898. - characters in symbols/zapfdingbats which in non-utf-8 mode are represented as chr(173) incorrectly handled as soft-hyphens
  1899. (bug introduced 2.5 with soft-hyphens - affects symbols &#8593; arrow-up and Zapfdingbats &#9313; encircled 2)
  1900. - Internal links (anchors) - Annotation/Bookmarks etc. incorrectly positioned when page orientation changed
  1901. - ToC - when using multiple ToCs, internal links were not correctly adjusted
  1902. - anchor (a name="") used inside a table was incorrectly positioned at the end of table
  1903. - Tables: cell height calculated incorrectly when BR used
  1904. - Table rotated with "page-break-inside:avoid" not kept on one page
  1905. - Table rotated and split over > 1 page - vertical alignment inaccurate
  1906. - Headers/Footers (non_html) when no style set caused errors
  1907. - Table: breaking page when using rowspan error (line 17142)
  1908. - ToC: If no indent defined in HTML tag <tocpagebreak> or defined as 0 gave error
  1909. Note
  1910. ----
  1911. In mPDF 3.0 the following sections of code have been significantly rewritten:
  1912. - painting of borders and background colours for block-elements
  1913. - table of contents
  1914. - Index
  1915. - vertical justification in columns (uses scaling to stretch vertically)
  1916. NB changed htmltoolkit AdjustHTML - does not now remove <br> before </div>
  1917. Warning - may display differently in normal text as well as tables
  1918. Files updated:
  1919. -------------
  1920. mpdf.php
  1921. htmltoolkit.php
  1922. Developers only
  1923. ---------------
  1924. - Background-color handling in CSS changed so only inherited/cascaded when Columns active or Keep-block-together
  1925. - otherwise would overwrite background image with inherited color
  1926. - all %.2f used in sprintf() changed to %.3f in htmltoolkit.php and mpdf.php to increase accuracy of div border lines in columns etc.
  1927. - variable $use_embeddedfonts_1252 renamed to $useOnlyCoreFonts as more precise: depracated but still supported.
  1928. - this version included quite abit of tidying up/future-proofing some code:
  1929. $var{0} changed to substr($var,0,1) etc. (due to go in PHP6)
  1930. ereg_ changed to preg_ (depracated in PHP5.3) - (NB mainly in htmltoolkit.php)
  1931. ===========================
  1932. mPDF v2.5 (01/05/2009)
  1933. ===========================
  1934. New Features
  1935. ------------
  1936. - Automatic Hyphenation added, and support for soft-hyphens
  1937. - Encryption works now for CJK language documents
  1938. - Improved text justification
  1939. - Support for 'generated' images e.g. "../ontheflyimage.php"
  1940. Bug fixes
  1941. ---------
  1942. - Tables: cell height did not reduce if font-size used was smaller than table default
  1943. - Columns: if setcolumns() to the same number already active - did not print out last bit of previous columns
  1944. - 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)
  1945. - <HR> in table cell was printing in incorrect position (bug introduced in mPDF 2.4)
  1946. - Justification
  1947. - if only one word on line, did not respect maximum character spacing
  1948. - last character of line incorrectly had character spacing applied
  1949. - Space at the end of last line of a Right Justify block - e.g. "end. </p>" now correctly ignored
  1950. - &nbsp; incorrectly treated as a character when justifying text with word/char spacing
  1951. - CJK punctuation (.,) added as 'orphans' to keep at end of line
  1952. - PNG files - was still buggy reading larger PNG files (due to fread)
  1953. Files updated:
  1954. -------------
  1955. mpdf.php
  1956. htmltoolkit.php
  1957. CJKdata.php
  1958. /patterns/.. (new files)
  1959. Developers only
  1960. ---------------
  1961. Variables renamed as more accurate or appropriate:
  1962. - var $isunicode renamed as $is_MB
  1963. - var $usingembeddedfonts renamed as $usingCoreFont
  1964. CJK changed to act internally as UTF-8 encoded
  1965. - (NB CJK Half-widths not supported from 2.5+ i.e. big5-hw gb-hw)
  1966. ===========================
  1967. mPDF v2.4 (23/04/2009)
  1968. ===========================
  1969. Files updated
  1970. -------------
  1971. mpdf.php
  1972. htmltoolkit.php
  1973. mpdfi/mpdfi.php
  1974. New files
  1975. ---------
  1976. graph.php
  1977. Graphs - Requires new folder: path_to_mpdf/graph_cache/ (must be writeable)
  1978. New features
  1979. ------------
  1980. Annotations improved so they appear as a pop-up
  1981. Re-use Document Templates (cf. RestartDocTemplate() in manual)
  1982. Limited support for CSS float property on an IMG element allowing text wrapping e.g. <img style="float: right;"> (cf. Images in manual)
  1983. Utility function PreparePreText() allows output of a text file which may include <pre>
  1984. Automatic generation of graphs from data in tables (requires integration with JPGraph) (cf. Graphs in manual)
  1985. Other Changes
  1986. -------------
  1987. IMPORTANT - User rights removed as not working with newer version of Adobe Reader 9 (affects Active forms and ability for users to modify annotations)
  1988. Corrects text alignment when using {nb} or {nbpg} in (non-HTML) headers/footers
  1989. Sets default timezone if not already set (at top of mpdf.php) to prevent E_STRICT ERROR message
  1990. Suppresses E_NOTICE error reporting (at top of mpdf.php)
  1991. Error capture in Output() to avoid PDF header being sent when error messages generated
  1992. A function str_ireplace added to htmltoolkit to allow PHP4 to function
  1993. Bug fixes
  1994. ---------
  1995. WMF images incorrectly positioned when in-line
  1996. PNG images > 8kB failed to load - (fix in 2.3 didn't work - fixed properly this time)
  1997. Annotations containing a new line (\n) causing an error
  1998. Evaluation of <pre> text: "<code>[TAB] " evaluated incorrect number of spaces to follow to align tabs, because < was calculated as 4 chars (&lt;)
  1999. ===========================
  2000. mPDF v2.3 (22/03/2009)
  2001. ===========================
  2002. New Features
  2003. ------------
  2004. - Optionally detect language and when to use special fonts i.e. RTL (arabic), CJK (chinese), Thai (see SetAutoFont() etc.)
  2005. - Supports HTML attribute "lang" in all tags and uses special fonts when required (see $useLang)
  2006. - Joins Arabic and Farsi/Persian text into presentation forms
  2007. - Import another PDF file and use as templates in your document (see UseTemplate() and mPDFI in the manual.)
  2008. - Replace specified text strings in an existing PDF file (see OverWrite() etc.)
  2009. - More than one Table of Contents can be used in a document (see tocpagebreak etc.)
  2010. - Restore properties of open HTML block elements after a page break (variable $restoreBlockPagebreaks or new tag <formfeed>)
  2011. - <annotation> <bookmark> <indexentry> <tocentry> can now accept characters <>'"& as htmlentities - htmlspecialchars(..., ENT_QUOTES)
  2012. - <annotation> can now accept "\n" for new line
  2013. - support for opacity (CSS3 property) for images
  2014. - specify the number of spaces to substitute for TAB when parsing <pre> tags
  2015. - greater control over margins and display when changing page orientation during document (see $forcePortraitMargins and $displayDefaultOrientation)
  2016. Bug fixes
  2017. ---------
  2018. Fonts in CSS - Not parsing font-family: Trebuchet MS; correctly as trebuchet
  2019. Fonts in CSS - CSS font-family: [unknown]; setting first $available_unifont rather than ignoring
  2020. Images - not displaying on IIS platform
  2021. Images - .wmf not displaying if (allow_url_fopen) not set
  2022. Table borders - in defaultCSS, 'MARGIN-COLLAPSE'=> collapase not quoted therefore not working
  2023. Line-break inside table - printing a blank background across page rather than just going down a line
  2024. Form fields inside tables - will now resize if the table is autosized (shrunk)
  2025. <pre> containing a '<' was changed to '&lt;'
  2026. Tabs inside <pre> were all changed to 8 spaces, not the remainder following a string
  2027. Header on first page was inset by 1mm left and right ($cMarginL and $cMarginR not set to zero)
  2028. Table nested inside a cell with colspan > 1 was incorrectly handled
  2029. PNG file crashed (?incorrectly defined PNG file) [adapted _parsepng to account for unexpected]
  2030. Table or Cell - if font-size not recognised, mPDF set font-size to zero
  2031. Font-sizes - [xx-small|x-small|small|medium|large|x-large|xx-large] were not recognised in tables
  2032. ===========================
  2033. mPDF v2.2.1 (17/02/2009)
  2034. ===========================
  2035. Bug fix - (bug introduced in 2.2)
  2036. Table - header row did not return to top of page when repeating across pages.
  2037. ===========================
  2038. mPDF v2.2 (15/02/2009)
  2039. ===========================
  2040. Updated files from mPDF 2.1
  2041. mpdf.php
  2042. htmltoolkit.php
  2043. mpdf.css (new)
  2044. ===========================
  2045. New files from mPDF <2.0 (only required for EAN Barcodes)
  2046. font/ocrb.xx (several)
  2047. unifont/ocrb.xx (several)
  2048. IMPORTANT - you need to make sure the ocrb font is added to the config.php file
  2049. - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
  2050. ===========================
  2051. Summary of changes
  2052. - external stylesheet file (mpdf.css) is used to configure default values ($useDefaultCSS2 and $defaultCSS2 are no longer used)
  2053. - special comment tags to hide mPDF tags from browsers: <!--mpdf ... mpdf-->
  2054. - AddColumn() function added (equivalent to <columnbreak>)
  2055. - annotations - pop-up messages the reader can move or delete (if you set permissions)
  2056. - support for WMF images as well as GIF, JPG, PNG
  2057. - watermark image can be set instead of, or as well as text
  2058. - nested tables can include other content
  2059. - improved control over table layout
  2060. - margin: auto now supported for table and block elements
  2061. A number of methods and variables have been renamed or reCapitalised for consistency.
  2062. Changes should be backwards comaptible.
  2063. All user methods start with a Capital, all user-defined variables start with lowercase.
  2064. Affected:
  2065. Reference() -> IndexEntry()
  2066. CreateReference() -> CreateIndex()
  2067. $TopicIsUnvalidated -> $showWatermark
  2068. setUnvalidatedText() -> SetWatermarkText()
  2069. PHP appears at present to be case-insensitive for function/method names
  2070. All the following functions have been renamed in the script with a capital first letter:
  2071. setUserRights()
  2072. setBasePath()
  2073. setAnchor2Bookmark()
  2074. setHeader()
  2075. setFooter()
  2076. defHeaderByName()
  2077. defFooterByName()
  2078. setHeaderByName()
  2079. setFooterByName()
  2080. setHTMLHeader()
  2081. setHTMLFooter()
  2082. defHTMLHeaderByName()
  2083. defHTMLFooterByName()
  2084. setHTMLHeaderByName()
  2085. setHTMLFooterByName()
  2086. shaded_box()
  2087. writeBarcode()
  2088. Variable names changed to lowercase first letter:
  2089. (Variables are case-sensitive therefore aliases have been set up)
  2090. Anchor2Bookmark
  2091. BiDirectional
  2092. KeepColumns
  2093. AliasNbPg
  2094. AliasNbPgGp
  2095. =========
  2096. Bug fixes
  2097. =========
  2098. Columns - $keepColumns=true was incorrectly calculating the place to continue printing after 1 and half columns (of 3)
  2099. 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
  2100. HR in Table cell - if table cell contains only HR (and column otherwise empty), HR was printed outside cell
  2101. HR in Table cell - if table cell ended with a HR, height was one line too much
  2102. Table page-break-inside:avoid - caused mPDF into permanent loop in some circumstances
  2103. Paging - Total Pages/Group {nb} and {nbgp} didn't work in CJK
  2104. CSS - Border size thin, medium and thick were only recognised in lowercase
  2105. Table-header - rowspan not correctly output in THEAD
  2106. Default CSS - table empty-cell:hide changed to show (CSS specification)
  2107. ===========================
  2108. mPDF v2.1 (24/01/2009)
  2109. ===========================
  2110. New Features in Version 2.1
  2111. ---------------------------
  2112. - CSS support improved generally (especially for cascading CSS, lists)
  2113. - TableHeader changed to allow multiple rows in THEAD
  2114. CSS changes
  2115. -----------
  2116. - display: none (block elements only - not lists or tables, nor HR)
  2117. - width (TD/TH)
  2118. - list-style-type (will also recognise the list-style-type from list-style) (OL/UL)
  2119. recognised values: disc|circle|square|decimal|lower-roman|upper-roman|lower-latin|upper-latin|lower-alpha|upper-alpha|none
  2120. - 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)
  2121. - 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
  2122. Numbered Lists
  2123. --------------
  2124. Variables set at the top of mpdf.php can be set to change:
  2125. - text alignment of numbers in numbered lists (default Right)
  2126. var $list_align_style = 'R';
  2127. - content to follow a numbered list marker e.g. '.' gives 1. or IV. whereas ')' gives 1) or a)
  2128. var $list_number_suffix = '.';
  2129. (These can be altered at run time, but are not changeable through stylesheets or in-line style)
  2130. Writing broken segments of HTML
  2131. -------------------------------
  2132. 2 new parameters have been added to WriteHTML()
  2133. function WriteHTML($html,$sub=0,$init=true,$close=true) {
  2134. $close - Leaves buffers/variables etc. in current state, so that it can continue to write the HTML where it leaves off
  2135. $init - Clears and resets buffers/variables
  2136. (N.B. You must end with a WriteHTML that calls $close=true)
  2137. Example:
  2138. $mpdf->WriteHTML('<p>This is the beginning...', 2, true, false);
  2139. $mpdf->WriteHTML('...this is the middle...', 2, false, false);
  2140. $mpdf->WriteHTML('...and this is the end</p>', 2, false, true);
  2141. Rotated text in table cells
  2142. ---------------------------
  2143. NB This UPDATE will change expected output from previous versions******
  2144. Prior to v2.1 any cell set to rotate text anticlockwise was forced to vertical align = bottom.
  2145. 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.
  2146. =========
  2147. Bug fixes
  2148. =========
  2149. - List - list starting after "<div>Then some text not in a block element<ol>" incorrectly output
  2150. - Tables - if cell font-size set smaller than default for the table, does not shrink the cell height
  2151. - Columns (tables) - columns breaking across rows e.g. in the middle of a table cell
  2152. - Tables - if table width set to e.g. 100% but cols are less, was not making up to set width
  2153. - Watermark - was not printing if using HTMLFooter
  2154. - Lists - not aligning numbering correctly if different font sizes used for bullet & text etc.
  2155. - Lists - indent of text did not correctly allow for Maximum number in <ol> list
  2156. - Table does not always move correctly to a new page
  2157. - Table cell incorrectly calculated height causing text to overflow cell when printed
  2158. - 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)
  2159. - Table cell width if set as a percent was being downsized when autosizing table
  2160. - Table CSS was buggy - improved
  2161. - SetBasePath (when fetching remote website) - now handles string with query string on it e.g. http://www.domain.com/index.php?tid=42
  2162. - Table cells with Rotated text - text not positioned correctly
  2163. - Page number totals not working in utf-8 mode
  2164. ============================
  2165. Code efficiency improvements
  2166. ============================
  2167. - BIG speed improvement (compared with 2.0) with tables (especially large tables)
  2168. - considerable increase in speed if writing long HTML segments to mPDF
  2169. - speed improvement for tables (may be very significant if some cells have a lot of text in them causing uneven column widths)
  2170. NB To speed up program more, consider setting $mpdf->useSubstitutions=false; if you do not use any characters outside the codepage selected
  2171. ===============
  2172. Keep-with-table
  2173. ===============
  2174. (This was introduced in v2.0 but I forgot to document it)
  2175. If you set $this->use_kwt = true;
  2176. 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)
  2177. See Known Issues re: Using kwt inside a div with border/background (doesn't work)
  2178. ===========================
  2179. mPDF v2.0 (07/12/2008)
  2180. ===========================
  2181. Main New Features in Version 2.0
  2182. - nested tables are supported
  2183. - supports both models of table border: separate and collapsed
  2184. - improved parsing of CSS stylesheets, and better handling of styles throughout
  2185. - additional recognised CSS styles
  2186. - page orientation, size, and margins can be changed within the document, using PHP script or custom HTML
  2187. - some limited support for @page CSS to define page-box areas, with crop/cross marks for printing
  2188. - improved control over headers and footers (including HTML headers/footers)
  2189. - improved presentation of Form elements including image-type input fields
  2190. - generates an EAN barcode suitable for a book/printed publication
  2191. - active forms can be generated - EXPERIMENTAL at present
  2192. - change document permissions to allow the user to make annotations - EXPERIMENTAL at present
  2193. NB Lines are commented in mPDF script as changes for mPDF 1.4 - this became v2.0
  2194. =========
  2195. UPGRADING
  2196. =========
  2197. 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.
  2198. To upgrade from v<=1.3 to v2.0 you only need to copy and overwrite the following 2 files:
  2199. mpdf.php
  2200. htmltoolkit.php
  2201. Plus (optionally) if you want to use the EAN Barcode function, you will also need:
  2202. font/ocrb.xx (several)
  2203. unifont/ocrb.xx (several)
  2204. IMPORTANT - you need to make sure the ocrb font is added to the config.php file
  2205. - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
  2206. ==========
  2207. Bug Fixes
  2208. ==========
  2209. <columns column-count="0"> did not turn off columns - Fixed
  2210. Margins as % - e.g. margin-right: 50% set from CSS incorrectly applied 50% of the fontsize
  2211. (Fixed - adding parameter to fn. ConvertSize in htmltoolkit.php and in calls to that function)
  2212. DIV Width - e.g. div style="width: 50% was not working
  2213. (Fixed - fn.SetCSS and OpenTag()'DIV')
  2214. CSS values as Zero - p { margin: 0; } did not work in stylesheet unless 0 had a unit
  2215. Multiple Non-breaking spaces collapsed - e.g. "1&nbsp; &nbsp; &nbsp;2" - was contracted to "1 2"
  2216. (Fixed - fn.adjustHTML in htmltoolkit.php)
  2217. 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
  2218. (Fixed in fn.WriteFlowingBlock)
  2219. Font size by inline style for form elements <input> <textarea> gave wrong size when using a relative size 0.9em
  2220. (Fixed - fn.ConvertSize in htmltoolkit.php)
  2221. Creation Date not correctly showing
  2222. (Fixed - did not need to convert to UTF16)
  2223. New block element started at end of page - block borders not painted
  2224. (Fixed - fn.AddPage)
  2225. DL did not close block correctly
  2226. (Fixed - mistype in fn. CloseTag)
  2227. Transparent not recognised as color/background-color
  2228. (Attempted a fix by setting to ignore it! - fn. convertcolor in htmltoolkit.php)
  2229. Zero (0) not displaying if only thing in table cell or tags e.g. <td>0</td> <p>0</p>
  2230. (Fixed - fn.WriteHTML)
  2231. 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.
  2232. (Fixed)
  2233. Could not copy from a completed PDF doc to clipboard when using a TrueTypeUnicode font
  2234. (Fixed - fn._puttruetypeunicode - added CIDToGIDMap)
  2235. Creating an Index (confusing called CreateReference in mPDF) based on only 1 column (i.e. columns off) caused it to print FAIL
  2236. (Fixed - fn. CreateReference())
  2237. Table of Contents - If a ToC entry reached other side of page a warning notice was produced
  2238. Fixed - printing is now suppressed and it is moved down a line (but not when using rtl)
  2239. "Keep Block Together" (i.e. page-break-inside: avoid for a block element)
  2240. 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
  2241. (Fixed)
  2242. NB This is now ALWAYS disabled when it meets a table - can use page-break-inside:avoid for the table
  2243. @import url(style.css) without quotation marks "" was not picked up, although it is valid HTML
  2244. (Fixed - fn.ReadCSS())
  2245. Reading CSS from external style sheets included all media
  2246. Now set by default to ignore media="aural|braille"
  2247. Allows media="print" but can exclude by: $mpdf->disablePrintCSS = true; (default = false)
  2248. Works on both <link... and <style media="print">@import...
  2249. See the web page example - this stops the CSS stylesheets specifically marked for "print" to be ignored
  2250. Table borders (in collapsed model) incorrectly calculated which border had dominance (mPDF <=1.3 determined the overriding border by its color)
  2251. (Fixed to follow CSS 2.1 specifications: width >> CSS dominance (cell>table) >> T & L > B & R)
  2252. In the border-collapse=collapse mode, the following rules determine which border style "wins" in case of a conflict:
  2253. 1. Borders with the 'border-style' of 'hidden' take precedence over all other conflicting borders.
  2254. 2. narrow borders are discarded in favor of wider ones.
  2255. 3. styles are preferred in this order: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and the lowest: 'inset'.
  2256. 4. If border styles differ only in color, then a style set on a cell wins over one on a table.
  2257. 5. When two elements of the same type conflict, then the one further to the left or top wins out.
  2258. Parsing CSS, a missed level would not be picked up i.e. CSS = div.refstr1 p {...} would not pick up:
  2259. <div class="refstr1"> <div class="another"> <p>...
  2260. (Fixed - fn. MergeCSS by carrying everything forwards)
  2261. Note: I removed - && !$this->blk[$this->blklvl-1]['cascadeCSS']['CLASS>>'.$attr['CLASS']]['depth']
  2262. Not sure why I put it there in the first place!
  2263. In a later bit of function - && $this->blk[$this->blklvl-1]['cascadeCSS'][$tag]['depth']>1
  2264. Haven't removed this, but is it needed???
  2265. 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)
  2266. (Fixed)
  2267. CSS properties color, font-weight, and font-style set on a table were not inherited by the table cells
  2268. (Fixed - var $base_table_properties)
  2269. When rotating a table, the text following was positioned incorrectly
  2270. (Fixed - fn. printtablebuffer)
  2271. When rotating a table, links were not adjusted in position e.g. <a href="">...
  2272. (Fixed - fn. printtablebuffer)
  2273. 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
  2274. (Fixed)
  2275. 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>
  2276. (Fixed - var $listjustfinished;)
  2277. 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)
  2278. (Fixed - fn.WriteHTML)
  2279. <link href="..." rel="stylesheet"> was not recognised (because the href comes before the rel)
  2280. (Fixed)
  2281. Read linked CSS stylesheet OR @import stylesheet - now includes both.
  2282. <tag class="class1 class2"> did not set either class1 or class2. Fixed so that it will now pick out class1 (better than nothing!)
  2283. CSS line-height as % - interpreted 120% as 120 (x the font-size) - Fixed so it now accepts % and numbers
  2284. Setting the basepath (used for relative links/external stylesheets etc) with $mpdf->setBasePath() was generally buggy!
  2285. Now allows a domain e.g. $mpdf->setBasePath("http://www.domain.com"); (previously needed slash on end)
  2286. (Fixed - hopefully!)
  2287. 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(...
  2288. =============
  2289. Improvements(?)
  2290. =============
  2291. Unsupported image files - mPDF died with an error message if image files didn't meet expected format e.g. an interlaced PNG file
  2292. Changed so images are now replaced by the NOIMG image.
  2293. Footer margin (HTML and normal footers) now determines the lowest point that is printed (rather than the place to start printing the footer)
  2294. NB IMPORTANT CHANGE - not backwards comaptible
  2295. 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]
  2296. To insert the total number of pages in the document anywhere in the doc, just use '{nb}'
  2297. The line: $mpdf->AliasNbPages();
  2298. has now been uncommented allowing {nb} to be used
  2299. NB This will always give the total no. of pages in the whole document regardless of any changes you have made to page numbering.
  2300. You can change the default placeholder '{nb}' to any string using: $mpdf->AliasNbPages('[**my Chars**]');
  2301. $mpdf->AliasNbPageGroups(); default="{nbpg}"
  2302. Can be used to set the total number of pages in the current group i.e. between where page numbering is reset
  2303. CSS border correctly fixes "solid 3mm #000000" i.e. (style width color) - (not a bug, but this is often incorrectly specified)
  2304. Can now print div background behind a rotated table.
  2305. You can keep columns as they are i.e. 1st column will finish page then start on second, by setting
  2306. $mpdf->KeepColumns = true;
  2307. Image constrain
  2308. ===============
  2309. Image size is constrained to current margins and page position. Extra parameter added to end of fn. allows you to override this.
  2310. $mpdf->Image('files/images/frontcover.jpg',0,0,210,297,'jpg','',true, false); // e.g. the last "false" allows a full page picture
  2311. Useful for e.g. a cover page for your document
  2312. Cumulative CSS
  2313. ==============
  2314. In version <=1.3, if you call:
  2315. $mpdf->WriteHTML($stylesheet,1);
  2316. $mpdf->WriteHTML($html); // this one cleared the array $this->cascadeCSS; conatining cascaded CSS information from stylesheets
  2317. You were meant to call:
  2318. $mpdf->WriteHTML($html,2); // which doesn't re-parse the CSS information
  2319. v2.0 changed so that
  2320. $mpdf->WriteHTML($html); no longers clears the array $this->cascadeCSS and so can be used repeatedly;
  2321. ================================================
  2322. Additional CSSstyles & HTML attributes supported
  2323. ================================================
  2324. <BODY> - font-style, font-weight, color
  2325. <IMG> - html attributes width="" and height=""
  2326. <TABLE|TD|TH> - border: 'thin' 'medium' and 'thick' are now converted to 1px, 3px and 5px
  2327. <TABLE|TD|TH> - border now respects all types - e.g. 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset'
  2328. (NB mPDF only supports a full declaration of border e.g. "border: thin double #000000;")
  2329. <TD|TH> - CSS style="white-space: nowrap" and HTML attribute nowrap="nowrap"
  2330. <TABLE> - page-break-inside: avoid
  2331. <TABLE> - border-collapse: separate|collapse
  2332. <TABLE> - border-spacing: 2px 2px; (horizontal/vertical) or just one figure (both) NB same as cellSpacing
  2333. <TABLE> - empty-cells: hide|show (border-collapse:separate only)
  2334. <TABLE> - margin-left and margin-right (previously only supported top and bottom)
  2335. <TABLE> - padding: (this was incorrectly used for TD/TH before) (border-collapse:separate only)
  2336. <TD|TH> - padding:
  2337. <TABLE|TD|TH> - inline style "background" works (with a color only) the same as "background-color"
  2338. NB Table page-break-inside, autosize values and rotate are only respected for that set on first level table of nested tables
  2339. <TABLE> - cellSpacing and cellPadding HTML attributes:
  2340. NB cellSpacing is the same as CSS style "border-spacing"
  2341. NB cellPadding is a <table> attribute, but sets the cell padding - not table padding
  2342. <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)
  2343. <BLOCK ELEMENTS> - page-break-before: always|left|right - NB any surrounding block tags will be closed before the new page is inserted.
  2344. @page - see notes on Paged Media
  2345. ==========================
  2346. Unsupported HTML attribute
  2347. ==========================
  2348. <TD border="1"> - not valid HTML - no longer supported
  2349. =========
  2350. Additions
  2351. =========
  2352. "Keep-with-table"
  2353. $mpdf->use_kwt = true; // default=false
  2354. If set to true, will force any H1-H6 header immediately preceding a table to be kept together with the table
  2355. - automatically sets the table to fit on one page (i.e. page-break-inside=avoid) if it is a rotated table
  2356. - ignored if: Columns on, Keep-block-together active (page-break-inside=avoid for surrounding BLOCK), active Forms
  2357. =====
  2358. Notes
  2359. =====
  2360. NB Not a change - but note you can use this to allow you to feed html code encoded in other than utf-8:
  2361. $mpdf->allow_charset_conversion=true;
  2362. $mpdf->charset_in='windows-1252'; (needs suitable codes for iconv i.e. windows-1252 not win-1252)
  2363. Fixing Optional tags
  2364. ====================
  2365. php.net website has illegal nesting of <dt>.. <dd> .. </dd> .. </dt> and <p>.. <div> .. </div> .. </p>
  2366. The example wich parses the php.net webpage will not show correctly unless you change: $mpdf->allow_html_optional_endtags=false;
  2367. Trying to fix incorrect (X)HTML with $mpdf->allow_html_optional_endtags==true cancels the P when it meets a DIV etc.
  2368. EAN barcode
  2369. ===========
  2370. An EAN barcode can be generated
  2371. function writeBarcode($code, $showisbn=1, $x='', $y='', $size=1, $border=0, $paddingL=1, $paddingR=1, $paddingT=2, $paddingB=2) {
  2372. It accepts 12 or 13 digits with or without - hyphens as $code e.g.
  2373. $mpdf->writeBarcode('978-1234-567-890', 1, $mpdf->x, $mpdf->y);
  2374. NB - IMPORTANT***
  2375. A new font - OCR-B font/unifont is required, and needs to be added to the config.php file
  2376. cf. http://www.gs1uk.org/downloads/bar_code/Bar coding getting it right.pdf
  2377. Barcode size must be between 0.8 and 2.0 (80% to 200%)
  2378. CMYK Colors
  2379. ===========
  2380. Functions - SetDrawColor, SetTextColor and SetFillColor all now take an optional 4th parameter.
  2381. If defined this will interpret the input as CMYK color i.e.
  2382. SetDrawColor(15,82,0,10) // NB all values out of 100 - not 255 as for RGB
  2383. htmltoolkit.php fn.ConvertColor() - now interprets custom color definition: cmyk(15,82,0,10)
  2384. like rgb(r,g,b) except values out of 100
  2385. Intended to be used for calling the functions separately - BUT works in a limited way with CSS - does not get reset or inherited correctly
  2386. <p style="color:cmyk(215,31,15,10)"> does work
  2387. DEFAULT CSS
  2388. ===========
  2389. $defaultCSS has been updated to reflect better the standard HTML default e.g. using serif, table borders separate, cell vertical-align top
  2390. To keep mPDF 1.3 (my favourites) I have introduced:
  2391. $mpdf->useDefaultCSS2 = true;
  2392. ===================================
  2393. Permissions - forms and Annotations - Experimental!
  2394. ===================================
  2395. You can set the Permissions for the PDF file to allow the user to make Comments (annotations)
  2396. $mpdf->setUserRights($enabled=true[default]|false, $annots="/Create/Delete/Modify/Copy/Import/Export",
  2397. $form="/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate", $signature="/Modify") )
  2398. If you encrypt the file, make sure the permissions match e.g.:
  2399. $mpdf->setUserRights();
  2400. $mpdf->SetProtection(array('print','annots'),'yourPassword','myPassword');
  2401. To allow this, changed the PDF-file version to %PDF1.5 (NB Probably needs PDF version > 1.5 but can't test for this...)
  2402. NOTE: If you output the PDF file straight to the browser, it will only allow annotations after you save the document
  2403. ===========================
  2404. Active Forms - Experimental!
  2405. ===========================
  2406. At present , using active forms will prevent any internal and external links - that appear before active forms(?) - from working (why?)
  2407. May need to save form for proper use - see example, when scroll forwards and back, the form disappears??
  2408. Need to set Userrights (see above), and $mpdf->useActiveForms=true;
  2409. For Output options, see separate notes.
  2410. ============================
  2411. Internal Programming changes
  2412. ============================
  2413. NB fn. tablerotate in htmltoolkit no longer used; now uses a 'transform' to shift the whole block of PDF code
  2414. Graphics State
  2415. ==============
  2416. ExtGState does not need to be redefined - e.g. if a watermark added on every page, turning on and off alpha/transparency
  2417. Unnecessary file size.
  2418. function AddExtGState() edited to check if graphics state already exists before adding new one
  2419. ASCII-proof code
  2420. ================
  2421. "»¤¬" 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
  2422. Images
  2423. ======
  2424. 1) When copying remote images locally - incorrectly used "unset" now changed to "unlink"
  2425. 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.
  2426. NB Handling images was updated in v1.3 because my ISP changed allow_url_fopen to false
  2427. 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.
  2428. 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;
  2429. Else, if CURL is available and allow_url_fopen is false: then tries using CURL.
  2430. (Clear as mud???!!)
  2431. ===========================
  2432. mPDF v1.3 (21/09/2008)
  2433. ===========================
  2434. --------------
  2435. Page Numbering
  2436. --------------
  2437. Program changes:
  2438. fn. startPageNums() replaced with blank function
  2439. fn. stopPageNums() - deleted
  2440. fn. numPageNo() - deleted (all it did was return this->page anyway).
  2441. var $_numbering - deleted
  2442. var $_numberingFooter - deleted
  2443. var $_numPageNum - deleted
  2444. NEW
  2445. New: fn. AddPages() (as for AddPage but with type=NEXT-ODD or NEXT-EVEN see below)
  2446. Edited: fn. AddPage() - new parameters added
  2447. AddPage(orientation(NO),type="E|O", resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off")
  2448. New: fn. docPageNum() - returns the document page number (or '') based on...
  2449. New : PageNumSubstitutions(array)
  2450. New attributes:
  2451. <pagebreak resetpagenum="1" // resets document page numbering to 1 from the new page onwards
  2452. <pagebreak suppress="on" // turns on suppression of page numbering i.e. in headers and footers, {PAGENO} is replaced by blank string
  2453. // ="0" turns suppression off
  2454. <pagebreak pagenumstyle="I|i|A|a|1" // (re)sets page number stle/type from the new page onwards - as for lists
  2455. // 1 - decimal; A/a - alpha (uppercase/lowercase); I/i - Roman (uppercase/lowercase)
  2456. <pagebreak type="NEXT-ODD" // always adds a page + another if required to make odd
  2457. <pagebreak type="NEXT-EVEN" // always adds a page + another if required to make even
  2458. Edited: fn. TOC() // sets the marker for a Table of Contents
  2459. New parameters allow the page-numbering details to be set
  2460. 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
  2461. new parameters as above for pagebreak resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off"
  2462. Can also be set by attribute in the <TOC>
  2463. <TOC resetpagenum="1" pagenumstyle="I|i|A|a|1", suppress="on|off" />
  2464. --------------------------------------------
  2465. Changes to allow Rotated Text in table Cells
  2466. --------------------------------------------
  2467. Edited:
  2468. fn. OpenTag()
  2469. fn. _tableColumnWidth()
  2470. fn. _tableHeight()
  2471. fn. _tableWrite()
  2472. fn. tableHeader()
  2473. New custom style or attribute -- "text-rotate" -- can be set for either <tr> or <th|td>
  2474. Allowed values: 45 - 90 (written as integers) - rotates text anticlockwise, and -90 (clockwise)
  2475. Positive values less than 90 force cell to: vertical-align:bottom
  2476. Limitations:
  2477. Only allows single line of text;
  2478. Font, font-size, and style are determined by those set fro the cell, and cannot be changed;
  2479. No changes in font (or any other in-line changes e.g. <sup>) are supported within the text
  2480. Example: <tr style="text-rotate:90">...
  2481. ---------
  2482. Bug fixes
  2483. ---------
  2484. 1) HTML footer containing table was triggering page break.
  2485. Added $this->InHTMLFooter as flag to prevent page triggering in footers containing table
  2486. Set in fn.writeHTMLFooters() -> in fn.tableWrite() stops the pageBreak being reset
  2487. 2) Crashing when libcurl not installed.
  2488. Edited OpenTag() curl_init - added if (function_exists) to exclude crash when libcurl not installed
  2489. 3) Single cell with borders not showing the borders.
  2490. e.g. <table><tr><td style="border:1px solid #000000?>Hi</td></tr></table>
  2491. Problem: mPDF overrides cell border properties with table border properties for external borders. $defaultCSS had CSS defined for table as '0px solid #000000'
  2492. 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".
  2493. 4) Empty textarea incorrectly handled (the following HTML code being output in the textarea)
  2494. The html code for an empty textarea was incorrectly handled in htmltoolkit fn. AdjustHTML which has been edited
  2495. ===========================
  2496. mPDF v1.2 (2008-05-01)
  2497. ===========================
  2498. // Added v1.2 option to continue if invalid UTF-8 chars - used in function is_utf8()
  2499. var $ignore_invalid_utf8 = false;
  2500. Reading CSS in fn. ReadCSS() and applying in fn. MergeCSS() -
  2501. Edited to allow Tags, class and id with the same name to be distinct i.e. h5 {...} .h5 {...} #h5 {...}
  2502. * mPDF 1.2 This version supports: .class {...} / #id { .... }
  2503. * ADDED p {...} h1[-h6] {...} a {...} table {...} thead {...} th {...} td {...} hr {...}
  2504. * body {...} sets default font and fontsize
  2505. * It supports some cascaded CSS e.g. div.topic table.type1 td
  2506. * Does not support non-block level e.g. a#hover { ... }
  2507. Table: font-size, weight, style, family and color should all work
  2508. TD/TH: font-size, weight, style, family and color should all work
  2509. Added to htmltoolkit - fn.array_merge_recursive_unique()
  2510. memory_opt Removed in mPDF v1.2 - not working properly
  2511. fn. _begindoc() - changed to %PDF1.4 (was 1.3) as PDF version
  2512. Write HTML Headers and Footers
  2513. ------------------------------
  2514. fn. Close() - calls writeHTMLHeaders/Footers() before finishing doc
  2515. fn. WriteHTML() - added parameter
  2516. fn. _out - writes to outputbuffer when writing HTML footers/headers
  2517. New
  2518. fn. writeHTMLHeaders()
  2519. fn. writeHTMLFooters()
  2520. =======================
  2521. mPDF v1.1 (2008-05-01)
  2522. =======================
  2523. Programming changes to increase efficiency
  2524. ------------------------------------------
  2525. fn. WriteHTML() - added lines to combine substituted characters <tta> etc
  2526. Memory Optimization added (script from FPDF site) - edited fn. _putpages() and fn. _endpage()
  2527. fn. SetFont() edited to return val quicker if font already set (increase efficiency)
  2528. new vars chrs and ords are used to store chr() and ord() - quicker than using functions
  2529. fn.setMBencoding() - only call mb_internal_encoding if need to change
  2530. Bugs
  2531. ----
  2532. fn. SetDefaultFontSize() - edited to allow to override that set in defaultCSS
  2533. fn. Output() - Added temporary(?) disablement of encryption in CJK as it doesn't work!
  2534. fn. OpenTag() [LI] $this->blockjustfinished=false to prevents newline after first bullet of list within table
  2535. Uses of mb_ereg_replace removed, and mb_split changed - requires regex_encoding (regex_encoding only used as UTF-8)
  2536. fn. WriteHTML: attributes are trimmed with trim() to allow correct handling of e.g. class="bpmBook "
  2537. fn. printbuffer() and fn. openTag() to ensure
  2538. <div><div><p> outputs top margins/padding for both 1st and 2nd div
  2539. and </p></div></div> ...
  2540. fn. SetFont() added line - bug fixing in CJK fonts
  2541. CSS functionality
  2542. -----------------
  2543. Added special CSS 'thead-underline' (similar to topntail)
  2544. var $thead_font_weight; added (openTag) to enable setting of font-weight for <TH> cells
  2545. Fixed table border inheritance: Table border inherits border="1" to cells, but not table style="border..."
  2546. "page-break-inside: avoid" added (var keep_block_together) to allow a DIV or P to be kept on one page
  2547. - not compatible with table autosize or table rotate
  2548. - only works over maximum of 2 pages
  2549. Enhancements
  2550. ------------
  2551. Orphans in line justification: R. Bracket ) added to defined list of orphans
  2552. allow_url_open
  2553. --------------
  2554. 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.
  2555. - file_get_contents() changed to use libcurl (for CSS files)
  2556. - openTag('IMG') @fopen() and 3 functions _parsegif, _parseJPG, _parsePNG, edited to copy remote image files to local file to include images
  2557. FlowChart
  2558. ---------
  2559. Changes to enable mPDF work with a custom script producing Flowcharts:
  2560. - WriteHTML() second parameter=3 will allow HTML to be parsed but not output
  2561. - fn. Arrow() added
  2562. - TableWordWrap() added parameter to force array return