Files

32 lines
889 B
C#
Raw Permalink Normal View History

2021-12-30 21:07:34 +01:00
using System.IO;
using NUnit.Framework;
using QuestPDF.Drawing;
2021-08-26 22:25:33 +02:00
using QuestPDF.Examples.Engine;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
namespace QuestPDF.Examples
{
public class BarcodeExamples
{
[Test]
2021-12-30 21:07:34 +01:00
public void Example()
2021-08-26 22:25:33 +02:00
{
2021-12-30 21:07:34 +01:00
FontManager.RegisterFontType("LibreBarcode39", File.OpenRead("LibreBarcode39-Regular.ttf"));
2021-08-26 22:25:33 +02:00
RenderingTest
.Create()
2021-12-30 21:07:34 +01:00
.PageSize(400, 100)
.ShowResults()
2021-08-26 22:25:33 +02:00
.Render(container =>
{
container
2021-12-30 21:07:34 +01:00
.Background(Colors.White)
.AlignCenter()
.AlignMiddle()
.Text("*QuestPDF*", TextStyle.Default.FontType("LibreBarcode39").Size(64));
2021-08-26 22:25:33 +02:00
});
}
}
2021-12-30 21:07:34 +01:00
}