From 6b535752dfba7698d31bc4c31ef43995c9a55788 Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Thu, 15 Sep 2022 22:12:06 +0200 Subject: [PATCH] Fixed formatting page numbers --- QuestPDF/Elements/Text/FontFallback.cs | 2 +- QuestPDF/Fluent/TextExtensions.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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)