Dear all,I added this in ListOptions_Rendering:-
option 1. (without export=pdf)
$this->ListOptions->Items[“dlpdf”]->Body = “<a href="genpdf.php?id=”. CurrentPage()->id->CurrentValue .“" title="Download PDF" target="_blank"><span class="fa fa-file-pdf-o ew-icon" style="color: red">”;
option 2. (with export=pdf)
$this->ListOptions->Items[“dlpdf”]->Body = “<a href="genpdf.php?export=pdf&id=”. CurrentPage()->id->CurrentValue .“" title="Download PDF" target="_blank"><span class="fa fa-file-pdf-o ew-icon" style="color: red">”;So, I coded the custom file genpdf.php (with include common files checked) as
The results is OKAY.Now, with Tools → Extensions → dompdf (Enabled)
I modified the custom files genpdf.php (with include common files checked)
Error message => PHP Fatal error: Uncaught Error: Class ‘PHPMaker2020\testproj\Dompdf\Dompdf’ not found in /var/www/html/testproj/dlpdf.php:34\nStack trace:\n#0 {main}\n thrown in /var/www/html/testproj/dlpdf.php on line 34<?php
$dompdf = new \Dompdf\Dompdf();
$dompdf->set_option('defaultFont', 'Courier'); // with or without this line
$dompdf->loadHtml('hello world');
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream();
?>
Error message => PHP Fatal error: Uncaught Dompdf\Exception: Unable to find a suitable font replacement for: ‘serif’ in /var/www/html/testproj/vendor/hkvstore/dompdf/src/Css/Style.php:997\nStack trace:\n#0 /var/www/html/testproj/vendor/hkvstore/dompdf/src/Css/Style.php(851): Dompdf\Css\Style->get_font_family()\n#1 /var/www/html/testproj/vendor/hkvstore/dompdf/src/FrameReflower/Text.php(194): Dompdf\Css\Style->__get(‘font_family’)\n#2 /var/www/html/testproj/vendor/hkvstore/dompdf/src/FrameReflower/Text.php(372): Dompdf\FrameReflower\Text->_layout_line()\n#3 /var/www/html/testproj/vendor/hkvstore/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(895): Dompdf\FrameReflower\Text->reflow(Object(Dompdf\FrameDecorator\Block))\n#4 /var/www/html/testproj/vendor/hkvstore/dompdf/src/FrameReflower/Block.php(845): Dompdf\FrameDecorator\AbstractFrameDecorator->reflow(Object(Dompdf\FrameDecorator\Block))\n#5 /var/www/html/testproj/vendor/hkvstore/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(895): Dompdf\FrameReflower\Block->reflow(Object(Dompdf\FrameDecorator\ in /var/www/html/testproj/vendor/hkvstore/dompdf/src/Css/Style.php on line 997But if I click on the default export to pdf for table, the result is fine. Just can’t use dompdf in custom files.Did I miss out any important step(s) on Custom Files to generate stream pdf?Thank in advance.Regards
scs