Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

dompdf doesnt give error, but the result is an empty pdf file

373 views
Skip to first unread message

Robert Ney

unread,
Jul 29, 2021, 5:10:17 PM7/29/21
to dompdf
After passing perfectly good html, the resulting downloaded pdf file is 1137 bytes and contains what appears to be a very nicely formatted empty document.

The html being passed in is fairly complex and 1400 lines long.
I have run it through a validator and its perfect so I am not sure what to do now to make this work. A previous version of this html that was much simpler works just fine.

Any thoughts would be appreciated.


Thanks.

Code snippet is included below.

$options = new Options();
$options->set('isRemoteEnabled', TRUE);
$dompdf = new Dompdf($options);
$context = stream_context_create([
'ssl' => [
'verify_peer' => FALSE,
'verify_peer_name' => FALSE,
'allow_self_signed'=> TRUE
]
]);
$dompdf->setHttpContext($context);
$dompdf->setPaper('letter', 'portrait');
$dompdf->loadHtml($str_invoice_body);
$dompdf->render();
$dompdf->stream($obj_invoice->str_shipname."-".date("Ymd", $obj_invoice->int_issue_date)."-".$obj_invoice->int_invoice_id.".pdf");
Reply all
Reply to author
Forward
0 new messages