Open franzholz opened 10 years ago
The style that's causing problems is p { page-break-after: always; }
... which is just an insane style to begin with. Who wants to break pages after every single paragraph? Every. Single. Paragraph.
Removing the page break styling seems to fix things, but I'm not sure why it's causing the problem. It's not the styling itself, but something about your document combined with that styling (I can use that style on a simple document without issue). We'll need to look into this further.
I have used this page-break-after clause because I copied it from this issue example I have found by my search engine search: https://github.com/dompdf/dompdf/issues/571 I just wanted to use a page number. I think that it is not an endless loop. This 2 page bill example generates hundreds of pages. Then the PDF generation hangs because of the PHP timeout after 240 seconds.
Who would write such crazy CSS ... oh. Ha ha. Sorry, yes.
The page break styling does exactly what it sounds like. After every p
element a new page is created. I wanted to keep that example simple, it wasn't meant to be used in production. I'll try to do better with my sample code next time. Since all you really want is the page number, you can get rid of the page break styling. All you really need is this part:
<html>
<head>
<style>
.footer { position: fixed; bottom: 0px; }
.pagenum:before { content: counter(page); }
</style>
</head>
<body>
<div class="footer">Page: <span class="pagenum"></span></div>
</body>
</html>
That being said, I think it could be an endless loop. You don't have enough p
elements to create hundreds of pages. I think the page break styling may be getting pushed to a new page, causing a new page to render, then getting pushed yet again to a new page.
The PDF generation seems to hang in an endless loop. After some modifications in the CSS the PDF generation never ends and causes an Apache timeout.
Here is the HTML source file:
http://jambage.com/fehlersuche/Zulu-Bill.html
```Seite: ${pageno}
04.10.2014
Franz Holzinger, Meister Gerhard Str. 9, 50674 Köln
Rechnungsnr.: SHOP_43322
Kundennr.: 9442000388
Zahlung dankend erhalten!
```