Program.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Avalonia.Media;
  2. using QuestPDF.Fluent;
  3. using QuestPDF.Helpers;
  4. using QuestPDF.Infrastructure;
  5. using QuestPDF.Previewer;
  6. using Colors = QuestPDF.Helpers.Colors;
  7. Document
  8. .Create(container =>
  9. {
  10. container.Page(page =>
  11. {
  12. page.Size(PageSizes.A4);
  13. page.Margin(2, Unit.Centimetre);
  14. page.PageColor(Colors.White);
  15. page.DefaultTextStyle(x => x.FontSize(20));
  16. page.Header()
  17. .Text("Hot Reload!")
  18. .SemiBold().FontSize(36).FontColor(Colors.Blue.Darken2);
  19. page.Content()
  20. .PaddingVertical(1, Unit.Centimetre)
  21. .Column(x =>
  22. {
  23. x.Spacing(20);
  24. x.Item().Table(t =>
  25. {
  26. t.ColumnsDefinition(c =>
  27. {
  28. c.RelativeColumn();
  29. c.RelativeColumn(3);
  30. });
  31. t.Cell().Border(1).Background(Colors.Grey.Lighten3).Padding(5).Text("Visual Studio");
  32. t.Cell().Border(1).Padding(5).Text("Start in debug mode with 'Hot Reload on Save' enabled.");
  33. t.Cell().Border(1).Background(Colors.Grey.Lighten3).Padding(5).Text("Command line");
  34. t.Cell().Border(1).Padding(5).Text("Run 'dotnet watch'.");
  35. });
  36. x.Item().Text("Modify this line and the preview should show your changes instantly.");
  37. });
  38. page.Footer()
  39. .AlignCenter()
  40. .Text(x =>
  41. {
  42. x.Span("Page ");
  43. x.CurrentPageNumber();
  44. });
  45. });
  46. container.Page(page =>
  47. {
  48. page.Size(PageSizes.A3);
  49. page.Margin(2, Unit.Centimetre);
  50. page.PageColor(Colors.White);
  51. page.DefaultTextStyle(x => x.FontSize(20));
  52. page.Content()
  53. .PaddingVertical(1, Unit.Centimetre)
  54. .Column(x =>
  55. {
  56. x.Spacing(20);
  57. foreach (var i in Enumerable.Range(0, 10))
  58. x.Item().Background(Colors.Grey.Lighten2).Height(80);
  59. });
  60. });
  61. })
  62. .ShowInPreviewer();