/** * Tests generating actual output. */ public function testOutput() { $Pdf = new CakePdf(['engine' => 'CakePdf.Dompdf']); $Pdf->html('<foo>bar</foo>'); $output = $Pdf->engine()->output(); $this->assertStringStartsWith('%PDF-1.3', $output); $this->assertStringEndsWith("%%EOF\n", $output); }
/** * Renders the Dompdf instance. * * @param CakePdf $Pdf The CakePdf instance that supplies the content to render. * @param Dompdf $DomPDF The Dompdf instance to render. * @return Dompdf */ protected function _render($Pdf, $DomPDF) { $DomPDF->loadHtml($Pdf->html()); $DomPDF->render(); return $DomPDF; }