Sequence contains no elements exception when producing large PDFs using release mode NuGet packages #298
Replies: 3 comments
-
Hi, would you like to share a screenshot showing how your document looks like? |
Beta Was this translation helpful? Give feedback.
-
I cannot as the data is sensitive and generating a anonymized version would take some time. Let me try to describe the structure of the data instead:
Each element above has a title with a line under it with the exception of the row and fields levels. Each field has a label and value that are stacked vertically (the label above the value). The code is structured in a similar manner where each colored level is a Component and they are composed together using the recommended pattern. |
Beta Was this translation helpful? Give feedback.
-
Adding some more detail that might be helpful. As I include more black elements that's when I receive this error. If I pick and choose any subset of the black elements it works. This indicates to me that no one black element is causing the issue - I can run each black element individually without issue. Instead, when I want to include all of them in the same document, that's where I have the problem above. |
Beta Was this translation helpful? Give feedback.
-
I have a process that produces PDFs using QuestPDF in .NET Core 3.1. The data that drives the process can produce documents with hundreds of pages. I'm encountering a "Sequence contains no elements" (System.InvalidOperationException)
exception with the below stacktrace (no inner exception). This exception is triggered when I call
GeneratePdf
.Here's the crazy thing, if I clone the repo and build it in debug mode and link to that instead of the NuGet assembly, it works and produces a 361 page document. I have
DocumentLayoutExceptionThreshold
set to 1000. I do not receive aDocumentDrawingException
,DocumentComposeException
, orDocumentLayoutException
. I've tried 2022.5 and all versions of 2022.6. I've also tried limiting the data so that it produces PDFs less than 200 pages and that works, but will not fit my use-case. The resulting 361 page document (when using a debug mode assembly) is only around 1.7 MB. It has one image in it - the rest of the content is text. From what limited debugging I can perform in Release mode, it appears to be happening on the first RenderPass usingFreeCanvas
.Unfortunately, the code I'm using to generate this document isn't something I can share.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions