Program.cs 1.7 KB

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