So I am using dompdf to create pdfs of html. Which works really good, the only problem is when the html is too big and dompdf creates it over two pages. Is there a way maybe in dompdf or in html to scale it to one page only?
Help would be greatly appreciated! Thank you!
Here is my config and my code to create pdfs.
define("DOMPDF_ENABLE_HTML5PARSER", true);
define("DOMPDF_ENABLE_FONTSUBSETTING", true);
define("DOMPDF_UNICODE_ENABLED", true);
define("DOMPDF_DPI", 120);
define("DOMPDF_ENABLE_REMOTE", true);
require_once 'dompdf/dompdf_config.inc.php';
$dompdf = new \DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "portrait");
$dompdf->render();
$dompdf->stream("page.pdf", array("Attachment" => 0));
Sorry, but there is NO setting in DOMPDF to do that.
To achieve your needs, you have to play with CSS files to custom your images size or text font size
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With