Forum Moderators: coopster
I have come to the point of getting the prompt for the download of the PDF document via "open file" or "save to disk" dialog box...
When i do it gives an error when i try to open it of:
"There was an error opening this document. The file was damaged and could not be repaired"
I check my error log and found this:
[Mon Sep 17 11:39:29 2007] [error] PHP Notice: Undefined variable: html in /home/newhecom/public_html/addons/leadstable/addon.inc.php on line 2605
I dont understand what isnt defined?
Here is my function:
function leadstabledompdf_display_addon() {
require_once("../addons/dompdf-0.5.1/dompdf_config.inc.php");
//line 2605 $html .='<html><body><table border="1"><tr><td><div style="font-family:Times-Roman;">Test</div></td></tr></table></body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("builderreport.pdf");
}
[Mon Sep 17 11:39:29 2007] [error] PHP Notice: Undefined variable: html in /home/newhecom/public_html/addons/leadstable/addon.inc.php on line 2605
Line 2605 is attempting to append string data to the $html variable -- that is what the .= is doing, attempting to concatenate more html to the variable that the function assumes already exists. I'm guessing that the included data is not initializing the $html variable.