AlignmentExamples.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using QuestPDF.Fluent;
  2. using QuestPDF.Helpers;
  3. using QuestPDF.Infrastructure;
  4. namespace QuestPDF.DocumentationExamples;
  5. public class AlignmentExamples
  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(300)
  20. .Height(300)
  21. .AlignBottom()
  22. .AlignCenter()
  23. .Background(Colors.Grey.Lighten2)
  24. .Padding(10)
  25. .Text("Lorem ipsum");
  26. });
  27. })
  28. .GenerateImages(x => "alignment.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.VeryHigh, RasterDpi = 144 });
  29. }
  30. }