Open chrissyalbert opened 5 months ago
+1 for this issue. I think it is the only significant problem I have that's preventing me from using React PDF in production. I was about to register an issue myself for this, but I'll tag it onto here instead. Mine is slightly different but similar enough that I suspect it's the same root cause.
PS: I'm still encountering it on latest version as of today (3.4.4) though I am using 3.4.2 due to a font regression.
Here's my reproduction:
I too am having the same issue, at first, I was on 3.1.15 due to being on an older version of node. I thought it was fixed in the latest version, but I still see it in version 3.4.4.
@diegomura
I can also confirm this behavior.
I had the same issue because i used height: auto
at some container.
So I managed to fix this by rendering each page manually. I calculate the height of each element and then decide how many pages I need to render.
I also having this issue, in my case I notice is was caused by the render function, if render a Text inside a View's render function (in order to get the pageIndex), then all content will be squeezed into a single page. By just remove the render function and put Text as children, then auto page break back to normal again.
Describe the bug When using wrap={false} on a View Component used for a table, the desired effect was to prevent breaking short tables if they appeared to far down to the edge of a page. This behavior worked on 3/5/24. The current behavior is a vertical compression of components to try to fit in one page instead of starting a new page, then breaking towards the last part of the parent component with the wrap={false} property.
To Reproduce
REPL 3.3.5 REPL 2.3.0
Expected behavior The parent component using wrap={false} starts on a new page if it can't fit in the space left on a page. If it its total height is greater than the height of a page, it starts on a new page and breaks at the page length and goes on to a new page.
Screenshots 3/5/24 working wrap={false} short tables start on a new page when they are close to the bottom of a page instead of being broken, long tables greater than a page height start on a new page and only break at the last part of the rows
current behavior: wrap={false} tables of various heights "compress" rows in order to fit a page, rather than going to the next page and breaking at the last part of the rows
Desktop (please complete the following information):