Problem displaying a content more than one page in dompdf 0.6.0 beta 3

2,715 views
Skip to first unread message

Oyinbo

unread,
May 31, 2012, 7:23:38 AM5/31/12
to dompdf
Hi All,

I used Dompdf to generate PDF invoice from HTML (div and css rather
than table) and it works well when the content is just one page.
However, it’s not working when the content is more than one page. I
will appreciate your contribution.

Thanks

BrianS

unread,
Jun 4, 2012, 11:00:41 PM6/4/12
to dom...@googlegroups.com
What, exactly, is the problem when the content is more than one page. Does the PDF not render? Do you get an error? Does it just not look correct? If you can post a sample document we can run it and look for problems.

Oyinbo

unread,
Jun 5, 2012, 5:48:53 PM6/5/12
to dompdf
Thank you for your response, this is the link to the HTML and CSS code
http://jsfiddle.net/HYFr6/
I'm using PHP Template to generate the content and this is my PHP code

ob_start();
$t->p("MyOutput"); //html content from template
$file_data = ob_get_contents();
ob_clean();

require_once("./dompdf/dompdf_config.inc.php");
$old_limit = ini_set("memory_limit", "128M");
$dompdf = new DOMPDF();
$dompdf->set_paper('ledger', 'portrait');
$dompdf->load_html($file_data);
$dompdf->render();
$file_name="Invoice_".date( "d M-Y G:i:s" ,$inv_date )."-".
$data[inv_number].".pdf";
$dompdf->stream($file_name);

Everything worked fine when the content was within one page but if
more than one page, nothing will be displayed not even an error
message.

BrianS

unread,
Jun 5, 2012, 10:11:39 PM6/5/12
to dom...@googlegroups.com
Your document may just be too much for dompdf to handle right now. Float support is still in development and I think dompdf is having trouble keeping track of all the nodes, especially across pages. I was able to render your document by making a few minor modifications and increasing my server's available memory, but even then after about 20 rows dompdf seems unable to render the rows correctly.

In truth, you may have better luck rendering this line item table as, well ... as a table. This is appropriate content for a table. And so long as no single cell is larger than a page it should render ok.
Reply all
Reply to author
Forward
0 new messages