| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- using NUnit.Framework;
- using QuestPDF.Examples.Engine;
- using QuestPDF.Fluent;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.Examples
- {
- public class Examples
- {
- [Test]
- public void Padding()
- {
- RenderingTest
- .Create()
- .PageSize(300, 300)
- .FileName()
- .ShowResults()
- .Render(container =>
- {
- container
- .Background("#FDD")
- .Padding(50)
- .Background("#AFA")
- .PaddingVertical(50)
- .Background("#77F")
- .PaddingHorizontal(50)
- .Background("#444");
- });
- }
-
- [Test]
- public void Border()
- {
- RenderingTest
- .Create()
- .PageSize(200, 150)
- .FileName()
- .Render(container =>
- {
- container
- .Background("#EEE")
- .Padding(25)
- .AlignBottom()
- .AlignCenter()
- .BorderBottom(2)
- .BorderColor("#000")
-
- .Background("FFF")
- .Padding(5)
- .AlignCenter()
- .Text("Sample text", TextStyle.Default.FontType("Segoe UI emoji"));
- });
- }
-
- [Test]
- public void Alignment()
- {
- RenderingTest
- .Create()
- .PageSize(200, 150)
- .FileName()
- .Render(container =>
- {
- container
- .Stack(column =>
- {
- column
- .Item()
- .Height(100)
- .Background("#FFF")
-
- .AlignLeft()
- .AlignMiddle()
- .Width(50)
- .Height(50)
- .Background("#444");
-
- column
- .Item()
- .Height(100)
- .Background("#DDD")
-
- .AlignCenter()
- .AlignMiddle()
- .Width(50)
- .Height(50)
- .Background("#222");
-
- column
- .Item()
- .Height(100)
- .Background("#BBB")
-
- .AlignRight()
- .AlignMiddle()
- .Width(50)
- .Height(50)
- .Background("#000");
- });
- });
- }
-
- [Test]
- public void Expand()
- {
- RenderingTest
- .Create()
- .PageSize(200, 150)
- .FileName()
- .Render(container =>
- {
- container
- .Stack(column =>
- {
- column
- .Item()
- .Height(150)
- .Row(row =>
- {
- row.RelativeColumn()
- .Extend()
- .Background("FFF")
- .Height(50)
- .Width(50)
- .Background("444");
-
- row.RelativeColumn()
- .Extend()
- .Background("BBB")
- .Height(50)
- .ExtendHorizontal()
- .Background("444");
- });
-
- column
- .Item()
- .Height(150)
- .Row(row =>
- {
- row.RelativeColumn()
- .Extend()
- .Background("BBB")
- .ExtendVertical()
- .Width(50)
- .Background("444");
-
- row.RelativeColumn()
- .Extend()
- .Background("BBB")
- .ExtendVertical()
- .ExtendHorizontal()
- .Background("444");
- });
- });
- });
- }
- }
- }
|