PdfRenderer example

$html,
            '1001',
            InvoiceRenderer::TYPE,
            FileTypes::PDF,
            ['displayFooter' => true]
        );

        static::assertStringContainsString('<html>', $rendered->getHtml());
        static::assertStringContainsString('</html>', $rendered->getHtml());
        static::assertStringContainsString('DOMPDF_PAGE_COUNT_PLACEHOLDER', $rendered->getHtml());

        $pdfRenderer = new PdfRenderer([
            'isRemoteEnabled' => true,
            'isHtml5ParserEnabled' => true,
        ]);
        $generatorOutput = $pdfRenderer->render($rendered);
        static::assertNotEmpty($generatorOutput);

        $finfo = new \finfo(\FILEINFO_MIME_TYPE);
        static::assertEquals('application/pdf', $finfo->buffer($generatorOutput));
    }
}
Home | Imprint | This part of the site doesn't use cookies.