Lines Matching +defs:h +defs:a

597 	var $keep_block_together; // Keep a Block from page-break-inside: avoid
764 var $h; // current dimensions of page in user unit
1383 // Autodetect if mode is a language_country string (en-GB or en_GB or en)
1641 if (preg_match('/([0-9a-zA-Z]*)-([P,L])/i', $format, $m)) {
1683 $this->h = $this->hPt / Mpdf::SCALE;
1730 $this->PageBreakTrigger = $this->h - $this->bMargin;
1771 $this->PageBreakTrigger = $this->h - $margin;
1884 // Define an alias for total number of pages in a group
1902 $a = ['BM' => '/' . $bm];
1904 $a['ca'] = $alpha; // mPDF 5.7.2
1907 $a['CA'] = $alpha; // mPDF 5.7.2
1909 $gs = $this->AddExtGState($a);
2055 // pba is background positioning area (from CSS background-origin) may not always be set [x,y,w,h]
2058 // $h - absolute length or % or auto or cover | contain
2062 if (isset($pba['h'])) {
2063 $ch = $pba['h'];
2077 $h = $imh * $cw / $imw;
2079 if ($h > $ch) {
2080 $w = $w * $ch / $h;
2081 $h = $ch;
2086 $h = $imh * $cw / $imw;
2088 if ($h < $ch) {
2089 $w = $w * $h / $ch;
2090 $h = $ch;
2098 if (stristr($size['h'], '%')) {
2099 $size['h'] = (float) $size['h'];
2100 $size['h'] /= 100;
2101 $size['h'] = ($ch * $size['h']);
2103 if ($size['w'] == 'auto' && $size['h'] == 'auto') {
2105 $h = $imh;
2106 } elseif ($size['w'] == 'auto' && $size['h'] != 'auto') {
2107 $w = $imw * $size['h'] / $imh;
2108 $h = $size['h'];
2109 } elseif ($size['w'] != 'auto' && $size['h'] == 'auto') {
2110 $h = $imh * $size['w'] / $imw;
2114 $h = $size['h'];
2117 return [$w, $h, $repx, $repy];
2119 $h = $imh * $cw / $imw;
2120 return [$cw, $h, $repx, $repy];
2126 $h = $imh;
2128 $h = $h * $cw / $w;
2131 if ($h > $ch) {
2132 $w = $w * $ch / $h;
2133 $h = $ch;
2135 return [$w, $h, $repx, $repy];
2137 $h = $imh * $cw / $imw;
2138 return [$cw, $h, $repx, $repy];
2177 $size = ['w' => $bsw, 'h' => $bsh];
2249 $clh = $this->h;
2255 $clh = $this->h - 2 * $cly;
2286 $this->patterns[$n] = ['x' => $clx, 'y' => $cly, 'w' => $clw, 'h' => $clh, 'pgh' => $this->h, 'image_id' => $this->bodyBackgroundImage['image_id'], 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $this->bodyBackgroundImage['x_pos'], 'y_pos' => $this->bodyBackgroundImage['y_pos'], 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'itype' => $this->bodyBackgroundImage['itype']];
2302 $s .= sprintf('%.3F %.3F m ', ($clx) * Mpdf::SCALE, ($this->h - ($cly)) * Mpdf::SCALE); // start point TL before the arc
2303 $s .= sprintf('%.3F %.3F l ', ($clx) * Mpdf::SCALE, ($this->h - ($cly + $clh)) * Mpdf::SCALE); // line to BL
2304 $s .= sprintf('%.3F %.3F l ', ($clx + $clw) * Mpdf::SCALE, ($this->h - ($cly + $clh)) * Mpdf::SCALE); // line to BR
2305 $s .= sprintf('%.3F %.3F l ', ($clx + $clw) * Mpdf::SCALE, ($this->h - ($cly)) * Mpdf::SCALE); // line to TR
2306 $s .= sprintf('%.3F %.3F l ', ($clx) * Mpdf::SCALE, ($this->h - ($cly)) * Mpdf::SCALE); // line to TL
2355 $s .= sprintf('%.3F %.3F %.3F %.3F re f Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE) . "\n";
2400 $s .= $this->gradient->Gradient($pb['x'], $pb['y'], $pb['w'], $pb['h'], $pb['gradtype'], $pb['stops'], $pb['colorspace'], $pb['coords'], $pb['extend'], true);
2409 $pb['h'] += $adjustmenty;
2412 list($orig_w, $orig_h, $x_repeat, $y_repeat) = $this->_resizeBackgroundImage($pb['orig_w'], $pb['orig_h'], $pb['w'], $pb['h'], $pb['resize'], $pb['x_repeat'], $pb['y_repeat'], $pb['bpa'], $pb['size']);
2414 $this->patterns[$n] = ['x' => $pb['x'], 'y' => $pb['y'], 'w' => $pb['w'], 'h' => $pb['h'], 'pgh' => $this->h, 'image_id' => $pb['image_id'], 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $pb['x_pos'], 'y_pos' => $pb['y_pos'], 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'itype' => $pb['itype'], 'bpa' => $pb['bpa']];
2417 $y = ($this->h - $pb['y']) * Mpdf::SCALE;
2419 $h = -$pb['h'] * Mpdf::SCALE;
2425 if ($this->writingHTMLfooter || $this->writingHTMLheader) { // Write each (tiles) image rather than use as a pattern
2431 $h = $pb['h'];
2437 $h = $pb['bpa']['h'];
2451 if ($ih > $pb['bpa']['h']) {
2452 $iw = $iw * $pb['bpa']['h'] / $ih;
2453 $ih = $pb['bpa']['h'];
2460 if ($ih < $pb['bpa']['h']) {
2461 $iw = $iw * $ih / $pb['bpa']['h'];
2462 $ih = $pb['bpa']['h'];
2472 if (NumericString::containsPercentChar($size['h'])) {
2473 $size['h'] = NumericString::removePercentChar($size['h']);
2474 $size['h'] /= 100;
2475 $size['h'] = ($pb['bpa']['h'] * $size['h']);
2478 if ($size['w'] == 'auto' && $size['h'] == 'auto') {
2481 } elseif ($size['w'] == 'auto' && $size['h'] != 'auto') {
2482 $iw = $iw * $size['h'] / $ih;
2483 $ih = $size['h'];
2484 } elseif ($size['w'] != 'auto' && $size['h'] == 'auto') {
2489 $ih = $size['h'];
2502 $ny = ceil($pb['h'] / $ih) + 1;
2519 $y_pos = ($pb['bpa']['h'] * $y_pos) - ($ih * $y_pos);
2543 $s .= sprintf("q %s %.3F 0 0 %.3F %.3F %.3F cm /I%d Do Q", $opac, $iw * Mpdf::SCALE, $ih * Mpdf::SCALE, $x * Mpdf::SCALE, ($this->h - ($y + $ih)) * Mpdf::SCALE, $pb['image_id']) . "\n";
2553 $s .= sprintf('q /Pattern cs /P%d scn %s %.3F %.3F %.3F %.3F re f Q', $n, $opac, $x, $y, $w, $h) . "\n";
2592 $s .= sprintf('%.3F %.3F %.3F %.3F re %s Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE, 'f') . "\n";
2598 $s .= $this->gradient->Gradient($pb['x'], $pb['y'], $pb['w'], $pb['h'], $pb['gradtype'], $pb['stops'], $pb['colorspace'], $pb['coords'], $pb['extend'], true);
2605 $pb['h'] += $adjustmenty;
2607 list($orig_w, $orig_h, $x_repeat, $y_repeat) = $this->_resizeBackgroundImage($pb['orig_w'], $pb['orig_h'], $pb['w'], $pb['h'], $pb['resize'], $pb['x_repeat'], $pb['y_repeat']);
2608 $this->patterns[$n] = ['x' => $pb['x'], 'y' => $pb['y'], 'w' => $pb['w'], 'h' => $pb['h'], 'pgh' => $this->h, 'image_id' => $pb['image_id'], 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $pb['x_pos'], 'y_pos' => $pb['y_pos'], 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'itype' => $pb['itype']];
2610 $y = ($this->h - $pb['y']) * Mpdf::SCALE;
2612 $h = -$pb['h'] * Mpdf::SCALE;
2617 $pb['clippath'] = sprintf(' q 0 w %.3F %.3F m %.3F %.3F l %.3F %.3F l %.3F %.3F l %.3F %.3F l W n ', $x, $y, $x, $y + $h, $x + $w, $y + $h, $x + $w, $y, $x, $y);
2625 if ($this->writingHTMLfooter || $this->writingHTMLheader) { // Write each (tiles) image rather than use as a pattern
2630 $h = $pb['h'];
2636 $h = $pb['bpa']['h'];
2642 $pb['bpa'] = ['x' => $x0, 'y' => $y0, 'w' => $w, 'h' => $h];
2653 if ($ih > $pb['bpa']['h']) {
2654 $iw = $iw * $pb['bpa']['h'] / $ih;
2655 $ih = $pb['bpa']['h'];
2661 if ($ih < $pb['bpa']['h']) {
2662 $iw = $iw * $ih / $pb['bpa']['h'];
2663 $ih = $pb['bpa']['h'];
2671 if (NumericString::containsPercentChar($size['h'])) {
2672 $size['h'] = NumericString::removePercentChar($size['h']);
2673 $size['h'] /= 100;
2674 $size['h'] = ($pb['bpa']['h'] * $size['h']);
2676 if ($size['w'] == 'auto' && $size['h'] == 'auto') {
2679 } elseif ($size['w'] == 'auto' && $size['h'] != 'auto') {
2680 $iw = $iw * $size['h'] / $ih;
2681 $ih = $size['h'];
2682 } elseif ($size['w'] != 'auto' && $size['h'] == 'auto') {
2687 $ih = $size['h'];
2699 $ny = ceil($pb['h'] / $ih) + 1;
2714 $y_pos = ($pb['bpa']['h'] * $y_pos) - ($ih * $y_pos);
2735 $s .= sprintf("q %s %.3F 0 0 %.3F %.3F %.3F cm /I%d Do Q", $opac, $iw * Mpdf::SCALE, $ih * Mpdf::SCALE, $x * Mpdf::SCALE, ($this->h - ($y + $ih)) * Mpdf::SCALE, $pb['image_id']) . "\n";
2744 $s .= sprintf('q /Pattern cs /P%d scn %s %.3F %.3F %.3F %.3F re f Q', $n, $opac, $x, $y, $w, $h) . "\n";
2788 function AddPageByArray($a)
2790 if (!is_array($a)) {
2791 $a = [];
2794 $orientation = (isset($a['orientation']) ? $a['orientation'] : '');
2795 $condition = (isset($a['condition']) ? $a['condition'] : (isset($a['type']) ? $a['type'] : ''));
2796 $resetpagenum = (isset($a['resetpagenum']) ? $a['resetpagenum'] : '');
2797 $pagenumstyle = (isset($a['pagenumstyle']) ? $a['pagenumstyle'] : '');
2798 $suppress = (isset($a['suppress']) ? $a['suppress'] : '');
2799 $mgl = (isset($a['mgl']) ? $a['mgl'] : (isset($a['margin-left']) ? $a['margin-left'] : ''));
2800 $mgr = (isset($a['mgr']) ? $a['mgr'] : (isset($a['margin-right']) ? $a['margin-right'] : ''));
2801 $mgt = (isset($a['mgt']) ? $a['mgt'] : (isset($a['margin-top']) ? $a['margin-top'] : ''));
2802 $mgb = (isset($a['mgb']) ? $a['mgb'] : (isset($a['margin-bottom']) ? $a['margin-bottom'] : ''));
2803 $mgh = (isset($a['mgh']) ? $a['mgh'] : (isset($a['margin-header']) ? $a['margin-header'] : ''));
2804 $mgf = (isset($a['mgf']) ? $a['mgf'] : (isset($a['margin-footer']) ? $a['margin-footer'] : ''));
2805 $ohname = (isset($a['ohname']) ? $a['ohname'] : (isset($a['odd-header-name']) ? $a['odd-header-name'] : ''));
2806 $ehname = (isset($a['ehname']) ? $a['ehname'] : (isset($a['even-header-name']) ? $a['even-header-name'] : ''));
2807 $ofname = (isset($a['ofname']) ? $a['ofname'] : (isset($a['odd-footer-name']) ? $a['odd-footer-name'] : ''));
2808 $efname = (isset($a['efname']) ? $a['efname'] : (isset($a['even-footer-name']) ? $a['even-footer-name'] : ''));
2809 $ohvalue = (isset($a['ohvalue']) ? $a['ohvalue'] : (isset($a['odd-header-value']) ? $a['odd-header-value'] : 0));
2810 $ehvalue = (isset($a['ehvalue']) ? $a['ehvalue'] : (isset($a['even-header-value']) ? $a['even-header-value'] : 0));
2811 $ofvalue = (isset($a['ofvalue']) ? $a['ofvalue'] : (isset($a['odd-footer-value']) ? $a['odd-footer-value'] : 0));
2812 $efvalue = (isset($a['efvalue']) ? $a['efvalue'] : (isset($a['even-footer-value']) ? $a['even-footer-value'] : 0));
2813 $pagesel = (isset($a['pagesel']) ? $a['pagesel'] : (isset($a['pageselector']) ? $a['pageselector'] : ''));
2814 $newformat = (isset($a['newformat']) ? $a['newformat'] : (isset($a['sheet-size']) ? $a['sheet-size'] : ''));
3007 // Don't correct more than once for background DIV containing a Float
3026 // Start a new page
3216 // Only add the headers if it's a new page
3507 // Get width of a single character in the current Core font
3538 // Get width of a single character in the current Non-Core font
3609 // Get width of a string in the current font
3620 $s = preg_replace('/{iteration ([a-zA-Z0-9_]+)}/', '\\1', $s);
3693 // Kashida is set as an absolute length value (already set as a proportion based on useKashida %)
3758 // Draw a line
3759 $this->writer->write(sprintf('%.3F %.3F m %.3F %.3F l S', $x1 * Mpdf::SCALE, ($this->h - $y1) * Mpdf::SCALE, $x2 * Mpdf::SCALE, ($this->h - $y2) * Mpdf::SCALE));
3773 $a = atan2(($y2 - $y1), ($x2 - $x1));
3774 $b = $a + deg2rad($angle);
3775 $c = $a - deg2rad($angle);
3777 $y3 = $this->h - ($y2 - ($headsize * sin($b)));
3779 $y4 = $this->h - ($y2 - ($headsize * sin($c)));
3785 $s .= sprintf('%.3F %.3F m %.3F %.3F l S', $x1 * Mpdf::SCALE, ($this->h - $y1) * Mpdf::SCALE, $x5 * Mpdf::SCALE, $y5 * Mpdf::SCALE);
3789 $s .= sprintf('%.3F %.3F m %.3F %.3F l %.3F %.3F l %.3F %.3F l %.3F %.3F l ', $x5 * Mpdf::SCALE, $y5 * Mpdf::SCALE, $x3 * Mpdf::SCALE, $y3 * Mpdf::SCALE, $x2 * Mpdf::SCALE, ($this->h - $y2) * Mpdf::SCALE, $x4 * Mpdf::SCALE, $y4 * Mpdf::SCALE, $x5 * Mpdf::SCALE, $y5 * Mpdf::SCALE);
3794 function Rect($x, $y, $w, $h, $style = '')
3796 // Draw a rectangle
3804 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F re %s', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, $w * Mpdf::SCALE, -$h * Mpdf::SCALE, $op));
4055 throw new \Mpdf\MpdfException("Symbol and Zapfdingbats cannot be embedded in mPDF (required for PDFA1-b or PDFX/1-a).");
4059 $this->PDFAXwarnings[] = "Core Adobe font " . ucfirst($family) . " cannot be embedded in mPDF, which is required for PDFA1-b or PDFX/1-a. (Embedded font will be substituted.)";
4118 } // elseif only one font available - set it (assumes if only one font available it will not have a style)
4163 preg_match('/^([a-z_0-9\-]+)([BI]{0,2})$/', $fs, $fas); // Allow "-"
4215 throw new \Mpdf\MpdfException('Core Adobe fonts cannot be embedded in mPDF (required for PDFA1-b or PDFX/1-a) - cannot use option to use core fonts.');
4305 // Create a new internal link
4323 function Link($x, $y, $w, $h, $link)
4325 $l = [$x * Mpdf::SCALE, $this->hPt - $y * Mpdf::SCALE, $w * Mpdf::SCALE, $h * Mpdf::SCALE, $link];
4341 // Put a link on the page
4350 // Output (or return) a string
4389 $py = ($this->h - $y) * Mpdf::SCALE;
4485 // Output a string using Text() but does encoding and text reversing of RTL
4524 function WriteCell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '', $currentx = 0)
4526 // Output a cell using Cell() but does encoding and text reversing of RTL
4561 $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link, $currentx, 0, 0, 'M', 0, false, $OTLdata, $textvar);
4659 // $useKashida is a % value from CurrentFont/config_fonts.php
4667 // Only use kashida if each allocated kashida width is > 0.01 x width of a tatweel
4674 // At this point kashida is a number representing priority (higher number - higher priority)
4728 * Output a cell
4734 function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '', $currentx = 0, $lcpaddingL = 0, $lcpaddingR = 0, $valign = 'M', $spanfill = 0, $exactWidth = false, $OTLdata = false, $textvar = 0, $lineBox = false)
4756 || ($this->y + $h > $this->PageBreakTrigger)
4758 $this->y + ($h * 2) + $bottom > $this->PageBreakTrigger
4785 // Test: to put line through centre of cell: $this->Line($this->x,$this->y+($h/2),$this->x+50,$this->y+($h/2));
4798 // COLUMNS Update/overwrite the lowest bottom of printing y value for a column
4800 if ($h) {
4801 $this->ColDetails[$this->CurrCol]['bottom_margin'] = $this->y + $h;
4847 $boxheight = $h;
4848 $boxbottom = $this->y + $h;
4871 $va = $h - (0.5 * $bfs * $this->normalLineheight);
4873 $va = 0.5 * $h;
4925 $s .= sprintf('%.3F %.3F %.3F %.3F re f ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bg_boxtop + $tbw) * Mpdf::SCALE, ($w + $lbw + $rbw) * Mpdf::SCALE, (-$bg_boxheight - $tbw - $bbw) * Mpdf::SCALE);
4947 $s .= sprintf('%.3F %.3F m ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE);
4948 $s .= sprintf('%.3F %.3F l ', ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE);
4949 $s .= sprintf('%.3F %.3F l ', ($this->x + $w) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE);
4950 $s .= sprintf('%.3F %.3F l ', ($this->x) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE);
4951 $s .= ' h W n '; // Ends path no-op & Sets the clipping path
4958 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw * 5 / 6) * Mpdf::SCALE, ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw * 5 / 6) * Mpdf::SCALE);
4959 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 6) * Mpdf::SCALE, ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 6) * Mpdf::SCALE);
4962 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 2) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 2) * Mpdf::SCALE);
4965 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 2) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw / 2) * Mpdf::SCALE);
4986 $s .= sprintf('%.3F %.3F m ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw) * Mpdf::SCALE);
4987 $s .= sprintf('%.3F %.3F l ', ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw) * Mpdf::SCALE);
4988 $s .= sprintf('%.3F %.3F l ', ($this->x + $w) * Mpdf::SCALE, ($this->h - $bord_boxbottom) * Mpdf::SCALE);
4989 $s .= sprintf('%.3F %.3F l ', ($this->x) * Mpdf::SCALE, ($this->h - $bord_boxbottom) * Mpdf::SCALE);
4990 $s .= ' h W n '; // Ends path no-op & Sets the clipping path
4997 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 6) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 6) * Mpdf::SCALE);
4998 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw * 5 / 6) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw * 5 / 6) * Mpdf::SCALE);
5001 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 2) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 2) * Mpdf::SCALE);
5004 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 2) * Mpdf::SCALE, ($this->x + $w + $rbw - $short) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw / 2) * Mpdf::SCALE);
5025 $s .= sprintf('%.3F %.3F m ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw) * Mpdf::SCALE);
5026 $s .= sprintf('%.3F %.3F l ', ($this->x) * Mpdf::SCALE, ($this->h - $bord_boxbottom) * Mpdf::SCALE);
5027 $s .= sprintf('%.3F %.3F l ', ($this->x) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE);
5028 $s .= sprintf('%.3F %.3F l ', ($this->x - $lbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE);
5029 $s .= ' h W n '; // Ends path no-op & Sets the clipping path
5035 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw / 6) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x - $lbw / 6) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5036 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw * 5 / 6) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x - $lbw * 5 / 6) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5039 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x - $lbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5042 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x - $lbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x - $lbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5064 $s .= sprintf('%.3F %.3F m ', ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw) * Mpdf::SCALE);
5065 $s .= sprintf('%.3F %.3F l ', ($this->x + $w) * Mpdf::SCALE, ($this->h - $bord_boxbottom) * Mpdf::SCALE);
5066 $s .= sprintf('%.3F %.3F l ', ($this->x + $w) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE);
5067 $s .= sprintf('%.3F %.3F l ', ($this->x + $w + $rbw) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE);
5068 $s .= ' h W n '; // Ends path no-op & Sets the clipping path
5074 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x + $w + $rbw / 6) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x + $w + $rbw / 6) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5075 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x + $w + $rbw * 5 / 6) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x + $w + $rbw * 5 / 6) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5078 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x + $w + $rbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x + $w + $rbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5081 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($this->x + $w + $rbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxtop + $tbw) * Mpdf::SCALE, ($this->x + $w + $rbw / 2) * Mpdf::SCALE, ($this->h - $bord_boxbottom - $bbw + $short) * Mpdf::SCALE);
5099 $s .= sprintf('%.3F %.3F %.3F %.3F re %s ', $this->x * Mpdf::SCALE, ($this->h - $bg_boxtop) * Mpdf::SCALE, $w * Mpdf::SCALE, -$bg_boxheight * Mpdf::SCALE, $op);
5109 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', $x * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE, $x * Mpdf::SCALE, ($this->h - ($bord_boxbottom)) * Mpdf::SCALE);
5113 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', $x * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE, ($x + $w) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE);
5117 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', ($x + $w) * Mpdf::SCALE, ($this->h - $bord_boxtop) * Mpdf::SCALE, ($x + $w) * Mpdf::SCALE, ($this->h - ($bord_boxbottom)) * Mpdf::SCALE);
5121 $s .= sprintf('%.3F %.3F m %.3F %.3F l S ', $x * Mpdf::SCALE, ($this->h - ($bord_boxbottom)) * Mpdf::SCALE, ($x + $w) * Mpdf::SCALE, ($this->h - ($bord_boxbottom)) * Mpdf::SCALE);
5171 $py = ($this->h - ($this->y + $glyphYorigin - $baseline_shift)) * Mpdf::SCALE;
5303 } // else use a fraction ($this->baselineS) of CapHeight
5398 $this->lasth = $h;
5404 $this->y += $h;
5487 // Convert to PDF Text space (thousandths of a unit );
5508 // XAdvance from GPOS - Convert to PDF Text space (thousandths of a unit );
5611 // If any settings require a new Text Group
5775 $s = sprintf(' BT ' . $aix, $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE);
5814 $s .= sprintf(' BT ' . $aix . ' [%s] TJ ET ', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, $tj);
5827 $s .= sprintf(' BT ' . $aix . ' [%s] TJ ET ', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, $tj);
5835 $h,
5971 $this->Cell($w, $h, $tmp, $b, 2, $align, $fill, $link, 0, 0, 0, 'M', 0, false, $tmpOTLdata);
5973 if ($maxrows != false && isset($this->form) && ($this->y - $start_y) / $h > $maxrows) {
6021 $this->Cell($w, $h, $tmp, $b, 2, $align, $fill, $link, 0, 0, 0, 'M', 0, false, $tmpOTLdata);
6063 $this->Cell($w, $h, $tmp, $b, 2, $align, $fill, $link, 0, 0, 0, 'M', 0, false, $tmpOTLdata);
6068 if ($maxrows != false && isset($this->form) && ($this->y - $start_y) / $h > $maxrows) {
6104 $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill, $link);
6106 if ($maxrows != false && isset($this->form) && ($this->y - $start_y) / $h > $maxrows) {
6143 $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill, $link);
6165 $this->Cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill, $link);
6169 if ($maxrows != false && isset($this->form) && ($this->y - $start_y) / $h > $maxrows) {
6212 $this->Cell($w, $h, $tmp, $b, 2, $align, $fill, $link, 0, 0, 0, 'M', 0, false, $tmpOTLdata);
6214 $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill, $link);
6222 function Write($h, $txt, $currentx = 0, $link = '', $directionality = 'ltr', $align = '', $fill = 0)
6228 $this->directWrite->Write($h, $txt, $currentx, $link, $directionality, $align, $fill);
6324 // Returns the first blocklevel that uses a bgcolor fill
6404 function newFlowingBlock($w, $h, $a = '', $is_table = false, $blockstate = 0, $newblock = true, $blockdir = 'ltr', $table_draft = false)
6406 if (!$a) {
6408 $a = 'R';
6410 $a = 'L';
6417 $this->flowingBlockAttr['height'] = $h;
6419 $this->flowingBlockAttr['align'] = $a;
6600 // This fixes a proven bug...
6815 // If "orphans" in fact is just a final space - ignore this
6839 // but only allow a maximum of $this->jSmaxWordLast and $this->jSmaxCharLast
7149 // Create a dummy entry in the _out/columnBuffer with position sensitive data,
7160 $h = $objattr['OUTER-HEIGHT'];
7252 $maxsize_y = $h;
7254 $cy = $y + $h / 2;
7331 $this->Rect($x, $y, $w, $h, 'F');
7349 $outstring = sprintf('q ' . $tr . $tr2 . '%.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, -$sy, $objattr['INNER-X'] * Mpdf::SCALE - $sx * $objattr['wmf_x'], (($this->h - $objattr['INNER-Y']) * Mpdf::SCALE) + $sy * $objattr['wmf_y'], $objattr['ID']); // mPDF 5.7.3 TRANSFORMS
7352 $outstring = sprintf('q ' . $tr . $tr2 . '%.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, -$sy, $objattr['INNER-X'] * Mpdf::SCALE - $sx * $objattr['wmf_x'], (($this->h - $objattr['INNER-Y']) * Mpdf::SCALE) + $sy * $objattr['wmf_y'], $objattr['ID']); // mPDF 5.7.3 TRANSFORMS
7354 $outstring = sprintf("q " . $tr . $tr2 . "%.3F 0 0 %.3F %.3F %.3F cm " . $gradmask . "/I%d Do Q", $obiw * Mpdf::SCALE, $obih * Mpdf::SCALE, $objattr['INNER-X'] * Mpdf::SCALE, ($this->h - ($objattr['INNER-Y'] + $obih )) * Mpdf::SCALE, $objattr['ID']); // mPDF 5.7.3 TRANSFORMS
7614 $this->Cell($w, $h, $dots, 0, 0, 'C', 0, '', 0, 0, 0, 'T', 0, false, false, 0, $objattr['lineBox']); // mPDF 6 DOTTAB
7624 $this->form->print_ob_text($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir);
7629 $this->form->print_ob_textarea($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir);
7634 $this->form->print_ob_select($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir);
7640 $this->form->print_ob_imageinput($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir, $is_table);
7645 $this->form->print_ob_button($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir);
7650 $this->form->print_ob_checkbox($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir, $x, $y);
7654 $this->form->print_ob_radio($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir, $x, $y);
7676 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F re f', ($x - $size / 2) * Mpdf::SCALE, ($this->h - $y + $size / 2) * Mpdf::SCALE, ($size) * Mpdf::SCALE, (-$size) * Mpdf::SCALE));
8006 // 1) CJK Overflowing a) punctuation or b) Oikomi
8025 // 1a) Overflow punctuation
8103 // Don't break a URL
8117 // Don't break if HyphenMinus AND (a URL or before a numeral or before a >)
8156 // If a line-break opportunity found:
8230 // 1) CJK Overflowing a) punctuation or b) Oikomi
8261 // Selected OBJECTS are moved forward to next line, unless they come before a space or U+200B (type='discard')
8840 function Image($file, $x, $y, $w = 0, $h = 0, $type = '', $link = '', $paint = true, $constrain = true, $watermark = false, $shownoimg = true, $allowvector = true)
8851 $h = ($info['h'] * (25.4 / $this->img_dpi)); // 14 x 16px
8858 if ($w == 0 and $h == 0) {
8865 $h = abs($info['h']) / (20 * Mpdf::SCALE);
8871 $h = abs($info['h']) / Mpdf::SCALE;
8875 $h = ($info['h'] / Mpdf::SCALE) * (72 / $this->img_dpi);
8880 $w = abs($h * $info['w'] / $info['h']);
8882 if ($h == 0) {
8883 $h = abs($w * $info['h'] / $info['w']);
8889 $maxh = $this->h;
8893 $h = $this->watermark_size[1];
8898 $h = abs($w * $info['h'] / $info['w']);
8899 if ($h > $maxh) {
8900 $h = $maxh;
8901 $w = abs($h * $info['w'] / $info['h']);
8909 $maxh = $this->h - ($this->tMargin + $this->bMargin);
8911 $h = abs($w * $info['h'] / $info['w']);
8912 if ($h > $maxh) {
8913 $h = $maxh;
8914 $w = abs($h * $info['w'] / $info['h']);
8918 $h = abs($w * $info['h'] / $info['w']);
8919 if ($h > $maxh) {
8920 $h = $maxh;
8921 $w = abs($h * $info['w'] / $info['h']);
8927 $h = abs($w * $info['h'] / $info['w']);
8929 if ($h > $maxh) {
8930 $h = $maxh;
8931 $w = abs($h * $info['w'] / $info['h']);
8950 $y = ($this->tMargin + ($this->h - ($this->tMargin + $this->bMargin)) / 2) - ($h / 2);
8953 $y = ($this->h / 2) - ($h / 2);
8958 $sy = -$h * Mpdf::SCALE / $info['h'];
8959 $outstring = sprintf('q %.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, $sy, $x * Mpdf::SCALE - $sx * $info['x'], (($this->h - $y) * Mpdf::SCALE) - $sy * $info['y'], $info['i']);
8963 $sy = -$h * Mpdf::SCALE / $info['h'];
8964 $outstring = sprintf('q %.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, $sy, $x * Mpdf::SCALE - $sx * $info['x'], (($this->h - $y) * Mpdf::SCALE) - $sy * $info['y'], $info['i']);
8966 $outstring = sprintf("q %.3F 0 0 %.3F %.3F %.3F cm /I%d Do Q", $w * Mpdf::SCALE, $h * Mpdf::SCALE, $x * Mpdf::SCALE, ($this->h - ($y + $h)) * Mpdf::SCALE, $info['i']);
8990 $h = abs($w * $info['h'] / $info['w']);
8992 if ($h > $this->h - ($this->tMargin + $this->bMargin + 1)) { // see below - +10 to avoid drawing too close to border of page
8993 $h = $this->h - ($this->tMargin + $this->bMargin + 1);
8995 $h = $this->fullImageHeight;
8997 $w = abs($h * $info['w'] / $info['h']);
9011 if ($y + $h > $this->PageBreakTrigger and ! $this->InFooter and $this->AcceptPageBreak()) {
9032 $sy = -$h * Mpdf::SCALE / $info['h'];
9033 $outstring = sprintf('q %.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, $sy, $x * Mpdf::SCALE - $sx * $info['x'], (($this->h - $y) * Mpdf::SCALE) - $sy * $info['y'], $info['i']);
9037 $sy = -$h * Mpdf::SCALE / $info['h'];
9038 $outstring = sprintf('q %.3F 0 0 %.3F %.3F %.3F cm /FO%d Do Q', $sx, $sy, $x * Mpdf::SCALE - $sx * $info['x'], (($this->h - $y) * Mpdf::SCALE) - $sy * $info['y'], $info['i']);
9040 $outstring = sprintf("q %.3F 0 0 %.3F %.3F %.3F cm /I%d Do Q", $w * Mpdf::SCALE, $h * Mpdf::SCALE, $x * Mpdf::SCALE, ($this->h - ($y + $h)) * Mpdf::SCALE, $info['i']);
9047 $this->Link($x, $y, $w, $h, $link);
9051 $this->y = $y + $h;
9056 $sizesarray['HEIGHT'] = $h;
9099 $h = 0;
9101 $h = abs($objattr['height'] / $k);
9104 $maxHeight = $this->h - ($this->tMargin + $this->bMargin + 10);
9138 $h = 0.00001;
9144 if (($y + $h + $lineHeight > $this->PageBreakTrigger) && !$this->InFooter && !$is_table) {
9145 return [-2, $w, $h];
9148 return [1, $w, $h];
9152 $displayheight = $h;
9164 return [-2, $w, $h];
9166 return [1, $w, $h]; // new line
9168 return [1, $w, $h]; // new line
9171 return [-1, $w, $h];
9174 return [0, $w, $h];
9181 $h = 0.00001;
9196 $h = abs($w * $info['h'] / $info['w']);
9199 $img_h = $h - $extraHeight;
9214 $img_h = $h - $extraHeight;
9228 $b_h = $h - $extraHeight;
9245 // This used to resize height to maximum remaining on page ? why. Causes problems when in table and causing a new column
9246 // if (($y + $h > $this->PageBreakTrigger) && !$this->InFooter) {
9247 // $h=$this->h - $y - $this->bMargin;
9298 $objattr['OUTER-HEIGHT'] = $h;
9352 function Ln($h = '', $collapsible = 0)
9362 $h = 0;
9365 if (is_string($h)) {
9368 $this->y += $h;
9374 function DivLn($h, $level = -3, $move_y = true, $collapsible = false, $state = 0)
9396 $this->y += $h;
9420 $this->Cell(($this->blk[$blvl]['width']), $h, '', '', 0, '', 1);
9425 $this->PaintDivLnBorder($state, $blvl, $h);
9427 $this->PaintDivLnBorder(0, $blvl, $h);
9444 $this->y += $h;
9467 $this->y = $this->h + $y;
9501 throw new \Mpdf\MpdfException('PDF/A1-b or PDF/X1-a does not permit encryption of documents.');
9509 $standard = 'PDFX/1-a ';
9513 $this->logger->warning(sprintf('PDF could not be generated as it stands as a %s compliant file.', $standard), ['context' => LogContext::PDFA_PDFX]);
9558 // We send to a browser
9655 $mamp = ' If using MAMP, there is a bug in its PHP build causing this.';
9698 $this->h = $this->saveHTMLHeader[$n][$OE]['ph'];
9726 // $os .= sprintf('q 0 1 -1 0 %.3F %.3F cm ',($this->h*Mpdf::SCALE), (($this->rMargin - $this->lMargin )*Mpdf::SCALE));
9750 $lk[1] = ($this->h - $by) * Mpdf::SCALE - $lw;
9772 $this->h = $this->saveHTMLFooter[$n][$OE]['ph'];
9778 $top_y = $this->y = $this->h - $this->margin_footer;
9781 if ($this->y == $this->h) {
9782 $top_y = $this->y = ($this->h + 0.01);
9813 // $os .= sprintf('q 0 1 -1 0 %.3F %.3F cm ',($this->h*Mpdf::SCALE), (($this->rMargin - $this->lMargin )*Mpdf::SCALE));
9847 $lk[1] = ($this->h - $by) * Mpdf::SCALE - $lw;
9898 $this->PDFAXwarnings[] = "Annotation markers cannot be semi-transparent in PDFA1-b or PDFX/1-a, so they may make underlying text unreadable. (Annotation markers moved to right margin)";
10210 $this->h = $this->fh;
10225 $this->h = $this->fw;
10242 $this->PageBreakTrigger = $this->h - $this->bMargin;
10246 $this->pageDim[$this->page]['h'] = $this->h;
10400 /* When the setAutoTopMargin option is set to pad/stretch, only apply auto header height when a header exists */
10406 if (isset($htmlh['h']) && $htmlh['h']) {
10407 $h = $htmlh['h'];
10410 $h = 0;
10412 $this->tMargin = $this->margin_header + $h + $this->orig_tMargin;
10414 if (isset($htmlh['h']) && $htmlh['h']) {
10415 $h = $htmlh['h'];
10418 $h = 0;
10420 $this->tMargin = max($this->orig_tMargin, $this->margin_header + $h + $this->autoMarginPadding);
10427 /* When the setAutoTopMargin option is set to pad/stretch, only apply auto footer height when a footer exists */
10433 if (isset($htmlf['h']) && $htmlf['h']) {
10434 $h = $htmlf['h'];
10437 $h = 0;
10439 $this->bMargin = $this->margin_footer + $h + $this->orig_bMargin;
10440 $this->PageBreakTrigger = $this->h - $this->bMargin;
10442 if (isset($htmlf['h']) && $htmlf['h']) {
10443 $h = $htmlf['h'];
10446 $h = 0;
10448 $this->bMargin = max($this->orig_bMargin, $this->margin_footer + $h + $this->autoMarginPadding);
10449 $this->PageBreakTrigger = $this->h - $this->bMargin;
10472 // Draw a line
10473 return sprintf('%.3F %.3F m %.3F %.3F l S', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, ($x * Mpdf::SCALE) + $w, ($this->h - $y) * Mpdf::SCALE);
10480 // add a watermark
10535 $maxlen = (min($this->w, $this->h) ); // sets max length of text as 7/8 width/height of page
10556 $wy = ($this->h / 2) + $opp;
10604 $cy = ($this->h - $y) * Mpdf::SCALE;
10619 function RoundedRect($x, $y, $w, $h, $r, $style = '')
10621 $hp = $this->h;
10639 $yc = $y + $h - $r;
10644 $yc = $y + $h - $r;
10645 $this->writer->write(sprintf('%.3F %.3F l', $xc * Mpdf::SCALE, ($hp - ($y + $h)) * Mpdf::SCALE));
10658 $h = $this->h;
10659 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $x1 * Mpdf::SCALE, ($h - $y1) * Mpdf::SCALE, $x2 * Mpdf::SCALE, ($h - $y2) * Mpdf::SCALE, $x3 * Mpdf::SCALE, ($h - $y3) * Mpdf::SCALE));
10684 $h = ord($str[$i]);
10685 if ($h <= 0x7F) {
10686 $uni = $h;
10687 } elseif ($h >= 0xC2) {
10688 if (($h <= 0xDF) && ($i < $len - 1)) {
10689 $uni = ($h & 0x1F) << 6 | (ord($str[++$i]) & 0x3F);
10690 } elseif (($h <= 0xEF) && ($i < $len - 2)) {
10691 $uni = ($h & 0x0F) << 12 | (ord($str[++$i]) & 0x3F) << 6 | (ord($str[++$i]) & 0x3F);
10692 } elseif (($h <= 0xF4) && ($i < $len - 3)) {
10693 $uni = ($h & 0x0F) << 18 | (ord($str[++$i]) & 0x3F) << 12 | (ord($str[++$i]) & 0x3F) << 6 | (ord($str[++$i]) & 0x3F);
10790 throw new \Mpdf\MpdfException("Adobe CJK fonts cannot be embedded in mPDF (required for PDFA1-b and PDFX/1-a).");
10975 // Return either a number (factor) - based on current set fontsize (if % or em) - or exact lineheight (with 'mm' after it)
11010 // Set a (fixed) lineheight to an actual value - either to named fontsize(pts) or default
11075 } // ??? If lineheight is a factor e.g. 1.3 ?? use factor x 1em or ? use 'normal' lineheight * factor
11076 // Could depend on value for $text_height - a draft CSS value as set above for now
11085 // If an inline element has a font-size less than the block element, and the line-height is set as an em or % value
11149 // First, set a "strut" using block font at index $lineBox[-1]
11477 $pattern = sprintf('@^(?!%s)[a-z0-9\.\-+]+:.*@i', implode('|', $wrappers));
11482 if (substr($path, 0, 3) == "../") { // It is a relative link
11501 } elseif ((strpos($path, ":/") === false || strpos($path, ":/") > 10) && !@is_file($path)) { // It is a local link. Ignore potential file errors
11649 } elseif ($lowertype == 'lower-latin' || $lowertype == 'lower-alpha' || $type == 'a') {
11759 throw new \Mpdf\MpdfException("<tfoot> must precede <tbody> in a table");
11794 $divh = $content[$i][0]['h'];
11837 if (!is_array($t[0]) && preg_match('/{iteration ([a-zA-Z0-9_]+)}/', $t[0], $m)) {
11850 $h = Arrays::get($tablehf, 'h', null);
11863 $align = Arrays::get($tablehf, 'a', null);
11897 $this->Rect($x - $xadj, $y - $yadj, $w + $wadj, $h + $hadj, 'F');
11915 $this->y += ($h - $mih) / 2;
11917 $this->y += $h - $mih;
11936 $this->Rect($x + ($table['border_spacing_H'] / 2), $y + ($table['border_spacing_V'] / 2), $w - $table['border_spacing_H'], $h - $table['border_spacing_V'], 'F');
11938 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => ($x + ($table['border_spacing_H'] / 2)), 'y' => ($y + ($table['border_spacing_V'] / 2)), 'w' => ($w - $table['border_spacing_H']), 'h' => ($h - $table['border_spacing_V']), 'col' => $color];
11943 $this->Rect($x, $y, $w, $h, 'F');
11945 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'col' => $color];
11960 $ph = $h - $table['border_spacing_V'];
11965 $ph = $h;
11970 $this->tableBackgrounds[$level * 9 + 7][] = ['gradient' => true, 'x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
11983 $ph = $h - $table['border_spacing_V'];
11988 $ph = $h;
11993 $this->tableBackgrounds[$level * 9 + 7][] = ['gradient' => true, 'x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
12002 $ph = $h - $table['border_spacing_V'];
12007 $ph = $h;
12011 $this->patterns[$n] = ['x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'pgh' => $this->h, 'image_id' => $tablehf['background-image']['image_id'], 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $tablehf['background-image']['x_pos'], 'y_pos' => $tablehf['background-image']['y_pos'], 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'itype' => $tablehf['background-image']['itype']];
12017 $this->writer->write(sprintf('q /Pattern cs /P%d scn %s %.3F %.3F %.3F %.3F re f Q', $n, $opac, $px * Mpdf::SCALE, ($this->h - $py) * Mpdf::SCALE, $pw * Mpdf::SCALE, -$ph * Mpdf::SCALE));
12019 $this->tableBackgrounds[$level * 9 + 8][] = ['x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'image_id' => $tablehf['background-image']['image_id'], 'orig_w' => $tablehf['background-image']['orig_w'], 'orig_h' => $tablehf['background-image']['orig_h'], 'x_pos' => $tablehf['background-image']['x_pos'], 'y_pos' => $tablehf['background-image']['y_pos'], 'x_repeat' => $tablehf['background-image']['x_repeat'], 'y_repeat' => $tablehf['background-image']['y_repeat'], 'clippath' => '', 'resize' => $tablehf['background-image']['resize'], 'opacity' => $tablehf['background-image']['opacity'], 'itype' => $tablehf['background-image']['itype']];
12027 $this->_tableRect($x + ($table['border_spacing_H'] / 2) + ($border_details['L']['w'] / 2), $y + ($table['border_spacing_V'] / 2) + ($border_details['T']['w'] / 2), $w - $table['border_spacing_H'] - ($border_details['L']['w'] / 2) - ($border_details['R']['w'] / 2), $h - $table['border_spacing_V'] - ($border_details['T']['w'] / 2) - ($border_details['B']['w'] / 2), $border, $border_details, false, $table['borders_separate']);
12029 $this->_tableRect($x, $y, $w, $h, $border, $border_details, true, $table['borders_separate']); // true causes buffer
12075 $this->y -= ($h - $mih) / 2; // Undo what was added earlier VERTICAL ALIGN
12077 $this->y += (($h - $mih) / 2) + ($padding['T'] + $border_details['T']['w']) + ($mih - ($padding['T'] + $border_details['T']['w'] + $border_details['B']['w'] + $padding['B']));
12079 $this->y += (($h - $mih) / 2) + ($padding['T'] + $border_details['T']['w']);
12082 $this->y -= $h - $mih; // Undo what was added earlier VERTICAL ALIGN
12084 $this->y += $h - ($border_details['B']['w'] + $padding['B']);
12086 $this->y += $h - $mih + ($padding['T'] + $border_details['T']['w']);
12139 $gh = $h;
12146 $clh = $h - $table['border_spacing_V'];
12149 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
12151 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
12162 $gh = $h;
12169 $clh = $h - $table['border_spacing_V'];
12172 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
12174 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
12192 $gh = $h;
12199 $clh = $h - $table['border_spacing_V'];
12202 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => $s, 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
12204 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => '', 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
12220 $tbh = $h;
12248 $this->y = $y + $h; // Update y coordinate
12264 if (isset($header['h'])) {
12265 $height = $header['h'];
12287 $this->HTMLHeaderE['h'] = $height;
12295 $this->HTMLHeader['h'] = $height;
12330 if (isset($footer['h'])) {
12331 $height = $footer['h'];
12353 $this->HTMLFooterE['h'] = $height;
12361 $this->HTMLFooter['h'] = $height;
12377 $this->PageBreakTrigger = $this->h - $this->bMargin;
12383 $this->PageBreakTrigger = $this->h - $this->bMargin;
12417 $h = ($this->y - $this->margin_header);
12435 return $h;
12460 $this->saveHTMLHeader[$this->page][$OE]['pw'] = $this->h;
12468 $this->saveHTMLHeader[$this->page][$OE]['ph'] = $this->h;
12495 $this->saveHTMLFooter[$this->page][$OE]['pw'] = $this->h;
12505 $this->saveHTMLFooter[$this->page][$OE]['ph'] = $this->h;
12644 $this->pageHTMLheaders[$name]['h'] = $this->_getHtmlHeight($html);
12655 $this->pageHTMLfooters[$name]['h'] = $this->_getHtmlHeight($html);
12681 $this->pageHTMLheaders[$name]['h'] = $this->_getHtmlHeight($html);
12691 $this->pageHTMLfooters[$name]['h'] = $this->_getHtmlHeight($html);
13046 $cy1 = $this->h - $b;
13047 $dy = $this->h - $this->page_box['outer_width_TB'] + $m;
13052 $this->Line($ax, $this->h - $this->page_box['outer_width_TB'], $bx, $this->h - $this->page_box['outer_width_TB']);
13053 $this->Line($cx, $this->h - $this->page_box['outer_width_TB'], $dx, $this->h - $this->page_box['outer_width_TB']);
13079 $y2 = $this->h - $this->page_box['outer_width_TB'] + $m;
13081 $this->Circle($x1, $this->h / 2, $r, 'S');
13082 $this->Line($x1 - $w, $this->h / 2, $x1 + $w, $this->h / 2);
13083 $this->Line($x1, $this->h / 2 - $l, $x1, $this->h / 2 + $l);
13085 $this->Circle($x2, $this->h / 2, $r, 'S');
13086 $this->Line($x2 - $w, $this->h / 2, $x2 + $w, $this->h / 2);
13087 $this->Line($x2, $this->h / 2 - $l, $x2, $this->h / 2 + $l);
13143 * @param bool $close If false leaves buffers etc. in current state, so that it can continue a block etc.
13159 /* Cast $html as a string */
13334 preg_match_all('/<htmlpageheader([^>]*)>(.*?)<\/htmlpageheader>/si', $html, $h);
13335 for ($i = 0; $i < count($h[1]); $i++) {
13336 if (preg_match('/name=[\'|\"](.*?)[\'|\"]/', $h[1][$i], $n)) {
13337 $this->pageHTMLheaders[$n[1]]['html'] = $h[2][$i];
13338 $this->pageHTMLheaders[$n[1]]['h'] = $this->_getHtmlHeight($h[2][$i]);
13345 $this->pageHTMLfooters[$n[1]]['h'] = $this->_getHtmlHeight($f[2][$i]);
13399 $a = preg_split('/<(.*?)>/ms', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
13400 // ? more accurate regexp that allows e.g. <a name="Silly <name>">
13402 // $a = preg_split ('/<((?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+)>/ms', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
13409 $cnt = count($a);
13411 $e = $a[$i];
13450 $cnt += $this->SubstituteCharsNonCore($a, $i, $e);
13465 $cnt += $this->SubstituteCharsSIP($a, $i, $e);
13469 $cnt += $this->SubstituteCharsMB($a, $i, $e);
13578 if (substr($this->cell[$this->row][$this->col]['a'], 0, 1) == 'D') {
13580 $dp = $this->decimal_align[substr($this->cell[$this->row][$this->col]['a'], 0, 2)];
13657 $this->tag->CloseTag('LI', $a, $i);
13662 $this->tag->CloseTag('DD', $a, $i);
13667 $this->tag->CloseTag('P', $a, $i);
13672 $this->tag->CloseTag('OPTION', $a, $i);
13680 $this->tag->CloseTag($this->lastoptionaltag, $a, $i);
13683 $this->tag->CloseTag('TR', $a, $i);
13686 $this->tag->CloseTag($this->lastoptionaltag, $a, $i);
13687 $this->tag->CloseTag('TR', $a, $i);
13692 $this->tag->CloseTag('TR', $a, $i);
13695 $this->tag->CloseTag($this->lastoptionaltag, $a, $i);
13696 $this->tag->CloseTag('TR', $a, $i);
13701 $this->tag->CloseTag($this->lastoptionaltag, $a, $i);
13718 $this->tag->CloseTag($endtag, $a, $i); // mPDF 6
13812 $this->tag->OpenTag($tag, $attr, $a, $i); // mPDF 6
13821 $this->tag->CloseTag($tag, $a, $i);
13825 } // end of foreach($a as $i=>$e)
13830 $this->tag->CloseTag($this->blk[$b]['tag'], $a, $i);
13842 // If ended with a float, need to move to end page
13908 function WriteFixedPosHTML($html, $x, $y, $w, $h, $overflow = 'visible', $bounding = [])
13916 // When used internally, $x $y $w $h and $overflow are all overridden by $bounding
13924 $this->fullImageHeight = $this->h;
13934 $this->writingHTMLheader = true; // a FIX to stop pagebreaks etc.
13945 if ($h > $this->h) {
13947 $h = $this->h;
13952 if ($y > $this->h) {
13953 $y = $this->h - $h;
13962 // $x, $y, $w, $h are inside of $bbox_ = containing box for $inner_
13996 $cont_h = $this->h - $this->tMargin - $this->bMargin;
14001 $cont_h = $this->h;
14358 $h = $cont_h - $bbox_top - $bbox_mt - $bbox_bt - $bbox_pt - $bbox_pb - $bbox_bb - $bbox_mb - $bbox_bottom;
14363 // Set (temporary) values for x y w h to do first paint, if values are auto
14366 $h = $cont_h - ($bbox_bottom + $bbox_mt + $bbox_mb + $bbox_bt + $bbox_bb + $bbox_pt + $bbox_pb);
14369 $h = $cont_h - ($bbox_top + $bbox_mt + $bbox_mb + $bbox_bt + $bbox_bb + $bbox_pt + $bbox_pb);
14388 if ($inner_w === 'auto') { // do a first write
14419 if ($inner_h === 'auto') { // do a first write
14467 $h = $inner_h;
14473 $inner_h = $h;
14496 $use_h = $h;
14500 $target = $h / $w;
14628 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F re %s', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, $w * Mpdf::SCALE, -$ch * Mpdf::SCALE, $op));
14630 $tmp = "q\n" . sprintf('%.3F %.3F %.3F %.3F re %s', $x * Mpdf::SCALE, ($this->h - $y) * Mpdf::SCALE, $w * Mpdf::SCALE, -$ch * Mpdf::SCALE, $op);
14670 $tmp = $lk[2]; // Switch h - w
14675 $ly1 = (($this->h - ($lk[1] / Mpdf::SCALE)));
14695 $lk[1] = ($this->h - $ly1) * Mpdf::SCALE;
14701 $ly1 = (($this->h - ($lk[1] / Mpdf::SCALE)) - $y);
14703 $lk[1] = ($this->h - $ly2) * Mpdf::SCALE;
14715 $f['h'] *= $shrink_f;
14884 function _borderPadding($a, $b, &$px, &$py)
14889 $x = $a - $px;
14892 if (( (($x + $added) * ($x + $added)) / ($a * $a) + (($y + $added) * ($y + $added)) / ($b * $b) ) <= 1) {
14898 $newx = $b / sqrt((($b * $b) / ($a * $a)) + ( tan($t) * tan($t) ));
14899 $newy = $a / sqrt((($a * $a) / ($b * $b)) + ( (1 / tan($t)) * (1 / tan($t)) ));
14900 $px = max($px, $a - $newx + $added);
15344 // if position:inside (and NOT table) - output now as a textbuffer; (so if next is block, will move to new line)
15378 $h = 0;
15386 if ($info['w'] == 0 && $info['h'] == 0) {
15387 $info['h'] = $this->sizeConverter->convert('1em', $this->blk[$this->blklvl]['inner_width'], $this->FontSize, false);
15393 if ($w == 0 and $h == 0) {
15400 $h = abs($info['h']) / (20 * Mpdf::SCALE);
15405 $h = abs($info['h']) / Mpdf::SCALE;
15409 $h = ($info['h'] / Mpdf::SCALE) * (72 / $this->img_dpi);
15415 $w = abs($h * $info['w'] / $info['h']);
15417 if ($h == 0) {
15418 $h = abs($w * $info['h'] / $info['w']);
15423 $h = abs($w * $info['h'] / $info['w']);
15426 if ($h > $maxHeight) {
15427 $h = $maxHeight;
15428 $w = abs($h * $info['w'] / $info['h']);
15434 $objattr['orig_h'] = $info['h'];
15448 $objattr['height'] = $h;
15450 $objattr['image_height'] = $h;
15492 } elseif (preg_match('/U\+([a-fA-F0-9]+)/i', $listitemtype, $m)) { // SYMBOL 2 (needs new font)
15574 function _getListMarkerWidth(&$currblk, &$a, &$i)
15584 for ($j = $i + 2; $j < count($a); $j+=2) {
15585 $e = $a[$j];
15637 case 'a':
15941 // As a failsafe - if font has been set but not output to page
15967 // Gets messed up if try and use core fonts inside a paragraph of text which needs to be BiDi re-ordered or OTLdata set
15969 throw new \Mpdf\MpdfException("You cannot use core fonts in a document which contains RTL text.");
16095 if (isset($vetor[7]) and $vetor[7] != '') { // internal target: <a name="anyvalue">
16132 if (strpos($vetor[1], ".") === false && strpos($vetor[1], "@") !== 0) { // assuming every external link has a dot indicating extension (e.g: .html .txt .zip www.somewhere.com etc.)
16156 $this->y += $this->table[($level + 1)][$objattr['nestedcontent']]['h']; // nested table height
16186 if ($cell['a'] == 'C' || $this->table[($level + 1)][$objattr['nestedcontent']]['a'] == 'C') {
16188 } elseif ($cell['a'] == 'R' || $this->table[($level + 1)][$objattr['nestedcontent']]['a'] == 'R') {
16307 $h = abs($objattr['height']);
16310 $maxHeight = $this->h - ($this->tMargin + $this->margin_header + $this->bMargin + 10);
16323 $img_h = $h - $extraHeight;
16336 $objattr['OUTER-HEIGHT'] = $h;
16354 $this->floatmargins['R']['y1'] = $fy + $h;
16366 $this->floatmargins['R']['y1'] = $fy + $h;
16390 $this->floatmargins['L']['y1'] = $fy + $h;
16402 $this->floatmargins['L']['y1'] = $fy + $h;
16427 if ($vetor[0] == "\n") { // We are reading a <BR> now turned into newline ("\n")
16651 $y1 = $this->h - $this->bMargin;
16662 $h = $y1 - $y0;
16762 $f = min($h / ($brTL_V + $brBL_V + 0.001), $h / ($brTR_V + $brBR_V + 0.001), $w / ($brTL_H + $brTR_H + 0.001), $w / ($brBL_H + $brBR_H + 0.001));
16786 $h = $y1 - $y0;
16835 $this->writer->write(sprintf('%.3F %.3F m ', ($x0) * Mpdf::SCALE, ($this->h - ($y0)) * Mpdf::SCALE));
16836 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $border_left) * Mpdf::SCALE, ($this->h - ($y0 + $border_top)) * Mpdf::SCALE));
16837 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w - $border_right) * Mpdf::SCALE, ($this->h - ($y0 + $border_top)) * Mpdf::SCALE));
16838 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0)) * Mpdf::SCALE));
16839 $this->writer->write(' h W n '); // Ends path no-op & Sets the clipping path
16856 $s .= (sprintf('%.3F %.3F m ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16858 $s .= (sprintf('%.3F %.3F m ', ($x0 + $w - ($border_top / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16865 $s .= (sprintf('%.3F %.3F l ', $legbreakR * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16868 $s .= (sprintf('%.3F %.3F m ', $legbreakL * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16869 $s .= (sprintf('%.3F %.3F l ', ($x0 + $brTL_H ) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE) . "\n");
16871 $s .= (sprintf('%.3F %.3F m ', ($x0 + $brTL_H ) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16874 $s .= (sprintf('%.3F %.3F l ', ($x0 + $brTL_H ) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16881 $s .= (sprintf('%.3F %.3F l ', $legbreakR * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16884 $s .= (sprintf('%.3F %.3F m ', $legbreakL * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16886 $s .= (sprintf('%.3F %.3F l ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16888 $s .= (sprintf('%.3F %.3F l ', ($x0 + ($border_top / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16891 $s .= (sprintf('%.3F %.3F m ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16893 $s .= (sprintf('%.3F %.3F m ', ($x0 + $border_top / 2) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16896 $s .= (sprintf('%.3F %.3F l ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16898 $s .= (sprintf('%.3F %.3F l ', ($x0 + ($border_top / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_top / 2))) * Mpdf::SCALE)) . "\n";
16923 // Reinstate line above for dotted line divider when block border crosses a page
16932 $this->writer->write(sprintf('%.3F %.3F m ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + $h)) * Mpdf::SCALE));
16933 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $border_left) * Mpdf::SCALE, ($this->h - ($y0 + $h - $border_bottom)) * Mpdf::SCALE));
16934 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w - $border_right) * Mpdf::SCALE, ($this->h - ($y0 + $h - $border_bottom)) * Mpdf::SCALE));
16935 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0 + $h)) * Mpdf::SCALE));
16936 $this->writer->write(' h W n '); // Ends path no-op & Sets the clipping path
16948 $s .= ($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_bottom / 2, $brBL_V - $border_bottom / 2, 3, 2, true)) . "\n";
16951 $s .= (sprintf('%.3F %.3F m ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_bottom / 2))) * Mpdf::SCALE)) . "\n";
16953 $s .= (sprintf('%.3F %.3F m ', ($x0 + ($border_bottom / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_bottom / 2))) * Mpdf::SCALE)) . "\n";
16958 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w - ($border_bottom / 2) - $brBR_H ) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_bottom / 2))) * Mpdf::SCALE)) . "\n";
16959 $s .= ($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_bottom / 2, $brBR_V - $border_bottom / 2, 4, 1)) . "\n";
16962 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_bottom / 2))) * Mpdf::SCALE)) . "\n";
16964 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w - ($border_bottom / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_bottom / 2))) * Mpdf::SCALE)) . "\n";
16987 // Reinstate line below for dotted line divider when block border crosses a page
16996 $this->writer->write(sprintf('%.3F %.3F m ', ($x0) * Mpdf::SCALE, ($this->h - ($y0)) * Mpdf::SCALE));
16997 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $border_left) * Mpdf::SCALE, ($this->h - ($y0 + $border_top)) * Mpdf::SCALE));
16998 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $border_left) * Mpdf::SCALE, ($this->h - ($y0 + $h - $border_bottom)) * Mpdf::SCALE));
16999 $this->writer->write(sprintf('%.3F %.3F l ', ($x0) * Mpdf::SCALE, ($this->h - ($y0 + $h)) * Mpdf::SCALE));
17000 $this->writer->write(' h W n '); // Ends path no-op & Sets the clipping path
17015 $s .= (sprintf('%.3F %.3F m ', ($x0 + ($border_left / 2)) * Mpdf::SCALE, ($this->h - ($y0)) * Mpdf::SCALE)) . "\n";
17017 $s .= (sprintf('%.3F %.3F m ', ($x0 + ($border_left / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_left / 2))) * Mpdf::SCALE)) . "\n";
17022 $s .= (sprintf('%.3F %.3F l ', ($x0 + ($border_left / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_left / 2) - $brBL_V) ) * Mpdf::SCALE)) . "\n";
17023 $s .= ($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_left / 2, $brBL_V - $border_left / 2, 3, 1)) . "\n";
17026 $s .= (sprintf('%.3F %.3F l ', ($x0 + ($border_left / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h) ) * Mpdf::SCALE)) . "\n";
17028 $s .= (sprintf('%.3F %.3F l ', ($x0 + ($border_left / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_left / 2)) ) * Mpdf::SCALE)) . "\n";
17057 $this->writer->write(sprintf('%.3F %.3F m ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0)) * Mpdf::SCALE));
17058 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w - $border_right) * Mpdf::SCALE, ($this->h - ($y0 + $border_top)) * Mpdf::SCALE));
17059 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w - $border_right) * Mpdf::SCALE, ($this->h - ($y0 + $h - $border_bottom)) * Mpdf::SCALE));
17060 $this->writer->write(sprintf('%.3F %.3F l ', ($x0 + $w) * Mpdf::SCALE, ($this->h - ($y0 + $h)) * Mpdf::SCALE));
17061 $this->writer->write(' h W n '); // Ends path no-op & Sets the clipping path
17073 $s .= ($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_right / 2, $brBR_V - $border_right / 2, 4, 2, true)) . "\n";
17076 $s .= (sprintf('%.3F %.3F m ', ($x0 + $w - ($border_right / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h)) * Mpdf::SCALE)) . "\n";
17078 $s .= (sprintf('%.3F %.3F m ', ($x0 + $w - ($border_right / 2)) * Mpdf::SCALE, ($this->h - ($y0 + $h - ($border_right / 2))) * Mpdf::SCALE)) . "\n";
17083 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w - ($border_right / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_right / 2) + $brTR_V) ) * Mpdf::SCALE)) . "\n";
17087 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w - ($border_right / 2)) * Mpdf::SCALE, ($this->h - ($y0) ) * Mpdf::SCALE)) . "\n";
17089 $s .= (sprintf('%.3F %.3F l ', ($x0 + $w - ($border_right / 2)) * Mpdf::SCALE, ($this->h - ($y0 + ($border_right / 2)) ) * Mpdf::SCALE)) . "\n";
17177 $s .= sprintf('%.3F %.3F m ', ($bgx0 + $brbgTL_H ) * Mpdf::SCALE, ($this->h - $bgy0) * Mpdf::SCALE); // start point TL before the arc
17183 $s .= sprintf('%.3F %.3F l ', ($bgx0) * Mpdf::SCALE, ($this->h - ($bgy1 - $brbgBL_V )) * Mpdf::SCALE); // line to BL
17189 $s .= sprintf('%.3F %.3F l ', ($bgx1 - $brbgBR_H ) * Mpdf::SCALE, ($this->h - ($bgy1)) * Mpdf::SCALE); // line to BR
17195 $s .= sprintf('%.3F %.3F l ', ($bgx1) * Mpdf::SCALE, ($this->h - ($bgy0 + $brbgTR_V)) * Mpdf::SCALE); // line to TR
17201 $s .= sprintf('%.3F %.3F l ', ($bgx0 + $brbgTL_H ) * Mpdf::SCALE, ($this->h - $bgy0) * Mpdf::SCALE); // line to TL
17204 if (isset($this->blk[$blvl]['box_shadow']) && $this->blk[$blvl]['box_shadow'] && $h > 0) {
17235 $shadow .= sprintf('0 %.3F m %.3F %.3F l ', $this->h * Mpdf::SCALE, $this->w * Mpdf::SCALE, $this->h * Mpdf::SCALE);
17236 $shadow .= sprintf('%.3F 0 l 0 0 l 0 %.3F l ', $this->w * Mpdf::SCALE, $this->h * Mpdf::SCALE);
17242 if (-$sh['spread'] + $sh['blur'] / 2 > min($w / 2, $h / 2)) {
17243 $sh['spread'] = $sh['blur'] / 2 - min($w / 2, $h / 2) + 0.01;
17270 $h00 = $h + $d1 * 2;
17277 if (max($brbgTR_V, $brbgTL_V, $brbgBR_V, $brbgBL_V) >= $h + $d2) {
17308 $shadow .= sprintf('%.3F %.3F m ', ($p1x ) * Mpdf::SCALE, ($this->h - ($p1y )) * Mpdf::SCALE);
17309 $shadow .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($p1c2x) * Mpdf::SCALE, ($this->h - ($p1y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4c2y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE);
17338 $shadow .= sprintf('%.3F %.3F l ', ($p3x ) * Mpdf::SCALE, ($this->h - ($p3y )) * Mpdf::SCALE);
17373 $shadow .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($p1x) * Mpdf::SCALE, ($this->h - ($p1c2y)) * Mpdf::SCALE, ($p4c2x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE);
17403 $shadow .= sprintf('%.3F %.3F l ', ($p3x ) * Mpdf::SCALE, ($this->h - ($p3y )) * Mpdf::SCALE);
17436 $shadow .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($p1c2x) * Mpdf::SCALE, ($this->h - ($p1y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4c2y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE);
17464 $shadow .= sprintf('%.3F %.3F l ', ($p3x ) * Mpdf::SCALE, ($this->h - ($p3y )) * Mpdf::SCALE);
17498 $shadow .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', ($p1x) * Mpdf::SCALE, ($this->h - ($p1c2y)) * Mpdf::SCALE, ($p4c2x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE, ($p4x) * Mpdf::SCALE, ($this->h - ($p4y)) * Mpdf::SCALE);
17526 $shadow .= sprintf('%.3F %.3F l ', ($p3x ) * Mpdf::SCALE, ($this->h - ($p3y )) * Mpdf::SCALE);
17534 $shadow .= ' h f Q ' . "\n"; // Close path and Fill the inner solid shadow
17554 'h' => $h,
17566 'h' => 0,
17587 'h' => $h,
17618 $h = $gy1 - $gy;
17630 $h = $gy1 - $gy;
17643 if (stristr($size['h'], '%')) {
17644 $size['h'] = (float) $size['h'];
17645 $size['h'] /= 100;
17646 $h *= $size['h'];
17647 } elseif ($size['h'] != 'auto') {
17648 $h = $size['h'];
17657 'h' => $h,
17684 $bpa = ['x' => $x0, 'y' => $y0, 'w' => $w, 'h' => $h];
17700 $bpa['h'] = $bpay - $bpa['y'];
17716 $bpa['h'] = $bpay - $bpa['y'];
17724 'h' => $h,
17789 $y0 = ($this->h - $y0) * Mpdf::SCALE;
17822 function PaintDivLnBorder($state = 0, $blvl = 0, $h = 0)
17825 $this->ColDetails[$this->CurrCol]['bottom_margin'] = $this->y + $h;
17833 $y1 = $this->y + $h; // bottom
17863 $this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + ($tbd['w'] / 2), $y0 + $h - ($tbd['w'] / 2));
17868 $this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + ($tbd['w'] / 2), $y0 + $h);
17884 $this->Line($x0 + $w - ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $y0 + $h - ($tbd['w'] / 2));
17889 $this->Line($x0 + $w - ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $y0 + $h);
17902 $this->y = $y0 + $h - ($tbd['w'] / 2);
17933 $h = (isset($objattr['BORDER-HEIGHT']) ? $objattr['BORDER-HEIGHT'] : 0);
17960 $this->Line($x0, $y0, $x0, $y0 + $h);
17974 $this->Line($x0 + $w, $y0, $x0 + $w, $y0 + $h);
17988 $this->Line($x0, $y0 + $h, $x0 + $w, $y0 + $h);
18175 // If it is a font list, get all font types
18782 if (preg_match('/[\"\']([a-zA-Z0-9]{4})[\"\']\s*(on|off|\d*){0,1}/', $t, $m)) {
19041 $this->enabledtags = "<a><acronym><address><article><aside><b><bdi><bdo><big><blockquote><br><caption><center><cite><code><del><details><dd><div><dl><dt><em><fieldset><figcaption><figure><font><form><h1><h2><h3><h4><h5><h6><hgroup><hr><i><img><input><ins><kbd><legend><li><main><mark><meter><nav><ol><option><p><pre><progress><q><s><samp><section><select><small><span><strike><strong><sub><summary><sup><table><tbody><td><template><textarea><tfoot><th><thead><time><tr><tt><u><ul><var><footer><header><annotation><bookmark><textcircle><barcode><dottab><indexentry><indexinsert><watermarktext><watermarkimage><tts><ttz><tta><column_break><columnbreak><newcolumn><newpage><page_break><pagebreak><formfeed><columns><toc><tocentry><tocpagebreak><pageheader><pagefooter><setpageheader><setpagefooter><sethtmlpageheader><sethtmlpagefooter>";
19069 $line = preg_replace('/{iteration ([a-zA-Z0-9_]+)}/', '\\1', $line);
19403 $c['h'] = isset($c['h']) ? $c['h'] /= $k : null;
19434 $a = (ord($s[0]) << 8) + ord($s[1]);
19435 if ($a & (1 << 15)) {
19436 $a = ($a - (1 << 16));
19438 return $a;
19525 // table Array of (w, h, bc, nr, wc, hr, cells)
19527 // h Height of table
19532 // cells List of cells of each rows, cells[i][j] is a cell in the table
19578 if (substr($c['a'], 0, 1) == 'D') {
19632 // If minimum width has already been set by a nested table or inline object (image/form), use it
19643 // If maximum width has already been set by a nested table, use it
19799 // mPDF 5.7.2 Extra min width distributed proportionately to all cells in colspan without a specified width
19820 // mPDF 5.7.4 Extra max width distributed evenly to all cells in colspan without a specified width
19852 // Set a nominal width of 1% for unset columns
20325 $temppgheight = ($this->h - $this->bMargin - $this->tMargin) - $this->kwt_height;
20326 $remainingpage = ($this->h - $this->bMargin - $this->y) - $this->kwt_height;
20421 if (isset($c['h']) && $c['h'] > $ch) {
20423 $ch = $c['h'];
20433 // this is the extra used in _tableWrite to determine whether to trigger a page change
20488 if (isset($tc['h'])) {
20535 } elseif (!count($list)) { // no rows in the rowspan have a height specified, so share amongst all rows equally
20549 // If rowspans overlap so that one or more rows do not have a height set...
20589 // By columns add up col height using ['h'] if set or ['mih'] if not
20598 if (isset($c['h']) && $c['h']) {
20599 $useh = $c['h'];
20626 $table['h'] = array_sum($heightrow);
20630 $table['h'] += $table['margin']['T'] + $table['margin']['B'] + $table['border_details']['T']['w'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] + $table['padding']['T'] + $table['padding']['B'];
20632 $table['h'] += $table['margin']['T'] + $table['margin']['B'] + $table['max_cell_border_width']['T'] / 2 + $table['max_cell_border_width']['B'] / 2;
20637 return [$table['h'], $maxrowheight, $temppgheight, $remainingpage, $maxfirstrowheight];
20707 $h = $heightrow[$i];
20711 $h += $heightrow[$k];
20713 $this->logger->debug('Possible non-wellformed HTML markup in a table', ['context' => LogContext::HTML_MARKUP]);
20718 $cell['h0'] = $h;
20719 return [$y, $h];
20751 function _tableRect($x, $y, $w, $h, $bord = -1, $details = [], $buffer = false, $bSeparate = false, $cort = 'cell', $tablecorner = '', $bsv = 0, $bsh = 0)
20756 $this->Rect($x, $y, $w, $h);
20765 $this->Rect($x, $y, $w, $h);
20815 $this->cellBorderBuffer[] = pack("A16nCnda6A10d14", str_pad(sprintf("%08.7f", $dom), 16, "0", STR_PAD_LEFT), $cbord, ord($side), $details[$side]['s'], $details[$side]['w'], $details[$side]['c'], $details[$side]['style'], $x, $y, $w, $h, $details['mbw']['BL'], $details['mbw']['BR'], $details['mbw']['RT'], $details['mbw']['RB'], $details['mbw']['TL'], $details['mbw']['TR'], $details['mbw']['LT'], $details['mbw']['LB'], $details['cellposdom'], 0);
20818 $this->cellBorderBuffer[] = pack("A16nCnda6A10d14", str_pad(sprintf("%08.7f", ($dom + 4)), 16, "0", STR_PAD_LEFT), $cbord, ord($side), $details[$side]['s'], $details[$side]['w'], $details[$side]['c'], $details[$side]['style'], $x, $y, $w, $h, $details['mbw']['BL'], $details['mbw']['BR'], $details['mbw']['RT'], $details['mbw']['RB'], $details['mbw']['TL'], $details['mbw']['TR'], $details['mbw']['LT'], $details['mbw']['LB'], $details['cellposdom'], 1);
20848 $y2 = $y + $h;
21936 $this->PageBreakTrigger = $pagetrigger = ($this->h - $this->bMargin);
21939 if (isset($table['a']) and ( $table['w'] < $this->blk[$this->blklvl]['inner_width'])) {
21940 if ($table['a'] == 'C') {
21942 } elseif ($table['a'] == 'R') {
21955 $this->tableClipPath = sprintf('q %.3F %.3F %.3F %.3F re W n', $x0 * Mpdf::SCALE, $this->h * Mpdf::SCALE, $this->blk[$this->blklvl]['inner_width'] * Mpdf::SCALE, -$this->h * Mpdf::SCALE);
21991 $y = $h = 0;
22012 list($y, $h) = $this->_tableGetHeight($table, $i, $j);
22018 $tablefooter[$i][$js]['h'] = $h;
22025 $tablefooter[$i][$js]['a'] = $cell['a'];
22116 list($y, $h) = $this->_tableGetHeight($table, $i, $j);
22138 // Are there more columns to print on a next page?
22232 if ($tablestartpageno != $this->page) { // IF already broken across a previous pagebreak
22302 $this->tableBackgrounds[$level * 9][] = ['gradient' => false, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'col' => $color];
22310 $this->tableBackgrounds[$level * 9 + 1][] = ['gradient' => true, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
22318 $this->tableBackgrounds[$level * 9 + 1][] = ['gradient' => true, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
22331 $this->tableBackgrounds[$level * 9 + 2][] = ['x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => '', 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
22473 if ($this->CurrCol == 0) { // just added a page - possibly with tableheader
22520 $align = $cell['a'];
22588 $this->Rect($x - $xadj, $y - $yadj, $w + $wadj, $h + $hadj, 'F');
22634 $this->Rect($x + ($table['border_spacing_H'] / 2), $y + ($table['border_spacing_V'] / 2), $w - $table['border_spacing_H'], $h - $table['border_spacing_V'], 'F');
22636 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => ($x + ($table['border_spacing_H'] / 2)), 'y' => ($y + ($table['border_spacing_V'] / 2)), 'w' => ($w - $table['border_spacing_H']), 'h' => ($h - $table['border_spacing_V']), 'col' => $color];
22641 $this->Rect($x, $y, $w, $h, 'F');
22643 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'col' => $color];
22657 $ph = $h - $table['border_spacing_V'];
22662 $ph = $h;
22667 $this->tableBackgrounds[$level * 9 + 7][] = ['gradient' => true, 'x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
22680 $ph = $h - $table['border_spacing_V'];
22685 $ph = $h;
22690 $this->tableBackgrounds[$level * 9 + 7][] = ['gradient' => true, 'x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
22699 $ph = $h - $table['border_spacing_V'];
22704 $ph = $h;
22708 $this->patterns[$n] = ['x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'pgh' => $this->h, 'image_id' => $cell['background-image']['image_id'], 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $cell['background-image']['x_pos'], 'y_pos' => $cell['background-image']['y_pos'], 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat];
22714 $this->writer->write(sprintf('q /Pattern cs /P%d scn %s %.3F %.3F %.3F %.3F re f Q', $n, $opac, $px * Mpdf::SCALE, ($this->h - $py) * Mpdf::SCALE, $pw * Mpdf::SCALE, -$ph * Mpdf::SCALE));
22726 $this->tableBackgrounds[$level * 9 + 8][] = ['x' => $px, 'y' => $py, 'w' => $pw, 'h' => $ph, 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => '', 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
22770 $tableheader[$i][$j]['h'] = $h;
22777 $tableheader[$i][$j]['a'] = $cell['a'];
22813 $this->_tableRect($x + ($table['border_spacing_H'] / 2) + ($bord_det['L']['w'] / 2), $y + ($table['border_spacing_V'] / 2) + ($bord_det['T']['w'] / 2), $w - $table['border_spacing_H'] - ($bord_det['L']['w'] / 2) - ($bord_det['R']['w'] / 2), $h - $table['border_spacing_V'] - ($bord_det['T']['w'] / 2) - ($bord_det['B']['w'] / 2), $bord, $bord_det, false, $table['borders_separate']);
22815 $this->_tableRect($x, $y, $w, $h, $bord, $bord_det, true, $table['borders_separate']); // true causes buffer
22824 $this->y += ($h - $cell['mih']) / 2;
22826 $this->y += $h - $cell['mih'];
22856 if (preg_match('/{iteration ([a-zA-Z0-9_]+)}/', $t[0], $m)) {
22886 if (isset($cell['a']) && $cell['a'] == 'R') {
22888 } elseif (!isset($cell['a']) || $cell['a'] == 'C') {
22899 $this->y -= ($h - $cell['mih']) / 2; // Undo what was added earlier VERTICAL ALIGN
22901 $this->y += (($h - $cell['mih']) / 2) + $cell['padding']['T'] + ($cell['mih'] - ($cell['padding']['T'] + $cell['padding']['B']));
22903 $this->y += (($h - $cell['mih']) / 2) + ($cell['padding']['T'] + ($table['border_spacing_V'] / 2));
22906 $this->y -= $h - $cell['mih']; // Undo what was added earlier VERTICAL ALIGN
22908 $this->y += $h - ($cell['padding']['B'] + ($table['border_spacing_V'] / 2));
22910 $this->y += $h - $cell['mih'] + ($cell['padding']['T'] + ($table['border_spacing_V'] / 2));
22967 if (substr($cell['a'], 0, 1) == 'D') {
22969 $this->cellTextAlign = $c['a'] = substr($cell['a'], 2, 1);
22976 if (substr($cell['a'], 2, 1) == 'R') {
22978 } elseif (substr($cell['a'], 2, 1) == 'C') {
23002 $gh = $h;
23009 $clh = $h - $table['border_spacing_V'];
23012 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
23014 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
23024 $gh = $h;
23031 $clh = $h - $table['border_spacing_V'];
23034 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
23036 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
23053 $gh = $h;
23060 $clh = $h - $table['border_spacing_V'];
23063 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => $s, 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
23065 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx, 'y' => $gy, 'w' => $gw, 'h' => $gh, 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => '', 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
23082 $tbh = $h;
23123 $this->breakpoints[$this->CurrCol][] = $y + $h;
23132 $this->y = $y + $h;
23135 $this->tbrot_h += $h;
23221 $this->tableBackgrounds[$level * 9][] = ['gradient' => false, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'col' => $color];
23229 $this->tableBackgrounds[$level * 9 + 1][] = ['gradient' => true, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
23237 $this->tableBackgrounds[$level * 9 + 1][] = ['gradient' => true, 'x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => ''];
23250 $this->tableBackgrounds[$level * 9 + 2][] = ['x' => $bx, 'y' => $by, 'w' => $bw, 'h' => $bh, 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => '', 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
23292 // Are there more columns to print on a next page?
23360 * Initiate, and Mark a place for the Table of Contents to be inserted
23391 function TOCpagebreakByArray($a)
23393 if (!is_array($a)) {
23394 $a = [];
23396 $tocoutdent = (isset($a['tocoutdent']) ? $a['tocoutdent'] : (isset($a['outdent']) ? $a['outdent'] : ''));
23397 $TOCusePaging = (isset($a['TOCusePaging']) ? $a['TOCusePaging'] : (isset($a['paging']) ? $a['paging'] : true));
23398 $TOCuseLinking = (isset($a['TOCuseLinking']) ? $a['TOCuseLinking'] : (isset($a['links']) ? $a['links'] : ''));
23399 $toc_orientation = (isset($a['toc_orientation']) ? $a['toc_orientation'] : (isset($a['toc-orientation']) ? $a['toc-orientation'] : ''));
23400 $toc_mgl = (isset($a['toc_mgl']) ? $a['toc_mgl'] : (isset($a['toc-margin-left']) ? $a['toc-margin-left'] : ''));
23401 $toc_mgr = (isset($a['toc_mgr']) ? $a['toc_mgr'] : (isset($a['toc-margin-right']) ? $a['toc-margin-right'] : ''));
23402 $toc_mgt = (isset($a['toc_mgt']) ? $a['toc_mgt'] : (isset($a['toc-margin-top']) ? $a['toc-margin-top'] : ''));
23403 $toc_mgb = (isset($a['toc_mgb']) ? $a['toc_mgb'] : (isset($a['toc-margin-bottom']) ? $a['toc-margin-bottom'] : ''));
23404 $toc_mgh = (isset($a['toc_mgh']) ? $a['toc_mgh'] : (isset($a['toc-margin-header']) ? $a['toc-margin-header'] : ''));
23405 $toc_mgf = (isset($a['toc_mgf']) ? $a['toc_mgf'] : (isset($a['toc-margin-footer']) ? $a['toc-margin-footer'] : ''));
23406 $toc_ohname = (isset($a['toc_ohname']) ? $a['toc_ohname'] : (isset($a['toc-odd-header-name']) ? $a['toc-odd-header-name'] : ''));
23407 $toc_ehname = (isset($a['toc_ehname']) ? $a['toc_ehname'] : (isset($a['toc-even-header-name']) ? $a['toc-even-header-name'] : ''));
23408 $toc_ofname = (isset($a['toc_ofname']) ? $a['toc_ofname'] : (isset($a['toc-odd-footer-name']) ? $a['toc-odd-footer-name'] : ''));
23409 $toc_efname = (isset($a['toc_efname']) ? $a['toc_efname'] : (isset($a['toc-even-footer-name']) ? $a['toc-even-footer-name'] : ''));
23410 $toc_ohvalue = (isset($a['toc_ohvalue']) ? $a['toc_ohvalue'] : (isset($a['toc-odd-header-value']) ? $a['toc-odd-header-value'] : 0));
23411 $toc_ehvalue = (isset($a['toc_ehvalue']) ? $a['toc_ehvalue'] : (isset($a['toc-even-header-value']) ? $a['toc-even-header-value'] : 0));
23412 $toc_ofvalue = (isset($a['toc_ofvalue']) ? $a['toc_ofvalue'] : (isset($a['toc-odd-footer-value']) ? $a['toc-odd-footer-value'] : 0));
23413 $toc_efvalue = (isset($a['toc_efvalue']) ? $a['toc_efvalue'] : (isset($a['toc-even-footer-value']) ? $a['toc-even-footer-value'] : 0));
23414 $toc_preHTML = (isset($a['toc_preHTML']) ? $a['toc_preHTML'] : (isset($a['toc-preHTML']) ? $a['toc-preHTML'] : ''));
23415 $toc_postHTML = (isset($a['toc_postHTML']) ? $a['toc_postHTML'] : (isset($a['toc-postHTML']) ? $a['toc-postHTML'] : ''));
23416 $toc_bookmarkText = (isset($a['toc_bookmarkText']) ? $a['toc_bookmarkText'] : (isset($a['toc-bookmarkText']) ? $a['toc-bookmarkText'] : ''));
23417 $resetpagenum = (isset($a['resetpagenum']) ? $a['resetpagenum'] : '');
23418 $pagenumstyle = (isset($a['pagenumstyle']) ? $a['pagenumstyle'] : '');
23419 $suppress = (isset($a['suppress']) ? $a['suppress'] : '');
23420 $orientation = (isset($a['orientation']) ? $a['orientation'] : '');
23421 $mgl = (isset($a['mgl']) ? $a['mgl'] : (isset($a['margin-left']) ? $a['margin-left'] : ''));
23422 $mgr = (isset($a['mgr']) ? $a['mgr'] : (isset($a['margin-right']) ? $a['margin-right'] : ''));
23423 $mgt = (isset($a['mgt']) ? $a['mgt'] : (isset($a['margin-top']) ? $a['margin-top'] : ''));
23424 $mgb = (isset($a['mgb']) ? $a['mgb'] : (isset($a['margin-bottom']) ? $a['margin-bottom'] : ''));
23425 $mgh = (isset($a['mgh']) ? $a['mgh'] : (isset($a['margin-header']) ? $a['margin-header'] : ''));
23426 $mgf = (isset($a['mgf']) ? $a['mgf'] : (isset($a['margin-footer']) ? $a['margin-footer'] : ''));
23427 $ohname = (isset($a['ohname']) ? $a['ohname'] : (isset($a['odd-header-name']) ? $a['odd-header-name'] : ''));
23428 $ehname = (isset($a['ehname']) ? $a['ehname'] : (isset($a['even-header-name']) ? $a['even-header-name'] : ''));
23429 $ofname = (isset($a['ofname']) ? $a['ofname'] : (isset($a['odd-footer-name']) ? $a['odd-footer-name'] : ''));
23430 $efname = (isset($a['efname']) ? $a['efname'] : (isset($a['even-footer-name']) ? $a['even-footer-name'] : ''));
23431 $ohvalue = (isset($a['ohvalue']) ? $a['ohvalue'] : (isset($a['odd-header-value']) ? $a['odd-header-value'] : 0));
23432 $ehvalue = (isset($a['ehvalue']) ? $a['ehvalue'] : (isset($a['even-header-value']) ? $a['even-header-value'] : 0));
23433 $ofvalue = (isset($a['ofvalue']) ? $a['ofvalue'] : (isset($a['odd-footer-value']) ? $a['odd-footer-value'] : 0));
23434 $efvalue = (isset($a['efvalue']) ? $a['efvalue'] : (isset($a['even-footer-value']) ? $a['even-footer-value'] : 0));
23435 $toc_id = (isset($a['toc_id']) ? $a['toc_id'] : (isset($a['name']) ? $a['name'] : 0));
23436 $pagesel = (isset($a['pagesel']) ? $a['pagesel'] : (isset($a['pageselector']) ? $a['pageselector'] : ''));
23437 $toc_pagesel = (isset($a['toc_pagesel']) ? $a['toc_pagesel'] : (isset($a['toc-pageselector']) ? $a['toc-pageselector'] : ''));
23438 $sheetsize = (isset($a['sheetsize']) ? $a['sheetsize'] : (isset($a['sheet-size']) ? $a['sheet-size'] : ''));
23439 $toc_sheetsize = (isset($a['toc_sheetsize']) ? $a['toc_sheetsize'] : (isset($a['toc-sheet-size']) ? $a['toc-sheet-size'] : ''));
23446 // Start a new page
23451 // Don't add a page
23514 // move a page/pages EARLIER in the document
23772 // move a page/pages EARLIER in the document
23980 // Added function to add a reference "Elephants. See Chickens"
24029 // $subEntryInset specifies what precedes a subentry (if $this->indexUseSubentries == true;) e.g.
24084 usort($this->Reference, function ($a, $b) {
24085 return strcoll(strtolower($a['uf']), strtolower($b['uf']));
24109 $a = preg_split('/(<.*?>)/', $txt, -1, PREG_SPLIT_DELIM_CAPTURE);
24112 foreach ($a as $k => $e) {
24157 $html .= '<a class="mpdf_index_link" href="@' . $range_start . '">';
24161 $html .= '</a>';
24166 $html .= '<a class="mpdf_index_link" href="@' . $ppp[$zi - 1] . '">';
24170 $html .= '</a>';
24176 $html .= '<a class="mpdf_index_link" href="@' . $ppp[$zi - 1] . '">';
24180 $html .= '</a>';
24191 $html .= '<a class="mpdf_index_link" href="@' . $range_start . '">';
24196 $html .= '</a>';
24200 $html .= '<a class="mpdf_index_link" href="@' . $range_end . '">';
24204 $html .= '</a>';
24210 $html .= '</a>';
24215 $html .= '<a class="mpdf_index_link" href="@' . $ppp[(count($ppp) - 1)] . '">';
24219 $html .= '</a>';
24372 // Set position on a column
24426 // Columns ended (but page not ended) -> try to match all columns - unless disabled by using a custom column-break
24523 $block_bottom = max($block_bottom, ($s['rel_y'] + $s['h']));
24552 $clb = $s['y'] + $yadj + $s['h']; // bottom_margin of current
24706 $clb = $s['y'] + $s['h'];
24831 $clb = $s['y'] + $s['h'];
24961 $this->_tableRect($cba['x'], $cba['y'], $cba['w'], $cba['h'], $cba['bord'], $details, false, false);
25055 $h = $v[3] / Mpdf::SCALE;
25060 $bx = $this->tbrot_x0 + $xadj - $ay - $h;
25068 $v[1] = ($this->h - $by) * Mpdf::SCALE;
25069 $v[2] = $h * Mpdf::SCALE; // swap width and height
25232 $v[1] = ($this->h - $by) * Mpdf::SCALE;
25352 $h = $this->h;
25354 $this->writer->write(sprintf('%.3F %.3F m %.3F %.3F %.3F %.3F %.3F %.3F c', ($x + $rx) * Mpdf::SCALE, ($h - $y) * Mpdf::SCALE, ($x + $rx) * Mpdf::SCALE, ($h - ($y - $ly)) * Mpdf::SCALE, ($x + $lx) * Mpdf::SCALE, ($h - ($y - $ry)) * Mpdf::SCALE, $x * Mpdf::SCALE, ($h - ($y - $ry)) * Mpdf::SCALE));
25355 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c', ($x - $lx) * Mpdf::SCALE, ($h - ($y - $ry)) * Mpdf::SCALE, ($x - $rx) * Mpdf::SCALE, ($h - ($y - $ly)) * Mpdf::SCALE, ($x - $rx) * Mpdf::SCALE, ($h - $y) * Mpdf::SCALE));
25356 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c', ($x - $rx) * Mpdf::SCALE, ($h - ($y + $ly)) * Mpdf::SCALE, ($x - $lx) * Mpdf::SCALE, ($h - ($y + $ry)) * Mpdf::SCALE, $x * Mpdf::SCALE, ($h - ($y + $ry)) * Mpdf::SCALE));
25357 $this->writer->write(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c %s', ($x + $lx) * Mpdf::SCALE, ($h - ($y + $ry)) * Mpdf::SCALE, ($x + $rx) * Mpdf::SCALE, ($h - ($y + $ly)) * Mpdf::SCALE, ($x + $rx) * Mpdf::SCALE, ($h - $y) * Mpdf::SCALE, $op));
25462 // NB Returned $chunk may be a shorter string (with adjusted $cOTLdata) by removal of LRE, RLE etc embedding codes.
25558 $a = preg_split('/(<.*?>)/ms', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
25560 foreach ($a as $i => $e) {
25615 $this->subArrMB['a'] = $aarr;
25622 if (($char > 127 || ($flag == 1 && $char == 32)) && $char != 173 && (!isset($this->subArrMB['a'][$char]) || ($flag == 1 && $char == 32)) && ($char < 1536 || ($char > 1791 && $char < 2304) || $char > 3455)) {
25767 // Check if current CJK font has a ext-B related font
25866 $this->subArrMB['a'] = $aarr;
25870 if (isset($this->subArrMB['a'][$u[0]])) {
25874 if (isset($this->subArrMB['a'][$char])) {
25875 $repl[] = $this->subArrMB['a'][$char];
26032 $a = @iconv('UTF-8', 'UTF-8', $html);
26038 $pos = $start = strlen($a);
26158 $size /= $k; // in case resized in a table
26227 // draw a vertical bar
26442 // draw a vertical bar
26502 $size /= $k; // in case resized in a table
26553 $this->Rect($xpos, $ypos, $bw, ($v['h'] * $bch / $arrcode['maxh']), 'F');
26606 $y = ($this->h - $y) * Mpdf::SCALE;
26658 $y = ($this->h - $y) * Mpdf::SCALE;
26695 $y = ($this->h - $y) * Mpdf::SCALE;
26731 $a = preg_split('/<(.*?)>/ms', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
26732 foreach ($a as $i => $e) {
26736 if ($i > 0 && strtolower(substr($a[$i - 1], 1, 8)) == 'textarea') {
26737 $a[$i] = $e;
26764 // Start a new subchunk
26835 $a[$i] = $o;
26837 $a[$i] = '<' . $e . '>';
26841 $n = implode('', $a);
26850 function columnAdjustAdd($type, $k, $xadj, $yadj, $a, $b, $c = 0, $d = 0, $e = 0, $f = 0)
26854 $a += ($xadj * $k);
26857 return 'BT ' . sprintf('%.3F %.3F', $a, $b) . ' Td';
26861 $a += ($xadj * $k);
26864 return sprintf('%.3F %.3F %.3F %.3F', $a, $b, $c, $d) . ' re';
26868 $a += ($xadj * $k);
26871 return sprintf('%.3F %.3F l', $a, $b);
26878 return sprintf('q %.3F 0 0 %.3F %.3F %.3F', $a, $b, $c, $d) . ' cm /' . $e;
26882 $a += ($xadj * $k);
26885 return sprintf('%.3F %.3F m', $a, $b);
26889 $a += ($xadj * $k);
26896 return sprintf('%.3F %.3F %.3F %.3F %.3F %.3F', $a, $b, $c, $d, $e, $f) . ' c';
26957 'mPDF will not process HTML with disabled pcre.backtrack_limit to prevent unexpected behaviours, please set a positive backtrack limit.',
27009 $html = preg_replace("/[ \n\r]+<\/t(d|h)/", '</t\\1', $html);
27026 $h = [];
27041 array_push($h, $s);
27044 $html = implode('', $h);
27054 // Converts < to &lt; when not a tag
27055 $html = preg_replace('/<([^!\/a-zA-Z_:])/i', '&lt;\\1', $html); // mPDF 5.7.3
27073 // Fix self-closing tags that don't include a space between the tag name and the closing slash
27078 $temp[2][$iterator] = preg_replace('/<([^!\/a-zA-Z_:])/', '&lt;\\1', $temp[2][$iterator]); // mPDF 5.7.2 // mPDF 5.7.3
27110 $html = preg_replace('/<(h[1-6])([^>]*)(>(?:(?!h[1-6]).)*?<\/\\1>\s*<table)/si', '<\\1\\2 keep-with-table="1"\\3', $html); // *TABLES*
27114 $html = preg_replace("/(&#[x]{0,1}[0-9a-f]{1,5})</i", "\\1;<", $html);
27244 // We send to a browser
27299 $h = 0;
27316 $h = max($h, $size['height']);
27317 $maxh = max($h, $maxh);
27320 if (($y + $h + $spacing + $maxh) > $this->PageBreakTrigger && $n != $pagecount) {
27325 $y += $h + $spacing;
27327 $h = 0;
27375 * This function takes the last comma or dot (if any) to make a clean float, ignoring thousand separator, currency or any other letter