Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Div tag doesn't work in Dompdf 1

Status
Not open for further replies.

sd0t1

IS-IT--Management
Mar 14, 2007
131
US
I am using dompdf to print a certificate of completion. However I'm having trouble making tables stay in place and act right. So I figured I'd use a div box, but it won't display at all. It times out and won't open.

Any idea why dompdf doesn't like DIV tags?????

here is the div tag:(certificat.html)

<div id="box" style="width:1100px; border:double #0099CC; height:900px; padding:25px">

hello


</div>

Here is the dompdf page:

$myFile = "certificate.html";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);



$html = $theData;

$size = 'letter';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper($size, "Landscape");


$dompdf->render();
$dompdf->stream("my_pdf.pdf", array("Attachment" => 0));
 
interesting. the same code does not work on the demo page of dompdf's website.

what did dompdf's author say when you asked him about this error?
 
Great advice, I got with the guys over at dompdf's site.
Basically it didn't work because my size is bigger than allowed.

So I reduced the size and it worked fine.
 
that's curious.

i tried their demo site with no style attributes at all, and it still failed. maybe it was a cache issue.

glad you got it sorted. what was the max width allowed in the end?
 
Well I never tried the max, so I'm not sure what it is.

I needed to put a border around a sheet of 8.5 x 11 paper.

So I just did it in inches 8 x 10 and it worked fine.
 
good tip. so i guess we should create a separate print media css declaration for dompdf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top