Jeckky / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

no pdf generated, empty error_log with 100% valid html (w3.validator.org for validation) #421

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I am having the following problem, I am trying to generate a really simple pdf 
to test. I am using the following html as input:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>factuur</title>
<style type="text/css">
@page {

  margin: 1.1in 0.4in 0.7in 0.4in;

}
</style>
</head>
<body>
<h1>Factuur bij ordernr 7545</h1>
<p>Datum: 21 oktober 2011</p>
<p>Uw gegevens:<br>
Angela Hollander<br>

ten Hovestraat 19<br>
7475cz Markelo<br>
Nederland</p>
<p>Uw order ziet er als volgt uit:</p>
<table>
<tr><td>Artikel:</td><td>Prijs incl. BTW</td><td>BTW</td><td>Prijs excl. 
BTW</td><td>BTW percentage</td></tr>
<tr><td>1 x Dap navulling</td><td>&euro; 18,59</td><td>&euro; 
2,96</td><td>&euro; 15,59</td><td>19 %</td></tr>

<tr><td>1 x Royal canin sterilised 37</td><td>&euro; 58,69</td><td>&euro; 
11,03</td><td>&euro; 58,05</td><td>19 %</td></tr>
<tr><td>4 x Feliway navulling</td><td>&euro; 74,36</td><td>&euro; 
11,85</td><td>&euro; 62,36</td><td>19 %</td></tr>

<tr><td>Totaal 19% BTW:</td><td>&euro; 151,64</td><td>&euro; 
25,84</td><td>&euro; 136,00</td><td></td></tr>
<tr><td>Totaal:</td><td>&euro; 151,64</td><td>&euro; 25,84</td><td>&euro; 
136,00</td><td></td></tr>
</table>

</body></html>

Still I get back an empty pdf

I am using dompdf 0.5.2 (latest non-beta on website)

I did not change any settings at all...

What could I be doing wrong? 

error_log stays empty.

Original issue reported on code.google.com by onlinedi...@gmail.com on 8 Feb 2012 at 2:06

GoogleCodeExporter commented 9 years ago
I forgot to add, I use the following to 'try' to generate the pdf:

require_once("dompdf/dompdf_config.inc.php");

$dompdf = new DOMPDF();
$dompdf->load_html($factuur->html);

$dompdf->render();
$dompdf->stream("factuur" . rand(0,9999) . ".pdf");

where $factuur->html is the HTML string. I get back the above html if I instead 
do print $factuur->html. So that throws no errors.

Original comment by onlinedi...@gmail.com on 8 Feb 2012 at 2:08

GoogleCodeExporter commented 9 years ago
We would recommend you try the 0.6.0 beta. Though not a "stable" release, it 
performs at least as well as 0.5.x.

If you would rather stick to a non-beta product we'll need a bit more info. Can 
you post the resulting PDF as well? Though blank it may contain something 
useful in debugging your issue.

Original comment by eclecticgeek on 8 Feb 2012 at 4:00

GoogleCodeExporter commented 9 years ago
Ok, here is the PDF.

I hope this can help you, help me out. I have used this application before and 
it did work. 

A lease calculator uses dompdf as well and works just fine. It spits out quote 
in PDF for the user and also mails the output. I can't figure out, why it isn't 
working now.

Original comment by onlinedi...@gmail.com on 8 Feb 2012 at 7:50

Attachments:

GoogleCodeExporter commented 9 years ago
Can you try uncommenting line 2082 in dompdf/lib/class.pdf.php?

Original comment by eclecticgeek on 8 Feb 2012 at 10:02

GoogleCodeExporter commented 9 years ago
I must thank Fabien for reminding me of this:

It looks like a problem with the locales, can you try to add this before you do 
"new DOMPDF"?
setlocale(LC_NUMERIC, "C");

Original comment by eclecticgeek on 9 Feb 2012 at 12:52

GoogleCodeExporter commented 9 years ago
That last comment did the trick! thank you very much. Maybe in a future release 
run this automaticly to avoid this problem?

I had locale LC_ALL set to nl_NL for other purposes. I did not know that this 
application made use of locales.

Original comment by onlinedi...@gmail.com on 9 Feb 2012 at 9:58

GoogleCodeExporter commented 9 years ago
This is already fixed in the SVN trunk for a year now : r361 ;)
It is in 0.6 beta 2.

Original comment by fabien.menager on 9 Feb 2012 at 10:26

GoogleCodeExporter commented 9 years ago
So that is why you it got recommended to me to use the beta version.......

Anyway, I am very happy with the result produced by this application. I hope my 
customers will be happy with it too. Couldn't have done it without the support 
here, thanks again.

example:
http://www.onlinedierenspeciaalzaak.com/pdf/?factuur=afffc36a51d93c3428726700ef5
f7592

Original comment by onlinedi...@gmail.com on 9 Feb 2012 at 10:50

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16