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’m dynamically generating a PDF using an API, and I encountered an exception: TooManyPagesException. This happened when the number of pages exceeded the default value of 20 for maxPages. Increasing the maxPages value resolved the issue for now, but I’m wondering if there’s a way to set maxPages to unlimited or handle this more effectively.
Is there a proper approach to make maxPages dynamically adapt to the content or ensure it doesn’t impose a hard limit?
The text was updated successfully, but these errors were encountered:
I’m wondering if there’s a way to set maxPages to unlimited or handle this more effectively.
This would be a bad idea as this exception is usually the "last resort" when other issues cause an infinite loop of creating pages.
A typical case for this is when a "non-spanning" widget is larger than the page. Usually, the library would then put that entire widget on the next page. But if the widget is bigger than the page, the library will try to do this indefinitely.
So to prevent this infinite loop, it makes sense to define an upper limit. And in almost all cases, there is a number of pages which is rediculess and at which it is safe to say that an issue is causing this.
I don't think there is a book with more than 99999 pages.
@caylab unfortunately that seems not to be the case, as I reported in #1762 (comment) , using Multipage with a image that doesn't fit on a single page seems to cause just such an infinite loop irrespective of what the maxPages value is.
I’m dynamically generating a PDF using an API, and I encountered an exception:
TooManyPagesException
. This happened when the number of pages exceeded the default value of 20 formaxPages
. Increasing themaxPages
value resolved the issue for now, but I’m wondering if there’s a way to setmaxPages
to unlimited or handle this more effectively.Is there a proper approach to make
maxPages
dynamically adapt to the content or ensure it doesn’t impose a hard limit?The text was updated successfully, but these errors were encountered: