Files

32 lines
873 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
{
FontManager.RegisterFontType(File.OpenRead("LibreBarcode39-Regular.ttf"));
2021-12-30 21:07:34 +01:00
2021-08-26 22:25:33 +02:00
RenderingTest
.Create()
.PageSize(400, 200)
2021-12-30 21:07:34 +01:00
.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("Libre Barcode 39").Size(64));
2021-08-26 22:25:33 +02:00
});
}
}
2021-12-30 21:07:34 +01:00
}