Lines Matching +full:font +full:- +full:size +(+path:plugin +path:dw2pdf) -(+path:plugin +path:dw2pdf +path:lang)

57 		$this->mpdf = $mpdf;
58 $this->cache = $cache;
59 $this->sizeConverter = $sizeConverter;
61 $this->tablecascadeCSS = [];
62 $this->CSS = [];
63 $this->cascadeCSS = [];
64 $this->tbCSSlvl = 0;
65 $this->colorConverter = $colorConverter;
66 $this->remoteContentFetcher = $remoteContentFetcher;
74 if ($this->mpdf->CSSselectMedia && !preg_match('/(' . trim($this->mpdf->CSSselectMedia) . '|all)/i', $m[1][$i])) {
82 if ($this->mpdf->CSSselectMedia && !preg_match('/(' . trim($this->mpdf->CSSselectMedia) . '|all)/i', $m[1][$i])) {
88 // Remove Comment tags <!-- ... --> inside CSS as <style> in HTML document
97 $sub = preg_replace('/(<\!\-\-|\-\->)/s', ' ', $m[1][$i]);
103 $html = preg_replace('/<!--mpdf/i', '', $html);
104 $html = preg_replace('/mpdf-->/i', '', $html);
105 $html = preg_replace('/<\!\-\-.*?\-\->/s', ' ', $html);
147 if (!is_array($this->cascadeCSS)) {
148 $this->cascadeCSS = [];
157 $this->mpdf->GetFullPath($path);
159 $CSSextblock = $this->getFileContents($path);
162 // and fix url paths (including background-images) relative to stylesheet
170 $this->mpdf->GetFullPath($cxtembedded, $cssBasePath);
183 $this->mpdf->GetFullPath($embedded, $cssBasePath);
190 $match--;
206 $this->mpdf->GetFullPath($embedded);
222 if ($this->mpdf->CSSselectMedia && !preg_match('/(' . trim($this->mpdf->CSSselectMedia) . '|all)/i', $m[1][$i])) {
235 $file = $this->cache->write('_tempCSSidata' . random_int(1, 10000) . '_' . $i . '.' . $idata[2][$i], base64_decode($idata[3][$i]));
240 $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s', ' ', $CSSstr);
243 // Characters "(" ")" and ";" in url() e.g. background-image, cause problems parsing the CSS string
294 // Ignores -webkit-gradient so doesn't override -moz-
295 if ((strtoupper($property) === 'BACKGROUND-IMAGE' || strtoupper($property) === 'BACKGROUND') && false !== stripos($value, '-webkit-gradient')) {
303 $classproperties = $this->fixCSS($classproperties);
306 $pageselectors = false; // used to turn on $this->mpdf->mirrorMargins
310 if (preg_match('/NTH-CHILD\((\s*(([\-+]?\d*)N(\s*[\-+]\s*\d+)?|[\-+]?\d+|ODD|EVEN)\s*)\)/', $tg, $m)) {
311 $tg = preg_replace('/NTH-CHILD\(.*\)/', 'NTH-CHILD(' . str_replace(' ', '', $m[1]) . ')', $tg);
341 } // used to turn on $this->mpdf->mirrorMargins
348 } // used to turn on $this->mpdf->mirrorMargins
351 if (isset($this->CSS[$tag]) && $tag) {
352 $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties);
354 $this->CSS[$tag] = $classproperties;
373 } elseif (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) {
375 } elseif (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
377 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[.](.*)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
381 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\s*:NTH-CHILD\((.*)\)$/', $t, $m)) {
383 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[#](.*)$/', $t, $m)) {
385 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) {
387 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . '):LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
389 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')$/', $t)) { // mPDF 6 Special case for lang as attribute selector
393 if (isset($this->CSS[$tag]) && $tag) {
394 $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties);
396 $this->CSS[$tag] = $classproperties;
422 } elseif (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) {
424 } elseif (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
426 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[.](.*)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
430 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\s*:NTH-CHILD\((.*)\)$/', $t, $m)) {
432 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[#](.*)$/', $t, $m)) {
434 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) {
436 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . '):LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector
438 } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')$/', $t)) { // mPDF 6 Special case for lang as attribute selector
451 $x = &$this->cascadeCSS;
455 $x = $this->array_merge_recursive_unique($x, $classproperties);
461 $this->mpdf->mirrorMargins = true;
478 // Characters "(" ")" and ";" in url() e.g. background-image, cause problems parsing the CSS string
505 $size = strlen($html) - 1;
506 if (substr($html, $size, 1) !== ';') {
510 // Make CSS[Name-of-the-class] = array(key => value)
516 // Array-properties and Array-values must have the SAME SIZE!
521 // Ignores -webkit-gradient so doesn't override -moz-
522 if ((strtoupper($properties[$i]) === 'BACKGROUND-IMAGE' || strtoupper($properties[$i]) === 'BACKGROUND') && false !== stripos($values[$i], '-webkit-gradient')) {
530 return $this->fixCSS($classproperties);
553 if (in_array($prop[0], $this->mpdf->borderstyles) || $prop[0] === 'none' || $prop[0] === 'hidden') {
556 elseif (is_array($this->colorConverter->convert($prop[0], $this->mpdf->PDFAXwarnings))) {
565 if (in_array($prop[1], $this->mpdf->borderstyles) || $prop[1] === 'none' || $prop[1] === 'hidden') {
569 elseif (in_array($prop[0], $this->mpdf->borderstyles) || $prop[0] === 'none' || $prop[0] === 'hidden') {
590 elseif (in_array($prop[0], $this->mpdf->borderstyles) || $prop[0] === 'none' || $prop[0] === 'hidden') {
619 if ($k !== 'BACKGROUND-IMAGE' && $k !== 'BACKGROUND' && $k !== 'ODD-HEADER-NAME' && $k !== 'EVEN-HEADER-NAME' && $k !== 'ODD-FOOTER-NAME' && $k !== 'EVEN-FOOTER-NAME' && $k !== 'HEADER' && $k !== 'FOOTER') {
623 if ($k === 'FONT') {
646 $k = 'FONT-FAMILY';
647 $v = $bits[(count($bits) - 1)];
648 $fs = $bits[(count($bits) - 2)];
651 $newprop['FONT-SIZE'] = $fsp[1];
652 $newprop['LINE-HEIGHT'] = $fsp[2];
654 $newprop['FONT-SIZE'] = $fs;
658 $newprop['FONT-STYLE'] = 'italic';
660 $newprop['FONT-STYLE'] = 'normal';
664 $newprop['FONT-WEIGHT'] = 'bold';
666 $newprop['FONT-WEIGHT'] = 'normal';
669 if (false !== stripos($s, 'small-caps')) {
670 $newprop['TEXT-TRANSFORM'] = 'uppercase';
674 } elseif ($k === 'FONT-FAMILY') {
686 if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) {
687 $v = $this->mpdf->fonttrans[$v];
690 if ((!$this->mpdf->onlyCoreFonts && in_array($v, $this->mpdf->available_unifonts)) ||
692 ($this->mpdf->onlyCoreFonts && in_array($v, ['courier', 'times', 'helvetica', 'arial'])) ||
708 if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) {
709 $v = $this->mpdf->fonttrans[$v];
712 if (in_array($v, $this->mpdf->sans_fonts) || in_array($v, $this->mpdf->serif_fonts) || in_array($v, $this->mpdf->mono_fonts)) {
719 } elseif ($k === 'FONT-VARIANT') {
722 $newprop['FONT-VARIANT-LIGATURES'] = $m[1];
723 $newprop['FONT-VARIANT-CAPS'] = $m[1];
724 $newprop['FONT-VARIANT-NUMERIC'] = $m[1];
725 $newprop['FONT-VARIANT-ALTERNATES'] = $m[1];
727 if (preg_match_all('/(no-common-ligatures|\bcommon-ligatures|no-discretionary-ligatures|\bdiscretionary-ligatures|no-historical-ligatures|\bhistorical-ligatures|no-contextual|\bcontextual)/i', $v, $m)) {
728 $newprop['FONT-VARIANT-LIGATURES'] = implode(' ', $m[1]);
730 if (preg_match('/(all-small-caps|\bsmall-caps|all-petite-caps|\bpetite-caps|unicase|titling-caps)/i', $v, $m)) {
731 $newprop['FONT-VARIANT-CAPS'] = $m[1];
733 if (preg_match_all('/(lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions)/i', $v, $m)) {
734 $newprop['FONT-VARIANT-NUMERIC'] = implode(' ', $m[1]);
736 if (preg_match('/(historical-forms)/i', $v, $m)) {
737 $newprop['FONT-VARIANT-ALTERNATES'] = $m[1];
743 $tmp = $this->expand24($v);
745 $newprop['MARGIN-TOP'] = $tmp['T'];
746 $newprop['MARGIN-RIGHT'] = $tmp['R'];
747 $newprop['MARGIN-BOTTOM'] = $tmp['B'];
748 $newprop['MARGIN-LEFT'] = $tmp['L'];
750 } elseif ($k === 'BORDER-RADIUS' || $k === 'BORDER-TOP-LEFT-RADIUS' || $k === 'BORDER-TOP-RIGHT-RADIUS' || $k === 'BORDER-BOTTOM-LEFT-RADIUS' || $k === 'BORDER-BOTTOM-RIGHT-RADIUS') {
752 $tmp = $this->border_radius_expand($v, $k);
754 if (isset($tmp['TL-H'])) {
755 $newprop['BORDER-TOP-LEFT-RADIUS-H'] = $tmp['TL-H'];
757 if (isset($tmp['TL-V'])) {
758 $newprop['BORDER-TOP-LEFT-RADIUS-V'] = $tmp['TL-V'];
760 if (isset($tmp['TR-H'])) {
761 $newprop['BORDER-TOP-RIGHT-RADIUS-H'] = $tmp['TR-H'];
763 if (isset($tmp['TR-V'])) {
764 $newprop['BORDER-TOP-RIGHT-RADIUS-V'] = $tmp['TR-V'];
766 if (isset($tmp['BL-H'])) {
767 $newprop['BORDER-BOTTOM-LEFT-RADIUS-H'] = $tmp['BL-H'];
769 if (isset($tmp['BL-V'])) {
770 $newprop['BORDER-BOTTOM-LEFT-RADIUS-V'] = $tmp['BL-V'];
772 if (isset($tmp['BR-H'])) {
773 $newprop['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $tmp['BR-H'];
775 if (isset($tmp['BR-V'])) {
776 $newprop['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $tmp['BR-V'];
781 $tmp = $this->expand24($v);
783 $newprop['PADDING-TOP'] = $tmp['T'];
784 $newprop['PADDING-RIGHT'] = $tmp['R'];
785 $newprop['PADDING-BOTTOM'] = $tmp['B'];
786 $newprop['PADDING-LEFT'] = $tmp['L'];
793 $v = $this->_fix_borderStr($v);
796 $newprop['BORDER-TOP'] = $v;
797 $newprop['BORDER-RIGHT'] = $v;
798 $newprop['BORDER-BOTTOM'] = $v;
799 $newprop['BORDER-LEFT'] = $v;
801 } elseif ($k === 'BORDER-TOP') {
803 $newprop['BORDER-TOP'] = $this->_fix_borderStr($v);
805 } elseif ($k === 'BORDER-RIGHT') {
807 $newprop['BORDER-RIGHT'] = $this->_fix_borderStr($v);
809 } elseif ($k === 'BORDER-BOTTOM') {
811 $newprop['BORDER-BOTTOM'] = $this->_fix_borderStr($v);
813 } elseif ($k === 'BORDER-LEFT') {
815 $newprop['BORDER-LEFT'] = $this->_fix_borderStr($v);
817 } elseif ($k === 'BORDER-STYLE') {
819 $e = $this->expand24($v);
822 $newprop['BORDER-TOP-STYLE'] = $e['T'];
823 $newprop['BORDER-RIGHT-STYLE'] = $e['R'];
824 $newprop['BORDER-BOTTOM-STYLE'] = $e['B'];
825 $newprop['BORDER-LEFT-STYLE'] = $e['L'];
828 } elseif ($k === 'BORDER-WIDTH') {
830 $e = $this->expand24($v);
832 $newprop['BORDER-TOP-WIDTH'] = $e['T'];
833 $newprop['BORDER-RIGHT-WIDTH'] = $e['R'];
834 $newprop['BORDER-BOTTOM-WIDTH'] = $e['B'];
835 $newprop['BORDER-LEFT-WIDTH'] = $e['L'];
838 } elseif ($k === 'BORDER-COLOR') {
840 $e = $this->expand24($v);
842 $newprop['BORDER-TOP-COLOR'] = $e['T'];
843 $newprop['BORDER-RIGHT-COLOR'] = $e['R'];
844 $newprop['BORDER-BOTTOM-COLOR'] = $e['B'];
845 $newprop['BORDER-LEFT-COLOR'] = $e['L'];
848 } elseif ($k === 'BORDER-SPACING') {
852 $newprop['BORDER-SPACING-H'] = $prop[0];
853 $newprop['BORDER-SPACING-V'] = $prop[0];
855 $newprop['BORDER-SPACING-H'] = $prop[0];
856 $newprop['BORDER-SPACING-V'] = $prop[1];
859 } elseif ($k === 'TEXT-OUTLINE') {
864 $newprop['TEXT-OUTLINE'] = 'none';
866 $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
867 $newprop['TEXT-OUTLINE-COLOR'] = $prop[1];
869 $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
870 $newprop['TEXT-OUTLINE-COLOR'] = $prop[2];
873 } elseif ($k === 'SIZE') {
878 $newprop['SIZE'] = strtoupper($prop[0]);
880 $newprop['SIZE']['W'] = $this->sizeConverter->convert($prop[0]);
881 $newprop['SIZE']['H'] = $this->sizeConverter->convert($prop[0]);
883 $newprop['SIZE']['W'] = $this->sizeConverter->convert($prop[0]);
884 $newprop['SIZE']['H'] = $this->sizeConverter->convert($prop[1]);
887 } elseif ($k === 'SHEET-SIZE') {
893 $newprop['SHEET-SIZE'] = [$this->sizeConverter->convert($prop[0]), $this->sizeConverter->convert($prop[1])];
897 if (preg_match('/([0-9a-zA-Z]*)-L/i', $v, $m)) { // e.g. A4-L = A$ landscape
904 $newprop['SHEET-SIZE'] = [$format[0] / Mpdf::SCALE, $format[1] / Mpdf::SCALE];
911 $bg = $this->parseCSSbackground($v);
914 $newprop['BACKGROUND-COLOR'] = $bg['c'];
916 $newprop['BACKGROUND-COLOR'] = 'transparent';
920 $newprop['BACKGROUND-IMAGE'] = $bg['i'];
922 $newprop['BACKGROUND-REPEAT'] = $bg['r'];
925 $newprop['BACKGROUND-POSITION'] = $bg['p'];
928 $newprop['BACKGROUND-IMAGE'] = '';
931 } elseif ($k === 'BACKGROUND-IMAGE') {
933 if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i', $v, $m)) {
934 $newprop['BACKGROUND-IMAGE'] = $m[0];
939 $newprop['BACKGROUND-IMAGE'] = $m[1];
941 $newprop['BACKGROUND-IMAGE'] = '';
944 } elseif ($k === 'BACKGROUND-REPEAT') {
946 if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/i', $v, $m)) {
947 $newprop['BACKGROUND-REPEAT'] = strtolower($m[1]);
950 } elseif ($k === 'BACKGROUND-POSITION') {
980 if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/', $bg['p'])) {
984 $newprop['BACKGROUND-POSITION'] = $bg['p'];
987 } elseif ($k === 'IMAGE-ORIENTATION') {
989 if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i', $v, $m)) {
1007 $newprop['IMAGE-ORIENTATION'] = $angle;
1010 } elseif ($k === 'TEXT-ALIGN') {
1014 $d = array_search($m[1], $this->mpdf->decimal_align);
1017 $newprop['TEXT-ALIGN'] = $d;
1020 $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1], 0, 1));
1022 $newprop['TEXT-ALIGN'] .= 'R';
1025 } elseif (preg_match('/["\'](\\\[a-fA-F0-9]{1,6})["\']/i', $v, $m)) {
1028 $d = array_search($utf8, $this->mpdf->decimal_align);
1031 $newprop['TEXT-ALIGN'] = $d;
1035 $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1], 0, 1));
1037 $newprop['TEXT-ALIGN'] .= 'R';
1044 } elseif ($k === 'LIST-STYLE') {
1047 $newprop['LIST-STYLE-TYPE'] = 'none';
1048 $newprop['LIST-STYLE-IMAGE'] = 'none';
1051 if (preg_match('/(lower-roman|upper-roman|lower-latin|lower-alpha|upper-latin|upper-alpha|decimal|disc|circle|square|arabic-indic|bengali|devanagari|gujarati|gurmukhi|kannada|malayalam|oriya|persian|tamil|telugu|thai|urdu|cambodian|khmer|lao|cjk-decimal|hebrew)/i', $v, $m)) {
1052 $newprop['LIST-STYLE-TYPE'] = strtolower(trim($m[1]));
1053 } elseif (preg_match('/U\+([a-fA-F0-9]+)/i', $v, $m)) {
1054 $newprop['LIST-STYLE-TYPE'] = strtolower(trim($m[1]));
1058 $newprop['LIST-STYLE-IMAGE'] = strtolower(trim($m[1]));
1062 $newprop['LIST-STYLE-POSITION'] = strtolower(trim($m[1]));
1076 $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/', $v, $x); // mPDF 5.6.05
1090 $new['x'] = $this->sizeConverter->convert(trim($p[0]), $this->mpdf->blk[$this->mpdf->blklvl - 1]['inner_width'], $this->mpdf->FontSize, false);
1093 $new['y'] = $this->sizeConverter->convert(trim($p[1]), $this->mpdf->blk[$this->mpdf->blklvl - 1]['inner_width'], $this->mpdf->FontSize, false);
1096 if (preg_match('/^\s*[\.\-0-9]/', $p[2])) {
1097 $new['blur'] = $this->sizeConverter->convert(trim($p[2]), $this->mpdf->blk[$this->mpdf->blklvl - 1]['inner_width'], $this->mpdf->FontSize, false);
1099 $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[2]), $this->mpdf->PDFAXwarnings);
1102 if (preg_match('/^\s*[\.\-0-9]/', $p[3])) {
1103 $new['spread'] = $this->sizeConverter->convert(trim($p[3]), $this->mpdf->blk[$this->mpdf->blklvl - 1]['inner_width'], $this->mpdf->FontSize, false);
1105 $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[3]), $this->mpdf->PDFAXwarnings);
1108 $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[4]), $this->mpdf->PDFAXwarnings);
1113 $new['col'] = $this->colorConverter->convert('#888888', $this->mpdf->PDFAXwarnings);
1125 $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/', $v, $x); // mPDF 5.6.05
1140 $new['x'] = $this->sizeConverter->convert(trim($p[0]), $this->mpdf->FontSize, $this->mpdf->FontSize, false);
1144 $new['y'] = $this->sizeConverter->convert(trim($p[1]), $this->mpdf->FontSize, $this->mpdf->FontSize, false);
1149 if (preg_match('/^\s*[\.\-0-9]/', $p[2])) {
1151 $new['blur'] = $this->sizeConverter->convert(
1153 isset($this->mpdf->blk[$this->mpdf->blklvl]['inner_width']) ? $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'] : 0,
1154 $this->mpdf->FontSize,
1159 $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[2]), $this->mpdf->PDFAXwarnings);
1163 $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[3]), $this->mpdf->PDFAXwarnings);
1168 $new['col'] = $this->colorConverter->convert('#888888', $this->mpdf->PDFAXwarnings);
1183 /* -- BACKGROUNDS -- */
1184 if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i', $s, $m)) {
1187 if (preg_match('/url\(/i', $s)) { /* -- END BACKGROUNDS -- */
1190 if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})\s+(url\(.*)/i', $s, $m)) {
1194 /* -- BACKGROUNDS -- */
1198 if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/', $s, $m)) {
1202 $s = preg_replace('/(repeat-x|repeat-y|no-repeat|repeat|scroll|fixed|inherit)/', '', $s);
1225 if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/', $bg['p'])) {
1230 /* -- END BACKGROUNDS -- */
1231 } elseif (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})/i', $s, $m)) {
1263 /* -- BORDER-RADIUS -- */
1269 if ($k === 'BORDER-RADIUS') {
1275 $b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
1277 $b['TL-H'] = $b['BR-H'] = $prop[0];
1278 $b['TR-H'] = $b['BL-H'] = $prop[1];
1280 $b['TL-H'] = $prop[0];
1281 $b['TR-H'] = $b['BL-H'] = $prop[1];
1282 $b['BR-H'] = $prop[2];
1284 $b['TL-H'] = $prop[0];
1285 $b['TR-H'] = $prop[1];
1286 $b['BR-H'] = $prop[2];
1287 $b['BL-H'] = $prop[3];
1293 $b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
1295 $b['TL-V'] = $b['BR-V'] = $prop[0];
1296 $b['TR-V'] = $b['BL-V'] = $prop[1];
1298 $b['TL-V'] = $prop[0];
1299 $b['TR-V'] = $b['BL-V'] = $prop[1];
1300 $b['BR-V'] = $prop[2];
1302 $b['TL-V'] = $prop[0];
1303 $b['TR-V'] = $prop[1];
1304 $b['BR-V'] = $prop[2];
1305 $b['BL-V'] = $prop[3];
1308 $b['TL-V'] = Arrays::get($b, 'TL-H', 0);
1309 $b['TR-V'] = Arrays::get($b, 'TR-H', 0);
1310 $b['BL-V'] = Arrays::get($b, 'BL-H', 0);
1311 $b['BR-V'] = Arrays::get($b, 'BR-H', 0);
1331 if ($k === 'BORDER-TOP-LEFT-RADIUS') {
1332 $b['TL-H'] = $h;
1333 $b['TL-V'] = $v;
1334 } elseif ($k === 'BORDER-TOP-RIGHT-RADIUS') {
1335 $b['TR-H'] = $h;
1336 $b['TR-V'] = $v;
1337 } elseif ($k === 'BORDER-BOTTOM-LEFT-RADIUS') {
1338 $b['BL-H'] = $h;
1339 $b['BL-V'] = $v;
1340 } elseif ($k === 'BORDER-BOTTOM-RIGHT-RADIUS') {
1341 $b['BR-H'] = $h;
1342 $b['BR-V'] = $v;
1347 /* -- END BORDER-RADIUS -- */
1354 $t = $this->array_merge_recursive_unique($t, $p);
1369 if (((string) $key) === ((string) ((int) $key))) { // integer or string as integer key - append
1371 } else { // string key - merge
1373 $ret[$key] = $this->array_merge_recursive_unique($ret[$key], $value);
1387 $this->_mergeCSS($p[$tag], $t);
1392 $this->_mergeCSS($p['CLASS>>' . $class], $t);
1395 // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1401 $row = $this->mpdf->row;
1402 $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1403 $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1404 if ($this->mpdf->tabletfoot) {
1405 $row -= $thnr;
1406 } elseif (!$this->mpdf->tablethead) {
1407 $row -= ($thnr + $tfnr);
1409 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1410 $select = $this->_nthchild($a, $row);
1413 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1414 $select = $this->_nthchild($a, $this->mpdf->col);
1418 $this->_mergeCSS($p[$tag . '>>SELECTORNTHCHILD>>' . $m[1]], $t);
1425 $this->_mergeCSS($p['LANG>>' . $lang], $t);
1429 $this->_mergeCSS($p['ID>>' . $id], $t);
1435 $this->_mergeCSS($p[$tag . '>>CLASS>>' . $class], $t);
1440 $this->_mergeCSS($p[$tag . '>>LANG>>' . $lang], $t);
1444 $this->_mergeCSS($p[$tag . '>>ID>>' . $id], $t);
1450 if (!empty($prop['BORDER-LEFT'])) {
1451 $this->cell_border_dominance_L = $val;
1453 if (!empty($prop['BORDER-RIGHT'])) {
1454 $this->cell_border_dominance_R = $val;
1456 if (!empty($prop['BORDER-TOP'])) {
1457 $this->cell_border_dominance_T = $val;
1459 if (!empty($prop['BORDER-BOTTOM'])) {
1460 $this->cell_border_dominance_B = $val;
1469 $this->setBorderDominance($m, $bd);
1473 $this->_mergeBorders($p, $m);
1481 // Merges $a['BORDER-TOP-STYLE'] to $b['BORDER-TOP'] etc.
1484 if (isset($a['BORDER-' . $side . '-' . $el])) { // e.g. $b['BORDER-TOP-STYLE']
1485 $s = trim($a['BORDER-' . $side . '-' . $el]);
1486 if (isset($b['BORDER-' . $side])) { // e.g. $b['BORDER-TOP']
1487 $p = trim($b['BORDER-' . $side]);
1493 $b['BORDER-' . $side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 ' . $s . ' \\3', $p);
1495 $b['BORDER-' . $side] = '0px ' . $s . ' #000000';
1499 $b['BORDER-' . $side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', $s . ' \\2 \\3', $p);
1501 $b['BORDER-' . $side] = $s . ' none #000000';
1505 $b['BORDER-' . $side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 \\2 ' . $s, $p);
1507 $b['BORDER-' . $side] = '0px none ' . $s;
1541 /* -- TABLES -- */
1547 if (isset($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'])) {
1548 $this->tablecascadeCSS[0] = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1550 $this->tablecascadeCSS[0] = $this->cascadeCSS;
1558 if (isset($this->tablecascadeCSS[$this->tbCSSlvl - 1]) && is_array($this->tablecascadeCSS[$this->tbCSSlvl - 1])) {
1559 foreach ($this->tablecascadeCSS[$this->tbCSSlvl - 1] as $k => $v) {
1560 $this->tablecascadeCSS[$this->tbCSSlvl][$k] = $v;
1564 $this->_mergeFullCSS(
1565 $this->cascadeCSS,
1566 $this->tablecascadeCSS[$this->tbCSSlvl],
1573 // Cascading forward CSS e.g. "table.topic td" for this table in $this->tablecascadeCSS
1575 if (isset($this->tablecascadeCSS[$this->tbCSSlvl - 1])) {
1576 $this->_mergeFullCSS(
1577 $this->tablecascadeCSS[$this->tbCSSlvl - 1],
1578 $this->tablecascadeCSS[$this->tbCSSlvl],
1587 /* -- END TABLES -- */
1592 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS']) && is_array($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'])) {
1593 foreach ($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'] as $k => $v) {
1594 $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$k] = $v;
1600 $this->_mergeFullCSS($this->cascadeCSS, $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID'], $attr['LANG']);
1604 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1])) {
1605 $this->_mergeFullCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'], $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID'], $attr['LANG']);
1609 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['margin_collapse']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['margin_collapse']) {
1610 $p['MARGIN-COLLAPSE'] = 'COLLAPSE';
1611 } // custom tag, but follows CSS principle that border-collapse is inherited
1612 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['line_height']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_height']) {
1613 $p['LINE-HEIGHT'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_height'];
1616 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_strategy']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_strategy']) {
1617 $p['LINE-STACKING-STRATEGY'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_strategy'];
1619 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_shift']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_shift']) {
1620 $p['LINE-STACKING-SHIFT'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['line_stacking_shift'];
1623 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['direction']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['direction']) {
1624 $p['DIRECTION'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['direction'];
1628 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_type']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_type']) {
1629 $p['LIST-STYLE-TYPE'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_type'];
1632 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_image']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_image']) {
1633 $p['LIST-STYLE-IMAGE'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_image'];
1635 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_position']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_position']) {
1636 $p['LIST-STYLE-POSITION'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['list_style_position'];
1639 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['align']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['align']) {
1640 if ($this->mpdf->blk[$this->mpdf->blklvl - 1]['align'] === 'L') {
1641 $p['TEXT-ALIGN'] = 'left';
1642 } elseif ($this->mpdf->blk[$this->mpdf->blklvl - 1]['align'] === 'J') {
1643 $p['TEXT-ALIGN'] = 'justify';
1644 } elseif ($this->mpdf->blk[$this->mpdf->blklvl - 1]['align'] === 'R') {
1645 $p['TEXT-ALIGN'] = 'right';
1646 } elseif ($this->mpdf->blk[$this->mpdf->blklvl - 1]['align'] === 'C') {
1647 $p['TEXT-ALIGN'] = 'center';
1650 if ($this->mpdf->ColActive || $this->mpdf->keep_block_together) {
1651 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['bgcolor']) && $this->mpdf->blk[$this->mpdf->blklvl - 1]['bgcolor']) { // Doesn't officially inherit, but default value is transparent (?=inherited)
1652 $cor = $this->mpdf->blk[$this->mpdf->blklvl - 1]['bgcolorarray'];
1653 $p['BACKGROUND-COLOR'] = $this->colorConverter->colAtoString($cor);
1657 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['text_indent']) && ($this->mpdf->blk[$this->mpdf->blklvl - 1]['text_indent'] || $this->mpdf->blk[$this->mpdf->blklvl - 1]['text_indent'] === 0)) {
1658 $p['TEXT-INDENT'] = $this->mpdf->blk[$this->mpdf->blklvl - 1]['text_indent'];
1660 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1]['InlineProperties'])) {
1661 $biilp = $this->mpdf->blk[$this->mpdf->blklvl - 1]['InlineProperties'];
1662 $this->inlinePropsToCSS($biilp, $p); // mPDF 5.7.1
1690 if ($tag === 'FONT') {
1692 $p['FONT-FAMILY'] = $attr['FACE'];
1694 if (isset($attr['SIZE']) && $attr['SIZE'] != '') {
1696 if ($attr['SIZE'] === '+1') {
1698 } elseif ($attr['SIZE'] === '-1') {
1700 } elseif ($attr['SIZE'] === '1') {
1701 $s = 'XX-SMALL';
1702 } elseif ($attr['SIZE'] == '2') {
1703 $s = 'X-SMALL';
1704 } elseif ($attr['SIZE'] == '3') {
1706 } elseif ($attr['SIZE'] == '4') {
1708 } elseif ($attr['SIZE'] == '5') {
1710 } elseif ($attr['SIZE'] == '6') {
1711 $s = 'X-LARGE';
1712 } elseif ($attr['SIZE'] == '7') {
1713 $s = 'XX-LARGE';
1716 $p['FONT-SIZE'] = $s;
1721 $p['VERTICAL-ALIGN'] = $attr['VALIGN'];
1724 $p['MARGIN-TOP'] = $attr['VSPACE'];
1725 $p['MARGIN-BOTTOM'] = $attr['VSPACE'];
1728 $p['MARGIN-LEFT'] = $attr['HSPACE'];
1729 $p['MARGIN-RIGHT'] = $attr['HSPACE'];
1734 if (isset($this->mpdf->defaultCSS[$tag])) {
1735 $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
1738 $this->_mergeBorders($p, $zp);
1742 /* -- TABLES -- */
1746 $p['BORDER-SPACING-H'] = $p['BORDER-SPACING-V'] = $attr['CELLSPACING'];
1749 if (($tag === 'TD' || $tag === 'TH') && isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding']) && ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'] || $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'] === '0')) { // mPDF 5.7.3
1750 $p['PADDING-LEFT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1751 $p['PADDING-RIGHT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1752 $p['PADDING-TOP'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1753 $p['PADDING-BOTTOM'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1755 /* -- END TABLES -- */
1758 if (isset($this->CSS[$tag]) && $this->CSS[$tag]) {
1759 $zp = $this->CSS[$tag];
1761 $this->setBorderDominance($zp, 9);
1762 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1765 $this->_mergeBorders($p, $zp);
1772 if (isset($this->CSS['CLASS>>' . $class]) && $this->CSS['CLASS>>' . $class]) {
1773 $zp = $this->CSS['CLASS>>' . $class];
1776 $this->setBorderDominance($zp, 9);
1777 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1780 $this->_mergeBorders($p, $zp);
1784 /* -- TABLES -- */
1785 // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1787 foreach ($this->CSS as $k => $val) {
1791 $row = $this->mpdf->row;
1792 $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1793 $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1794 if ($this->mpdf->tabletfoot) {
1795 $row -= $thnr;
1796 } elseif (!$this->mpdf->tablethead) {
1797 $row -= ($thnr + $tfnr);
1799 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1800 $select = $this->_nthchild($a, $row);
1803 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1804 $select = $this->_nthchild($a, $this->mpdf->col);
1808 $zp = $this->CSS[$tag . '>>SELECTORNTHCHILD>>' . $m[1]];
1810 $this->setBorderDominance($zp, 9);
1814 $this->_mergeBorders($p, $zp);
1820 /* -- END TABLES -- */
1824 if (isset($this->CSS['LANG>>' . $attr['LANG']]) && $this->CSS['LANG>>' . $attr['LANG']]) {
1825 $zp = $this->CSS['LANG>>' . $attr['LANG']];
1827 $this->setBorderDominance($zp, 9);
1828 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1831 $this->_mergeBorders($p, $zp);
1833 } elseif (isset($this->CSS['LANG>>' . $shortlang]) && $this->CSS['LANG>>' . $shortlang]) {
1834 $zp = $this->CSS['LANG>>' . $shortlang];
1836 $this->setBorderDominance($zp, 9);
1837 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1840 $this->_mergeBorders($p, $zp);
1846 if (isset($attr['ID']) && isset($this->CSS['ID>>' . $attr['ID']]) && $this->CSS['ID>>' . $attr['ID']]) {
1847 $zp = $this->CSS['ID>>' . $attr['ID']];
1849 $this->setBorderDominance($zp, 9);
1850 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1853 $this->_mergeBorders($p, $zp);
1861 if (isset($this->CSS[$tag . '>>CLASS>>' . $class]) && $this->CSS[$tag . '>>CLASS>>' . $class]) {
1862 $zp = $this->CSS[$tag . '>>CLASS>>' . $class];
1865 $this->setBorderDominance($zp, 9);
1866 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1869 $this->_mergeBorders($p, $zp);
1875 if (isset($this->CSS[$tag . '>>LANG>>' . $attr['LANG']]) && $this->CSS[$tag . '>>LANG>>' . $attr['LANG']]) {
1876 $zp = $this->CSS[$tag . '>>LANG>>' . $attr['LANG']];
1878 $this->setBorderDominance($zp, 9);
1879 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1882 $this->_mergeBorders($p, $zp);
1884 } elseif (isset($this->CSS[$tag . '>>LANG>>' . $shortlang]) && $this->CSS[$tag . '>>LANG>>' . $shortlang]) {
1885 $zp = $this->CSS[$tag . '>>LANG>>' . $shortlang];
1887 $this->setBorderDominance($zp, 9);
1888 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1891 $this->_mergeBorders($p, $zp);
1897 if (isset($attr['ID']) && isset($this->CSS[$tag . '>>ID>>' . $attr['ID']]) && $this->CSS[$tag . '>>ID>>' . $attr['ID']]) {
1898 $zp = $this->CSS[$tag . '>>ID>>' . $attr['ID']];
1900 $this->setBorderDominance($zp, 9);
1901 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1904 $this->_mergeBorders($p, $zp);
1910 if (isset($this->mpdf->blk[$this->mpdf->blklvl - 1])) { // mPDF 6
1911 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'][$tag], $p);
1913 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS']['CLASS>>' . $class], $p);
1915 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS']['ID>>' . $attr['ID']], $p);
1917 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'][$tag . '>>CLASS>>' . $class], $p);
1919 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl - 1]['cascadeCSS'][$tag . '>>ID>>' . $attr['ID']], $p);
1922 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag], $p);
1924 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['CLASS>>' . $class], $p);
1926 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['ID>>' . $attr['ID']], $p);
1928 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag . '>>CLASS>>' . $class], $p);
1930 $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag . '>>ID>>' . $attr['ID']], $p);
1931 } elseif ($inherit === 'TOPTABLE' || $inherit === 'TABLE') { // NB looks at $this->tablecascadeCSS-1 for cascading CSS
1932 if (isset($this->tablecascadeCSS[$this->tbCSSlvl - 1])) { // mPDF 6
1934 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1][$tag], $p, false, 9);
1936 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1]['CLASS>>' . $class], $p, false, 9);
1938 // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1940 foreach ($this->tablecascadeCSS[$this->tbCSSlvl - 1] as $k => $val) {
1944 $row = $this->mpdf->row;
1945 $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1946 $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1947 if ($this->mpdf->tabletfoot) {
1948 $row -= $thnr;
1949 } elseif (!$this->mpdf->tablethead) {
1950 $row -= ($thnr + $tfnr);
1952 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1953 $select = $this->_nthchild($a, $row);
1956 if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/', $m[1], $a)) { // mPDF 5.7.4
1957 $select = $this->_nthchild($a, $this->mpdf->col);
1961 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1][$tag . '>>SELECTORNTHCHILD>>' . $m[1]], $p, false, 9);
1967 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1]['ID>>' . $attr['ID']], $p, false, 9);
1969 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1][$tag . '>>CLASS>>' . $class], $p, false, 9);
1971 $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl - 1][$tag . '>>ID>>' . $attr['ID']], $p, false, 9);
1976 $zp = $this->readInlineCSS($attr['STYLE']);
1978 $this->setBorderDominance($zp, 9);
1979 } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1982 $this->_mergeBorders($p, $zp);
1993 $p['FONT-FAMILY'] = $bilp['family'];
1996 $p['FONT-STYLE'] = 'italic';
1999 $p['FONT-SIZE'] = $bilp['sizePt'] . 'pt';
2002 $p['FONT-WEIGHT'] = 'bold';
2006 $p['COLOR'] = $this->colorConverter->colAtoString($cor);
2009 $p['LETTER-SPACING'] = $bilp['lSpacingCSS'];
2012 $p['WORD-SPACING'] = $bilp['wSpacingCSS'];
2027 if (isset($bilp['textparam']['outline-s']) && !$bilp['textparam']['outline-s']) {
2028 $p['TEXT-OUTLINE'] = 'none';
2030 if (isset($bilp['textparam']['outline-COLOR']) && $bilp['textparam']['outline-COLOR']) {
2031 $p['TEXT-OUTLINE-COLOR'] = $this->colorConverter->colAtoString($bilp['textparam']['outline-COLOR']);
2033 if (isset($bilp['textparam']['outline-WIDTH']) && $bilp['textparam']['outline-WIDTH']) {
2034 $p['TEXT-OUTLINE-WIDTH'] = $bilp['textparam']['outline-WIDTH'] . 'mm';
2039 // CSS says text-decoration is not inherited, but IE7 does??
2042 $p['TEXT-DECORATION'] = 'underline line-through';
2044 $p['TEXT-DECORATION'] = 'line-through';
2047 $p['TEXT-DECORATION'] = 'underline';
2049 $p['TEXT-DECORATION'] = 'none';
2053 $p['VERTICAL-ALIGN'] = 'super';
2055 $p['VERTICAL-ALIGN'] = 'sub';
2057 $p['VERTICAL-ALIGN'] = 'baseline';
2061 $p['TEXT-TRANSFORM'] = 'capitalize';
2063 $p['TEXT-TRANSFORM'] = 'uppercase';
2065 $p['TEXT-TRANSFORM'] = 'lowercase';
2067 $p['TEXT-TRANSFORM'] = 'none';
2071 $p['FONT-KERNING'] = 'normal';
2075 $p['FONT-KERNING'] = 'none';
2079 $p['FONT-VARIANT-POSITION'] = 'super';
2082 $p['FONT-VARIANT-POSITION'] = 'sub';
2084 $p['FONT-VARIANT-POSITION'] = 'normal';
2088 $p['FONT-VARIANT-CAPS'] = 'small-caps';
2093 $p['FONT-LANGUAGE-OVERRIDE'] = $bilp['fontLanguageOverride'];
2095 $p['FONT-LANGUAGE-OVERRIDE'] = 'normal';
2098 // All the variations of font-variant-* we are going to set as font-feature-settings...
2129 $p['FONT-FEATURE-SETTINGS'] = implode(', ', $ffs);
2138 $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
2147 if (isset($this->mpdf->defaultCSS[$tag])) {
2148 $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
2154 if (isset($this->CSS[$tag])) {
2155 $zp = $this->CSS[$tag];
2163 if (isset($this->CSS['CLASS>>' . $class])) {
2164 $zp = $this->CSS['CLASS>>' . $class];
2171 if (isset($attr['ID']) && isset($this->CSS['ID>>' . $attr['ID']])) {
2172 $zp = $this->CSS['ID>>' . $attr['ID']];
2180 if (isset($this->CSS[$tag . '>>CLASS>>' . $class])) {
2181 $zp = $this->CSS[$tag . '>>CLASS>>' . $class];
2188 if (isset($attr['ID']) && isset($this->CSS[$tag . '>>ID>>' . $attr['ID']])) {
2189 $zp = $this->CSS[$tag . '>>ID>>' . $attr['ID']];
2197 $this->_set_mergedCSS($oldcascadeCSS[$tag], $p);
2200 $this->_set_mergedCSS($oldcascadeCSS['CLASS>>' . $class], $p);
2204 $this->_set_mergedCSS($oldcascadeCSS['ID>>' . $attr['ID']], $p);
2208 $this->_set_mergedCSS($oldcascadeCSS[$tag . '>>CLASS>>' . $class], $p);
2212 $this->_set_mergedCSS($oldcascadeCSS[$tag . '>>ID>>' . $attr['ID']], $p);
2217 $zp = $this->readInlineCSS($attr['STYLE']);
2226 // mPDF 5.7.4 nth-child
2248 } elseif ($f[2] == '-') {
2249 $a = -1;
2257 } elseif ($f[2] == '-') {
2258 $a = -1;
2267 if (((($c % $a) - $b) % $a) === 0 && $c >= $b) {
2275 if (((($c % $a) - $b) % $a) === 0 && $c <= $b) {
2285 $wrapperChecker = new StreamWrapperChecker($this->mpdf);
2286 if ($wrapperChecker->hasBlacklistedStreamWrapper($path)) {
2287 throw new \Mpdf\MpdfException('File contains an invalid stream. Only ' . implode(', ', $wrapperChecker->getWhitelistedStreamWrappers()) . ' streams are allowed.');
2301 if ($this->mpdf->basepathIsLocal) {
2324 $contents = $this->remoteContentFetcher->getFileContentsByCurl($path);