Hello
Problem with dompdf 5-0-1, I get the following error :
Notice: Undefined index: 2 in C:\Program Files\EasyPHP 3.0
\www\rafael\administrator\components\com_virtuemart\classes\pdf\dompdf\lib\
class.pdf.php on line 1216
When put this line nΒ°1216, I get my PDF file correctly.
Would anybody tell me what is wrong or is it a bug.
I use PHP 5.10 the latest release. I used dompdf to output pdf files in
joomla component Virtumart.
Here is my code :
elseif( file_exists(CLASSPATH."pdf/dompdf/dompdf_config.inc.php")) {
// In this part you can use the dompdf library
(http://www.digitaljunkies.ca/dompdf/)
// Just extract the dompdf archive to /classes/pdf/dompdf
$image_details = getimagesize($logo);
$footer = '<script type="text/php">
if ( isset($pdf) ) {
// Open the object: all drawing commands will
// go to the object instead of the current page
$footer = $pdf->open_object();
$w = $pdf->get_width();
$h = $pdf->get_height();
// Draw a line along the bottom
$y = $h - 2 * 12 - 24;
$pdf->line(16, $y, $w - 16, $y, "grey", 1);
// Add a logo
$img_w = 2 * 72; // 2 inches, in points
$img_h = 1 * 72; // 1 inch, in points -- change these as required
$pdf->image("'.$logourl.'", "'.$image_details[2].'", ($w - $img_w) /
2.0, $y - $img_h, $img_w, $img_h);
// Close the object (stop capture)
$pdf->close_object();
// Add the object to every page. You can
// also specify "odd" or "even"
$pdf->add_object($footer, "all");
}
</script>';
$website = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>'. $mainframe->getHead().'
<link rel="stylesheet" href="templates/'.
$cur_template .'/css/template_css.css" type="text/css" />
<link rel="stylesheet" href="'. VM_THEMEURL .'theme.css"
type="text/css" />
<link rel="shortcut icon" href="'.
$mosConfig_live_site .'/images/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; '.
_ISO.'" />
<meta name="robots" content="noindex, nofollow" />
</head>
<body class="contentpane">
' . $html .'
' . $footer .'
</body>
</html>';
$website = str_replace ("resized%2F", "", $website);
$website = str_replace ("&", "&", $website);
//die( htmlspecialchars($website));
require_once( CLASSPATH."pdf/dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($website);
$dompdf->render();
$dompdf->stream("virtuetest.pdf", array('Attachment' => 0));
}
}
?>
I don't see what is missing, although it seems to be a Ilink problem but I
don't see how to solve the problem.
Any ideas ?
Thanks
APB