ColorsExamples.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using QuestPDF.Fluent;
  2. using QuestPDF.Helpers;
  3. using QuestPDF.Infrastructure;
  4. namespace QuestPDF.DocumentationExamples;
  5. public class ColorsExamples
  6. {
  7. [Test]
  8. public void Example()
  9. {
  10. Document
  11. .Create(document =>
  12. {
  13. document.Page(page =>
  14. {
  15. page.MinSize(new PageSize(0, 0));
  16. page.MaxSize(new PageSize(1000, 1000));
  17. page.DefaultTextStyle(x => x.FontSize(20));
  18. page.Content()
  19. .Width(175)
  20. .Padding(20)
  21. .Border(1)
  22. .BorderColor("#03A9F4")
  23. .Background(Colors.LightBlue.Lighten5)
  24. .Padding(20)
  25. .Text("Blue text")
  26. .Bold()
  27. .FontColor(Colors.LightBlue.Darken4)
  28. .Underline()
  29. .DecorationWavy()
  30. .DecorationColor(0xFF0000);
  31. });
  32. })
  33. .GenerateImages(x => "colors.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.VeryHigh, RasterDpi = 144 });
  34. }
  35. }