How to use pdf in custom files? (v2022)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
feligo
User
Posts: 1

How to use pdf in custom files? (v2022)

Post by feligo »

The following code is not working:

$html = "<h1> WELCOME TO PHP Dompdf </h1>";

use Dompdf\Dompdf;

ob_get_clean(); // Clear Buffer - this is very important!!!

$document = new Dompdf();
$document->loadHtml($html);
//$document->setPaper('A4', 'portrait');
$document->setPaper("A4", "$orientation");
$document->render();
$document->stream("Payslips", array("Attachment"=>0));


arbei
User
Posts: 9348

Post by arbei »

In general, Custom Files ares used to add your own pages to your site, not to output files. If you just want to output files, you better use route actions, see viewtopic.php?t=49447.


Post Reply