| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using NUnit.Framework;
- using QuestPDF.Examples.Engine;
- using QuestPDF.Fluent;
- using QuestPDF.Helpers;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.Examples
- {
- public class RightToLeftExamples
- {
- [Test]
- public void Unconstrained()
- {
- RenderingTest
- .Create()
- .ProduceImages()
- .PageSize(600, 600)
- .ShowResults()
- .Render(container =>
- {
- container
- .AlignCenter()
- .AlignMiddle()
- .ContentFromRightToLeft()
- .Unconstrained()
- .Background(Colors.Red.Medium)
- .Height(200)
- .Width(200);
- });
- }
-
- [Test]
- public void Row()
- {
- RenderingTest
- .Create()
- .ProduceImages()
- .PageSize(600, 600)
- .ShowResults()
- .Render(container =>
- {
- container
- .Padding(25)
- .ContentFromRightToLeft()
- .Border(1)
- .Row(row =>
- {
- row.ConstantItem(200).Background(Colors.Red.Lighten2).Height(200);
- row.ConstantItem(150).Background(Colors.Green.Lighten2).Height(200);
- row.ConstantItem(100).Background(Colors.Blue.Lighten2).Height(200);
- });
- });
- }
-
- [Test]
- public void MinimalBox()
- {
- RenderingTest
- .Create()
- .ProduceImages()
- .PageSize(600, 600)
- .ShowResults()
- .Render(container =>
- {
- container
- .Padding(25)
- .ContentFromRightToLeft()
- .Border(1)
- .MinimalBox()
- .Column(column =>
- {
- column.Item().Background(Colors.Red.Lighten2).Width(200).Height(200);
- column.Item().Background(Colors.Green.Lighten2).Width(150).Height(150);
- column.Item().Background(Colors.Blue.Lighten2).Width(100).Height(100);
- });
- });
- }
-
- [Test]
- public void Table()
- {
- RenderingTest
- .Create()
- .ProduceImages()
- .PageSize(600, 600)
- .ShowResults()
- .Render(container =>
- {
- container
- .Padding(25)
- .ContentFromRightToLeft()
- .Border(1)
- .Table(table =>
- {
- table.ColumnsDefinition(columns =>
- {
- columns.ConstantColumn(200);
- columns.ConstantColumn(150);
- columns.ConstantColumn(100);
- });
- table.Cell().Background(Colors.Red.Lighten2).Height(200);
- table.Cell().Background(Colors.Green.Lighten2).Height(200);
- table.Cell().Background(Colors.Blue.Lighten2).Height(200);
- });
- });
- }
-
- [Test]
- public void AspectRatio()
- {
- RenderingTest
- .Create()
- .ProduceImages()
- .PageSize(600, 600)
- .ShowResults()
- .Render(container =>
- {
- container
- .Padding(25)
- .ContentFromRightToLeft()
- .Border(1)
- .AspectRatio(0.55f, AspectRatioOption.FitArea)
- .Background(Colors.Red.Medium);
- });
- }
- }
- }
|