Browse Source

Documentation Examples: Flip

Marcin Ziąbek 9 months ago
parent
commit
2ed46a4f57
1 changed files with 15 additions and 30 deletions
  1. 15 30
      Source/QuestPDF.DocumentationExamples/FlipExamples.cs

+ 15 - 30
Source/QuestPDF.DocumentationExamples/FlipExamples.cs

@@ -14,41 +14,26 @@ public class FlipExamples
             {
                 document.Page(page =>
                 {
-                    page.MinSize(new PageSize(0, 0));
-                    page.MaxSize(new PageSize(1000, 1000));
+                    page.MinSize(new PageSize(350, 0));
+                    page.MaxSize(new PageSize(350, 1000));
                     page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
 
                     page.Content()
-                        .Width(350)
-                        .Height(350)
-                        .Padding(20)
-                        .Grid(grid =>
+                        .Column(column =>
                         {
-                            grid.Columns(2);
-                            grid.Spacing(10);
-    
-                            foreach (var turns in Enumerable.Range(0, 4))
-                            {
-                                grid.Item()
-                                    .Width(150)
-                                    .Height(150)
-                                    .Background(Colors.Grey.Lighten2)
-                                    .Padding(10)
-                                    .Element(element =>
-                                    {
-                                        if (turns == 1 || turns == 2)
-                                            element = element.FlipHorizontal();
+                            column.Spacing(15);
 
-                                        if (turns == 2 || turns == 3)
-                                            element = element.FlipVertical();
-                
-                                        return element;
-                                    })
-                                    .Shrink()
-                                    .Background(Colors.White)
-                                    .Padding(10)
-                                    .Text($"Flipped {turns}").FontSize(16);
-                            }
+                            column.Item()
+                                .Text("Read the message below by putting a mirror on the right side of the screen.");
+                            
+                            column.Item()
+                                .AlignLeft()
+                                .Background(Colors.Red.Lighten5)
+                                .Padding(10)
+                                .FlipHorizontal()
+                                .Text("This is a secret message.")
+                                .FontColor(Colors.Red.Darken2);
                         });
                 });
             })