Blank page with no errer reporting - HELP!

5,197 views
Skip to first unread message

fearghalm

unread,
Jul 28, 2009, 6:48:42 AM7/28/09
to dompdf
Hi all,

I'm trying to parse a (large) HTML table (no css, javascript etc) no
just getting a blank page...

Using the example code:


if ( isset( $_POST["html"] ) ) {

if ( get_magic_quotes_gpc() )
$_POST["html"] = stripslashes($_POST["html"]);
$_POST["html"] = str_replace("<th>","<tr>",$_POST["html"]);
$_POST["html"] = str_replace("</th>","</tr>",$_POST["html"]);


$dompdf = new DOMPDF();
$dompdf->load_html($_POST["html"]);
$dompdf->set_paper($_POST["paper"], $_POST["orientation"]);
$pdf = $dompdf->output();

exit(0);
}


But no errors to tell me whats wrong...any ideas anyone?

BrianS

unread,
Jul 28, 2009, 12:45:07 PM7/28/09
to dompdf
On Jul 28, 6:48 am, fearghalm <fearghalmurphy1...@googlemail.com>
wrote:
Two things:
1) You have not rendered the PDF, so $dompdf->output() will not return
anything.
2) You should probably be using $dompdf->stream() rather than $dompdf-
>output().

See http://www.digitaljunkies.ca/dompdf/usage.php#class for more
information.

-b

Dimas Yusuf

unread,
Jul 28, 2009, 1:17:36 PM7/28/09
to dom...@googlegroups.com
This happened to me as well. In my case a blank page meant a rendering error. Check your server's error_log file and you might see error messages from DOMPDF basically saying "I can't render something because it's off the page".

fearghalm

unread,
Jul 29, 2009, 4:54:38 AM7/29/09
to dompdf
Yeah, tried this but same result. Is
there a function to display errors?

Tried

ini_set ('display_errors', 'on');
ini_set ('log_errors', 'on');
ini_set ('display_startup_errors', 'on');
ini_set ('error_reporting', E_ALL);

but nothing. Any ideas?


psychoactive

unread,
Jul 29, 2009, 8:18:36 PM7/29/09
to dompdf
Did you read what brian said? You never even rendered the document.
It was never created. You have to call the render() function.

On Jul 29, 1:54 am, fearghalm <fearghalmurphy1...@googlemail.com>
wrote:

fearghalm

unread,
Jul 30, 2009, 8:12:01 AM7/30/09
to dompdf
Apologies. Yes, I did render the pdf the second time..still getting a
blank page
using the following:

$dompdf->load_html($html);
$dompdf->set_paper('a4', 'portrait');
$dompdf->render();
$dompdf->stream("dompdf_out.pdf");

The $html is large, but tables are complete and entire HTML
is valid...

F

BrianS

unread,
Aug 3, 2009, 11:08:25 PM8/3/09
to dompdf
On Jul 30, 8:12 am, fearghalm <fearghalmurphy1...@googlemail.com>
wrote:
> Apologies. Yes, I did render the pdf the second time..still getting a
> blank page
> using the following:
>
>   $dompdf->load_html($html);
>   $dompdf->set_paper('a4', 'portrait');
>   $dompdf->render();
>   $dompdf->stream("dompdf_out.pdf");
>
> The $html is large, but tables are complete and entire HTML
> is valid...

A large HTML document with tables could require more memory or
execution time than is allowed on your system. You should see an error
message with "display_errors" set to on. You might want to check with
your web host to find out what you need to do to see PHP errors.

It might also be useful to know the operating system, web server, and
php version on your server.
Reply all
Reply to author
Forward
0 new messages