Program.cs 1.9 KB

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