Uncaught Dompdf\Exception: No block-level parent found. Not good.

79 views
Skip to first unread message

Anil kumar

unread,
May 13, 2021, 4:03:33 PM5/13/21
to dompdf
Hi while I am calling html file.
using
require_once 'dompdf/autoload.inc.php';

// reference the Dompdf namespace

use Dompdf\Dompdf;

//initialize dompdf class

$document = new Dompdf();
$page = file_get_contents("cat.html");

$document->loadHtml($page);

//set page size and orientation

$document->setPaper('A4', 'landscape');

//Render the HTML as PDF

$document->render();

//Get output of generated pdf in Browser

$document->stream("Webslesson", array("Attachment"=>0));

getting above mentioned error.
Reply all
Reply to author
Forward
0 new messages