Comments (4)
Hello :) There are two reasons possible behind the DocumentLayoutException.
- Some elements in the document structure cannot be successfully rendered because of size constraints. This is sometimes very challenging to detect. In such cases, the results document will have infinite length. There is a special breaker that detects too long documents and throws an exception. Please take a look at the metadata settings and the
DocumentLayoutExceptionThreshold
parameter. - The second case is when you generate a lot of content and hit the threshold described above. I bet it is what happened in your case. Increasing the threshold will surely help :)
In one of the experimental branches, I am already working on the improvements regarding this exception. When it is thrown, you will get a full elements trace (similar to stack trace) describing all size constraints, rendering types, etc. Such trace will point you where specifically the problem happens. Super useful, yet still requires some work!
from questpdf.
You're right, it's DocumentLayoutExceptionThreshold
.
I'm surprised it's set so low, but I guess whatever you set it to, someone is going to complain eventually!
As to why exception is thrown intermittently when count is 4967, random comment field at the end sometimes push number of pages to 250.
from questpdf.
This is tricky to decide. I expect/suppose that most users will generate relatively short documents. When this exception happens, the library literally needs to generate so many pages, using processor and memory resources. Therefore, if I set this value really high (let's say 10000 pages), it will be just wasteful.
What about adding a more sophisticated exception message? That describes both cases and let the developer know how to deal with them? E.g. to increase the threshold?
from questpdf.
Yes, I thought of that, but I didn't want to take up any more of your free time.
from questpdf.
Related Issues (20)
- Incorrect nuget package QuestPDF 2024.3.0-rc2
- QuestPDF.Previewer 2024.3.0-rc and .NET8 - can't install package HOT 1
- QuestPDF.Drawing.Exceptions.DocumentDrawingException: 'Could not find an appropriate font fallback for the following glyphs: $U-000D ' HOT 16
- Devanagari font rendering Issue Linux HOT 4
- Non-PageBreaking cell of table duplicates data in both pages HOT 2
- Nuget should buildTransitive instead of build for the QuestPDF.targets HOT 2
- Everything stop working correctly after upgrading to latest version HOT 3
- Canvas Deprecated? HOT 2
- unable to load dll 'questpdfskia' on Windows 11 .NET Framework C#
- Rounded corners for borders HOT 2
- SVG: Classes in CSS have no effect. HOT 1
- Black border using SkiaSharp canvas integration HOT 4
- FitArea, FitWidth, FitHeight don't work for SVG images HOT 7
- Allow the pdf to be exported as clean html & css. HOT 1
- Is there any APIs can draw arbitrary line by 2 points?
- QuestPDFSkia DLL is not detected as a dependency. HOT 1
- Calling FontManager.RegisterFont throws an InitializationException HOT 2
- Sporadic AccessViolationException when UseEnvironmentFonts is false and documents are generated in parallel HOT 2
- Lato font is not included in platform-specific builds HOT 2
- Font rendering (line-height) in 2024.3.X HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from questpdf.