Files
TinyInvoice/Server/Extensions.cs
Andre Beging 7dc50d51f9 Layout Updates
2024-11-14 20:34:16 +01:00

25 lines
865 B
C#

using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
namespace Server
{
public static class Extensions
{
#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
}
}