private function printRelatorioHTMLPDF($html) { $this->getContext()->getConfiguration()->loadHelpers('Partial'); $mpdf = new mPDF('', 'A4', '', '', 5, 5, 37, 37, 3, 3); $mpdf->useOnlyCoreFonts = true; // false is default $mpdf->SetWatermarkText("PÉROLA NEGRA"); $mpdf->showWatermarkText = true; $mpdf->watermark_font = 'DejaVuSansCondensed'; $mpdf->watermarkTextAlpha = 0.1; $mpdf->SetDisplayMode('fullpage'); $stylesheet = file_get_contents('css/relatorios.css'); $mpdf->WriteHTML($stylesheet, 1); $mpdf->SetHTMLHeader(utf8_encode(get_partial('header'))); $mpdf->SetHTMLFooter(utf8_encode(get_partial('footer'))); $mpdf->SetMargins(0, 0, 65); $mpdf->WriteHTML(utf8_encode($html)); $mpdf->Output(); }
public function __construct(){ $this->carregar(); $this->mpfd = new \mPDF(); $this->mpfd->charset_in='UTF-8'; $this->mpfd->SetMargins(5, 5, 5); }