FlipExamples.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using QuestPDF.Fluent;
  2. using QuestPDF.Helpers;
  3. using QuestPDF.Infrastructure;
  4. namespace QuestPDF.DocumentationExamples;
  5. public class FlipExamples
  6. {
  7. [Test]
  8. public void Example()
  9. {
  10. Document
  11. .Create(document =>
  12. {
  13. document.Page(page =>
  14. {
  15. page.MinSize(new PageSize(350, 0));
  16. page.MaxSize(new PageSize(350, 1000));
  17. page.DefaultTextStyle(x => x.FontSize(20));
  18. page.Margin(25);
  19. page.Content()
  20. .Column(column =>
  21. {
  22. column.Spacing(15);
  23. column.Item()
  24. .Text("Read the message below by putting a mirror on the right side of the screen.");
  25. column.Item()
  26. .AlignLeft()
  27. .Background(Colors.Red.Lighten5)
  28. .Padding(10)
  29. .FlipHorizontal()
  30. .Text("This is a secret message.")
  31. .FontColor(Colors.Red.Darken2);
  32. });
  33. });
  34. })
  35. .GenerateImages(x => "flip.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.VeryHigh, RasterDpi = 144 });
  36. }
  37. }