dompdf->render() question
Posted: Fri Jul 27, 2007 4:41 pm
I'm trying to use dompdf on a windows box to convert a whole dir-full of .htm files to .pdfs. I've got everything installed (correctly, I believe), and I can get my script to run. However, when it goes to render, the CPU cycles kick to 100% and it just stays there until I Ctrl-C the process.
Here's the code, $filename gets declared and assigned before this
When I run it, it will run 'til it echos "preparing to render", and that's when I'm running @ 100% CPU.
Anyone have any thoughts or ideas?
EDIT: I've changed this code, now I'm pulling all of the file contents into a string, running that through HTMLPurifier, and trying to render that instead. It's still doing the 100% CPU dance.
Here's the code, $filename gets declared and assigned before this
Code: Select all
$file_htm = $filename . ".htm";
$file_pdf = $filename . ".pdf";
require_once("../library/dompdf-0.5.1/dompdf_config.inc.php");
echo "\nIncluded file... preparing to create dompdf";
$dompdf = new DOMPDF();
echo "\nCreated object... preparing to load html file: $file_htm";
$dompdf->load_html_file($file_htm);
echo "\nloaded the file... preparing to render";
$dompdf->render();
echo "\nRendering the file... preparing to stream";
$dompdf->stream($file_pdf);
echo "\ndone\n";Anyone have any thoughts or ideas?
EDIT: I've changed this code, now I'm pulling all of the file contents into a string, running that through HTMLPurifier, and trying to render that instead. It's still doing the 100% CPU dance.