|
|
@@ -60,7 +60,10 @@ namespace QuestPDF.Drawing
|
|
|
var spacePlan = content.Measure(Size.Max) as Size;
|
|
|
|
|
|
if (spacePlan == null)
|
|
|
- break;
|
|
|
+ {
|
|
|
+ canvas.EndDocument();
|
|
|
+ ThrowLayoutException();
|
|
|
+ }
|
|
|
|
|
|
try
|
|
|
{
|
|
|
@@ -78,7 +81,7 @@ namespace QuestPDF.Drawing
|
|
|
if (currentPage >= documentMetadata.DocumentLayoutExceptionThreshold)
|
|
|
{
|
|
|
canvas.EndDocument();
|
|
|
- throw new DocumentLayoutException("Composed layout generates infinite document.");
|
|
|
+ ThrowLayoutException();
|
|
|
}
|
|
|
|
|
|
if (spacePlan is FullRender)
|
|
|
@@ -88,6 +91,11 @@ namespace QuestPDF.Drawing
|
|
|
}
|
|
|
|
|
|
canvas.EndDocument();
|
|
|
+
|
|
|
+ void ThrowLayoutException()
|
|
|
+ {
|
|
|
+ throw new DocumentLayoutException("Composed layout generates infinite document.");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|