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
Describe the bug
I have a few paragraphs of text that wrap into multiple pages:
(borders added to make the issue clearer in the next screenshot)
But then if I add some fixed content to the page, like a footer, each of those flex items seems to shrink to account for the fixed content, so they no longer fit the text within them, causing the text to overflow the containers (you can see the text breaking out of the boxes below, now with the new footer added):
The problem gets more obvious if the fixed content is larger:
Alternative view with debug turned on on the text items:
constMyText=({children})=>(<Textstyle={{border: '1pt solid black'}}>{children}</Text>)constExample=()=>(<Document><Pagestyle={{padding: 24,gap: 30}}><Viewstyle={{flex: 1,gap: 24}}><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText><MyText>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam dapibus, massa a feugiat pretium, nisi lectus pulvinar purus, quis elementum ipsum urna eget leo. Etiam eros lacus, maximus ac scelerisque eu, vulputate a nulla. Etiam sagittis in nisl ut tempus. Suspendisse sed ipsum dolor. Praesent rutrum sollicitudin nunc, et posuere tellus dapibus in. Donec lobortis nisi quis dui maximus faucibus. Donec fringilla lectus vitae mi lacinia, ac bibendum ante mollis. Duis sit amet vulputate lectus, ac venenatis ligula.</MyText></View><Viewfixed><MyText>Fixed Footer</MyText></View></Page></Document>)ReactPDF.render(<Example/>);
The "flex: 1" on the content is to ensure the footer is pushed to the bottom of the page (see page 2)
Expected behavior
Expected items not to shrink, and/or text not to break out of containers, when adding fixed content to the page.
I looked around and saw several similar-ish issues related to flex items, overflowing text, and page wrapping, but I didn't see something with an obvious solution for this example.
Is there some style property I'm missing on the text to prevent it from overflowing like this, to ensure the flex items stay large enough to fit the text within them?
Screenshots
See above
Desktop (please complete the following information):
OS: MacOS
Browser: Chrome
React-pdf version: 4.0.0 (in REPL)
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a few paragraphs of text that wrap into multiple pages:
(borders added to make the issue clearer in the next screenshot)
But then if I add some
fixed
content to the page, like a footer, each of those flex items seems to shrink to account for the fixed content, so they no longer fit the text within them, causing the text to overflow the containers (you can see the text breaking out of the boxes below, now with the new footer added):The problem gets more obvious if the fixed content is larger:
Alternative view with
debug
turned on on the text items:To Reproduce
REPL link here, which is just this code:
The "flex: 1" on the content is to ensure the footer is pushed to the bottom of the page (see page 2)
Expected behavior
Expected items not to shrink, and/or text not to break out of containers, when adding fixed content to the page.
I looked around and saw several similar-ish issues related to flex items, overflowing text, and page wrapping, but I didn't see something with an obvious solution for this example.
Is there some style property I'm missing on the text to prevent it from overflowing like this, to ensure the flex items stay large enough to fit the text within them?
Screenshots
See above
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: