mPDF uses a default “stylesheet” for default settings of style and layout; this is in config.php as a variable $defaultCSS.
mPDF ( >= 2.2) will load an optional file mpdf.css (located in the same directory as mpdf.php) which can be edited to change your default styles for PDF files.
mPDF >= 6.0 A new mpdf.css file includes defaults for Lists top/bottom margins, and also examples for Indexes and ToCs. This now acts like a normal CSS file, including cascading selectors i.e. not just main tags. This is always read (if present), so acts as a secondary default CSS, but one which allows selectors. Styles added to this act like a user stylesheet when considering precedence e.g. cellSpacing and border-spacing. (The following text describes behaviour prior to mPDF v6.0)
The file should be a valid CSS stylesheet, but will only support changing properties at element level i.e. P, DIV, TABLE, TD and not P.classname.
The mpdf.css file supplied is inactive as it has all the entries commented out by /* … */
The following values will restore behaviour of pre-4.2 versions to 4.2:
The following values will restore behaviour of 2.2 versions:
Prior to mPDF 2.2
The original default styles (mPDF <=2.0) were extensively changed with improvements in CSS handling in mPDF 2.0 (this particularly changed table borders, and table cell alignment, as well as a serif default font-family).
In order to allow backwards compatibilty, a secondary “stylesheet” - a variable $defaultCSS2 was introduced in mPDF 2.0 - and the option to load this on intiating mPDF: