Browse Source

Fix exception triggered when generating a PDF without defining a Page in the Fluent API

Marcin Ziąbek 3 months ago
parent
commit
7597f5ac84

+ 1 - 1
Source/QuestPDF/Drawing/DocumentContainer.cs

@@ -20,7 +20,7 @@ namespace QuestPDF.Drawing
             void ComposeContainer(IContainer container)
             {
                 if (Pages.Count == 0)
-                    return;
+                    Pages.Add(new Page());
 
                 container = container.DebugPointer(DebugPointerType.DocumentStructure, DocumentStructureTypes.Document.ToString());
                 

+ 2 - 1
Source/QuestPDF/Resources/ReleaseNotes.txt

@@ -1,3 +1,4 @@
 - Disabled standard ligatures by default, as they often interfere with text copying and may pose accessibility issues,
 - Performance has been improved when generating multiple text-heavy documents at the same time. The more concurrent operations and text elements involved, the more noticeable the benefit,
-- Improved the developer experience by updating the behavior of the GeneratePdfAndShow method to always create a uniquely named file. It ensures that certain PDF viewers automatically refresh the preview.
+- Improved the developer experience by updating the behavior of the GeneratePdfAndShow method to always create a uniquely named file. It ensures that certain PDF viewers automatically refresh the preview,
+- Fix exception triggered when generating a PDF without defining a Page in the Fluent API.