BarcodeExamples.cs 944 B

12345678910111213141516171819202122232425262728293031
  1. using NUnit.Framework;
  2. using QuestPDF.Examples.Engine;
  3. using QuestPDF.Fluent;
  4. using QuestPDF.Helpers;
  5. using QuestPDF.Infrastructure;
  6. namespace QuestPDF.Examples
  7. {
  8. [TestFixture]
  9. public class BarcodeExamples
  10. {
  11. [Test]
  12. public void Barcode()
  13. {
  14. RenderingTest
  15. .Create()
  16. .PageSize(300, 300)
  17. .Render(container =>
  18. {
  19. container
  20. .Background("#FFF")
  21. .Padding(25)
  22. .Stack(stack =>
  23. {
  24. stack.Item().Border(1).Background(Colors.Grey.Lighten3).Padding(5).Text("Barcode Example");
  25. stack.Item().Border(1).Padding(5).AlignCenter().Text("*123456789*", TextStyle.Default.FontType("CarolinaBar-Demo-25E2").Size(20));
  26. });
  27. });
  28. }
  29. }
  30. }