Layout Updates

This commit is contained in:
Andre Beging
2024-11-14 20:34:16 +01:00
parent b76dcdb746
commit 7dc50d51f9
7 changed files with 207 additions and 96 deletions

View File

@@ -1,7 +1,25 @@
namespace Server
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
namespace Server
{
public static class Extensions
{
public static bool IsNullOrWhiteSpace(this string? value) => string.IsNullOrWhiteSpace(value);
#region Public Method TextSmall
/// Adds a small text element to the specified container with an optional bold style.
/// <param name="container">The container to which the text element will be added.</param>
/// <param name="text">The text content to be displayed.</param>
/// <param name="bold">Indicates whether the text should be displayed in bold. Defaults to false.</param>
public static void TextSmall(this IContainer container, string? text, bool bold = false)
{
container.Text(txt =>
{
var spanDescriptor = txt.Span(text).FontSize(8);
if (bold) spanDescriptor.SemiBold();
});
}
#endregion
}
}