Question
Description
I am using boundsOfString(...) to calculate the bounds of a string to ensure it fits on the current page. Unfortunately calling this function creates a new page if the text doesn't fit on the page.
How can I prevent a new page to be created?
Code sample
doc.boundsOfString("some long text ... "); 
Your environment
- pdfkit version: 0.17.1
 
- Node version: 22.14
 
- Browser version (if applicable): (running on node)
 
- Operating System: macos