BarcodeExamples.cs 972 B

1234567891011121314151617181920212223242526272829303132
  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. .FileName()
  18. .Render(container =>
  19. {
  20. container
  21. .Background("#FFF")
  22. .Padding(25)
  23. .Stack(stack =>
  24. {
  25. stack.Item().Border(1).Background(Colors.Grey.Lighten3).Padding(5).Text("Barcode Example");
  26. stack.Item().Border(1).Padding(5).AlignCenter().Text("*123456789*", TextStyle.Default.FontType("CarolinaBar-Demo-25E2").Size(20));
  27. });
  28. });
  29. }
  30. }
  31. }