Program.cs 1.9 KB

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