You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I produce a 3-pages PDF, the pages one and three being blank, the page two containing my rectangle, with "Some Text..."
If I change height by any absolute value (as 600pt for instance), I got a one-page PDF, but rectangle does not fit the whole page
I need to control the full page, because I want to write the same HTML, for "letter" or "A4" formats, and I need to work with relative values (25%, 50%, ...) for bocks inside my full page. Is the problem due to "height: 100%" ?
Second problem :
(quite relative to first one)
I wanted to use table/tr/td to structure my page, but as soon as I write even a minimal table structure, I got a max_execution_time (of course, I am no more with a page class with its 100% height).
I have read other same issues, regarding "anonymous table", and I am ready to replace them by a bunch of span with css styles, but I am not able to control the width of each cell, row by row.
I want to perform for instance :
first row, with 3 cells, at 33%
second row, with 2 cells, at 75%/25%, ...
Most of the time, my "width:XX" are not taken into account, and cells adjust themselves to their content.
Is there a bullet-proof method to control the widths ?
Best Regards
The text was updated successfully, but these errors were encountered:
For the first problem, you should style your body element to produce a rectangle that spans the length of the content area of the page (.page { border: 1pt solid black; }).
Your second issue isn't related to anonymous tables, it's due to the fact that currently dompdf is unable to split table cells across pages. So if any table cell spans more than one page it may cause dompdf to enter an infinite loop as it tries to move the entire table row to the next page. See #98.
So you can use the table method to style your content, just keep that limitation in mind.
Finally, with regard to setting a width. You can't give an inline element (e.g. a span element) a width. If you want to do that you should style your span with display: inline-block;. But really you probably want to use a div element instead. But no matter which route you take keep in mind that because of the way dompdf renders the HTML if you have a block element that flows beyond the bound of the page a page break will occur inside that element (except for table cells). Any content that is adjacent to the element will also flow to the next page.
Hi,
I have an 0.7.0 Dompdf installation, on an Ubuntu server, with PHP > 5.5.
First problem :
With the following html (stored in $html) :
and with following code :
I produce a 3-pages PDF, the pages one and three being blank, the page two containing my rectangle, with "Some Text..."
If I change height by any absolute value (as 600pt for instance), I got a one-page PDF, but rectangle does not fit the whole page
I need to control the full page, because I want to write the same HTML, for "letter" or "A4" formats, and I need to work with relative values (25%, 50%, ...) for bocks inside my full page. Is the problem due to "height: 100%" ?
Second problem :
(quite relative to first one)
I wanted to use table/tr/td to structure my page, but as soon as I write even a minimal table structure, I got a max_execution_time (of course, I am no more with a page class with its 100% height).
The following HTML code crashes:
I have read other same issues, regarding "anonymous table", and I am ready to replace them by a bunch of span with css styles, but I am not able to control the width of each cell, row by row.
I want to perform for instance :
first row, with 3 cells, at 33%
second row, with 2 cells, at 75%/25%, ...
Most of the time, my "width:XX" are not taken into account, and cells adjust themselves to their content.
Is there a bullet-proof method to control the widths ?
Best Regards
The text was updated successfully, but these errors were encountered: