^5.6 || ~7.0.0
is required, ~7.1.0
should be compatible.Mpdf
namespace
PascalCase
and named to be more verbosePSR-4
__construct
parameter (see below)\Mpdf\Mpdf
constructor signature
$config
parameterconfig.php
and config_fonts.php
propertieserror_reporting
changescompress.php
utility_MPDF_PATH
and _MPDF_URI
constants_MPDF_TEMP_PATH
constant in favor of tempDir
configuration variable_MPDF_TTFONTDATAPATH
in favor of tempDir
configuration variable_MPDFK
constant in favor of \Mpdf\Mpdf::SCALE
class constantscriptToLang
and langToFont
in separate static class methodsFONT_DESCRIPTOR
constant in favor of fontDescriptor
configuration variable_MPDF_SYSTEM_TTFONTS
constant in favor of fontDir
configuration variable with multiple pathsmbstring.func_overload
is setGF_
constants in separate \Mpdf\Fonts\GlyphOperator
classunicode_hex
functionCache
and FontCache
classes)Psr\Log\LoggerAware
interface
\Mpdf\Log\Context
class constantsFontFileFinder
class allowing to specify multiple paths to search for fontsMpdfException
now extends ErrorException
to allow specifying place in code where error occured\Mpdf\Output\Destination
class with verbose output destination constantsMpdf\Color\ColorConvertor
Mpdf\SizeConvertor
Mpdf\Hyphenator
ttfontdata
, tmp
, graph_cache
after composer installmPDF::Error
and die()
calls to throwing MpdfException
LEDGER
and TABLOID
paper sizesConvertColor
.Tag
class$mpdf->WriteHTML()
to see if it is an integer, float, string, boolean or
a class with __toString()
and cast to a string, otherwise throw exception.D
and I
output modes (issue #105, f297546
)Support for OpenTypeLayout tables / features for complex scripts and Advances Typography.
Improved bidirectional text handling.
Improved line-breaking, including for complex scripts e.g. Lao, Thai and Khmer.
Updated page-breaking options.
Automatic language mark-up and font selection using autoScriptToLang and autoLangToFont.
Kashida for text-justification in arabic scripts.
Index collation for non-ASCII characters.
Index mark-up allowing control over layout using CSS.
{PAGENO} and {nbpg} can use any of the number types as in list-style e.g. set in <pagebreak>
using pagenumstyle.
CSS support for lists.
Default stylesheet - mpdf.css - updated.
<img>
only)<bdi>
tag)<image xlink:href="image.png" width="100px" height="100px" />
<tspan>
element e.g. <tspan x,y,dx,dy,text-anchor >
, and also <tref>
classes/svg.php
file)classes/svg.php
file)<text>
element<use>
or <defs>
e.g. <use x = "0" y = "0" xlink:href = "#s3" />
<
sign, it will break the text - now processed as <
(despite the fact that this does not conform to XML spec)<A>
elements - [changed MergeCSS() type to INLINE for 'A', LEGEND, METER and PROGRESS]Tables - if using packTableData, and borders-collapse, wider border is overwriting content of adjacent cell Test case:
<table style="border-collapse: collapse;">
<tr><td style="border-bottom: 42px solid #0FF; "> Hallo world </td></tr>
<tr><td style="border-top: 14px solid #0F0; "> Hallo world </td></tr>
</table>
Images - image height is reset proportional to original if width is set to maximum e.g. <img width="100%" height="20mm">
URL handling changed to work with special characters in path fragments; affects <a>
links, <img>
images and
CSS url() e.g background-image
../
included as a query valueBarcodes with bottom numerals e.g. EAN-13 - incorrect numeral size when using core fonts
NB Spec. for embedded SVG images: as per http://www.w3.org/TR/2003/REC-SVG11-20030114/struct.html#ImageElement Attributes supported:
Note: all attribute names and values are case-sensitive width and height cannot be assigned by CSS - must be attributes
<span>
elements<sup>text<sup>13</sup>text</sup>
text<TABLE>
overrides border set as CSS on <TD>
<main>
added as recognised tag<img>
element (only)
All transform functions are supported except matrix() i.e. translate(), translateX(), translateY(), skew(), skewX(), skewY(),
scale(), scaleX(), scaleY(), rotate()
NB When using Columns or Keep-with-table (use_kwt), cannot use transform<img>
element<tfoot>
not printing at all (since v5.7)<watermarkimage>
position attribute not working<
(less-than sign) inside a PRE element, and NOT start of a valid tag, was incorrectly removed<defs>
being displayed<use>
and <defs>
1) FILES: mpdf.php
Bug fix; Dollar sign enclosed by <pre>
tag causing error.
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>
2) FILES: includes/functions.php AND mpdf.php
Changes to preg_replace
with /e
modifier to use preg_replace_callback
(/e depracated from PHP 5.5)
3) FILES: classes/barcode.php
Small change to function barcode_c128()
which allows ASCII 0 - 31 to be used in C128A e.g. chr(13) in:
<barcode code="5432
1068" type="C128A" />
4) FILES: mpdf.php
Using $use_kwt ("keep-[heading]-with-table") if <h4></h4>
before table is on 2 lines and pagebreak occurs after first line
the first line is displayed at the bottom of the 2nd page.
Edited so that $use_kwt only works if the HEADING is only one line. Else ignores (but prints correctly)
5) FILES: mpdf.php
Clearing old temporary files from _MPDF_TEMP_PATH
will now ignore "hidden" files e.g. starting with a ".
" .htaccess
, .gitignore
etc.
and also leave dummy.txt
alone
Removed:
Changes in mPDF 5.7 may cause some changes to the way your documents appear. There are two main differences: 1) Hyphenation. To retain appearance compatible with earlier versions, set the CSS property "hyphens: auto" whenever
you previously used $mpdf->hyphenate=true;
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:
- No indent (previous default of 5mm) - ($tocindent is ignored)
- Any font, font-size set ($tocfont or $tocfontsize) will not work
- HyperLinks will appear with your default appearance - usually blue and underlined
- line spacing will be narrower (can use line-height or margin-top in CSS)
<dottab>
enhanced by custom CSS "outdent" property<img>
added: max-height, max-width, min-height and min-width<ol>
e.g. <ol start="5">
<base href="">
in HTML - uses it to SetBasePath for relative URLs.<wbr>
or <wbr />
- converted to a soft-hyphen<table bgcolor="black" style="background-color:yellow">
<img>
<span>
The HTML elements <dottab>
and <textcircle>
can now have CSS properties applied to them.
<tfoot>
placed after <tbody>
and table spans page<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<tocpagebreak>
toc-preHTML and toc-postHTML can now contain quotesCSS support added for for min-height, min-width, max-height and max-width in <img>
Images embedded in CSS
<img src="data:image/gif;base64,....">
improved to make it more robust, and background: url(data:image...
now added to workHTML5 tags supported
<article><aside><details><figure><figcaption><footer><header><hgroup><nav><section><summary>
<mark><time><meter><progress>
<mark>
has a default CSS set in config.php to yellow highlight<meter>
and <progress>
support attributes as for HTML5<meter>
and <progress>
can be made by editing classes/meter.php
file<meter>
and <progress>
suppress text inside the tagsTextcircle/Circular
<textcircle>
: does not inherit CSS styles<textcircle r="30mm" top-text="Text Circular Text Circular" bottom-text="Text Circular Text Circular"
divider=" • " style="font-size: auto" />
» ’ ‚ „ are now included in "orphan"-management at the end of lines
Improved CJK line wrapping (if CJK character at end of line, breaks there rather than previous wordspace)
NB mPDF 5.5 added support for <fieldset>
and <legend>
(omitted from ChangeLog)
<textCircle>
background white even when set to none/transparent<style>
within HTML page crashed if CSS is too large (? > 32Kb)classes/ttfontsuni_analysis.php
To avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>
)
$this->margBuffer = 0; // Allow an (empty) end of block to extend beyond the bottom margin by this amount (mm)
Added to (arabic) fonts to allow "use non-mapped Arabic Glyphs" e.g. for Pashto
'unAGlyphs' => true,
Arabic text (RTL) rewritten with improved support for Pashto/Sindhi/Urdu/Kurdish
Presentation forms added:
U+0649, U+0681, U+0682, U+0685, U+069A-U+069E, U+06A0, U+06A2, U+06A3, U+06A5, U+06AB-U+06AE,
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
Joining improved:
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,
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
Note - Some characters in Pashto/Sindhi/Urdu/Kurdish do not have Unicode values for the final/initial/medial forms of the characters. However, some fonts include these characters "un-mapped" to Unicode (including XB Zar and XB Riyaz, which are bundled with mPDF).
`'unAGlyphs' => true`, added to the config_fonts.php file for appropriate fonts will
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:
e.g. XB Riyaz, XB Zar, Arabic Typesetting (MS), Arial (MS)
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" - if it exists, it may work! Using "unAGlyphs" forces subsetting of fonts, and will not work with SIP/SMP fonts (using characters beyond the Unicode BMP Plane).
mPDF maps these characters to part of the Private Use Area allocated by Unicode U+F500-F7FF. This could interfere with correct use if the font already utilises these codes (unlikely).
mPDF now deletes U+200C,U+200D,U+200E,U+200F zero-widthjoiner/non-joiner, LTR and RTL marks so they will not appear even though some fonts contain glyphs for these characters.
Avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>
)
using configurable variable: $this->margBuffer
;
The TTFontsUni class contained a long function (extractcoreinfo) which is not used routinely in mPDF
This has been moved to a new file: classes/ttfontsuni_analysis.php.
The 3 utility scripts have been updated to use the new extended class:
</div></div>
) incorrectly being moved to next page because incorrectly
calculating how much space required<text>
elements gives progressively smaller text<b><b>bold</b></b>
still bold<htmlpageheader>
do not decode correctlyOlder changes can be seen on the documentation site.