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
|
|
|
{
|
2022-02-25 23:02:42 +01: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()
|
2022-02-25 23:02:42 +01:00
|
|
|
.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()
|
2022-02-25 23:02:42 +01:00
|
|
|
.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
|
|
|
}
|