I'm working on a webpage with a CKEditor. Currently my prorject runs on an XAMPP/WindowsXP-system. The CKEditor generates HTML-code, I use a table to generate a graphical border for my content and (to work around a weakness of the CKEditor (and it's user)) I use a CSS to fill in the backgroundimages of the table.
Now I wanted to use your script to generate a pdf from it and as soon as I use the external CSS I only get an error!?
The relevant pathes are
\xampp\htdocs\project \xampp\htdocs\project\html2pdf \xampp\htdocs\project\userdata\ \xampp\htdocs\project\template\ \xampp\htdocs\project\template\feier1
The html-code is:
<html><head><title></title><link href="content.css" rel="stylesheet" type="text/css"/></head><body> <div class="feier1"> <table style="width: 271px; height: 142px;"> <tbody> <tr> <td class="upperleft"> </td><td class="upperhorizon"> </td><td class="upperright"> </td></tr> <tr> <td class="leftvertical"> </td> <td class="eingabefeld"><img src="userdata/elefants.png" style="height: 106px; width: 162px; float: left;" />Love message!</td> <td class="rightvertical"> </td> </tr> <tr> <td class="lowerleft"> </td><td class="lowerhorizon"> </td><td class="lowerright"> </td> </tr> </tbody> </table> </div> </body></html>
For the beginning (and to narrow down the error) I toned down content.css to this single line:
.feier1 table .upperleft {width:10px; height:10px; background-image:url("template/feier1/lo.png");}
My PHP-script runs in \xampp\htdocs\project\ and looks like that:
$postArray = &$_POST; $html=$postArray["CKE_HTML"]; echo "debuginfo" . $html; //which gives the correct HTML-code require_once('html2pdf/html2pdf.class.php'); $html2pdf = new HTML2PDF('P','A4','en'); $html2pdf->WriteHTML($html); $html2pdf->Output('exemple.pdf', "F");
This is what I get:
Fatal error: Uncaught <span style="color: #AA0000; font-weight: bold;">ERROR n°6</span><br>File : G:\xampp\htdocs\project\html2pdf\html2pdf.class.php<br>Line : 2545 <br><br>Impossible to load the image <b>"template/feier1/lo.png"</b> thrown in G:\xampp\htdocs\project\html2pdf\html2pdf.class.php on line 2545
How to prevent/work around this error?
Thanks for your attention!