diff --git a/QuestPDF/Elements/Text/FontFallback.cs b/QuestPDF/Elements/Text/FontFallback.cs index e9acbfd..2e19bdd 100644 --- a/QuestPDF/Elements/Text/FontFallback.cs +++ b/QuestPDF/Elements/Text/FontFallback.cs @@ -121,7 +121,7 @@ namespace QuestPDF.Elements.Text { foreach (var textBlockItem in textBlockItems) { - if (textBlockItem is TextBlockSpan textBlockSpan) + if (textBlockItem is TextBlockSpan textBlockSpan and not TextBlockPageNumber) { // perform font-fallback operation only when any fallback is available if (textBlockSpan.Style.Fallback == null) diff --git a/QuestPDF/Fluent/TextExtensions.cs b/QuestPDF/Fluent/TextExtensions.cs index 92ae7c6..fba270d 100644 --- a/QuestPDF/Fluent/TextExtensions.cs +++ b/QuestPDF/Fluent/TextExtensions.cs @@ -36,6 +36,7 @@ namespace QuestPDF.Fluent internal TextPageNumberDescriptor(Action assignTextStyle, Action assignFormatFunction) : base(assignTextStyle) { AssignFormatFunction = assignFormatFunction; + AssignFormatFunction(x => x?.ToString()); } public TextPageNumberDescriptor Format(PageNumberFormatter formatter)