Browse Source

Documentation Examples: added more content

Marcin Ziąbek 10 months ago
parent
commit
81b6313885

+ 13 - 10
Source/QuestPDF.DocumentationExamples/DecorationExamples.cs

@@ -14,26 +14,29 @@ public class DecorationExamples
             {
             {
                 document.Page(page =>
                 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, 300));
+                    page.Margin(25);
                     page.DefaultTextStyle(x => x.FontSize(20));
                     page.DefaultTextStyle(x => x.FontSize(20));
 
 
                     page.Content()
                     page.Content()
-                        .MaxHeight(300)
-                        .MaxWidth(300)
+                        .Background(Colors.Grey.Lighten3)
+                        .Padding(15)
                         .Decoration(decoration =>
                         .Decoration(decoration =>
                         {
                         {
                             decoration
                             decoration
                                 .Before()
                                 .Before()
-                                .Background(Colors.Grey.Medium)
-                                .Padding(10)
-                                .Text("Notes").FontColor("#FFF").Bold();
+                                .DefaultTextStyle(x => x.Bold())
+                                .Column(column =>
+                                {
+                                    column.Item().ShowOnce().Text("Customer Instructions:");
+                                    column.Item().SkipOnce().Text("Customer Instructions [continued]:");
+                                });
 
 
                             decoration
                             decoration
                                 .Content()
                                 .Content()
-                                .Background(Colors.Grey.Lighten3)
-                                .Padding(10)
-                                .Text(Helpers.Placeholders.LoremIpsum());
+                                .PaddingTop(10)
+                                .Text("Please wrap the item in elegant gift paper and include a small blank card for a personal message. If possible, remove any price tags or invoices from the package. Make sure the wrapping is secure but easy to open without damaging the contents.");
                         });
                         });
                 });
                 });
             })
             })

+ 62 - 0
Source/QuestPDF.DocumentationExamples/HyperlinkExamples.cs

@@ -0,0 +1,62 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class HyperlinkExamples
+{
+    [Test]
+    public void ElementExample()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.ContinuousSize(400);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Column(column =>
+                        {
+                            column.Spacing(25);
+                            
+                            column.Item()
+                                .Text("Clicking the NuGet logo will redirect you to the NuGet website.");
+
+                            column.Item()
+                                .Width(150)
+                                .Hyperlink("https://www.nuget.org/")
+                                .Svg("Resources/nuget-logo.svg");
+                        });
+                });
+            })
+            .GeneratePdf("hyperlink-element.pdf");
+    }
+    
+    [Test]
+    public void InsideTextExample()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.ContinuousSize(300);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Text(text =>
+                        {
+                            text.Span("Click ");
+                            text.Hyperlink("here", "https://www.nuget.org/").Underline().FontColor(Colors.Blue.Darken2);
+                            text.Span(" to visit the official NuGet website.");
+                        });
+                });
+            })
+            .GeneratePdf("hyperlink-text.pdf");
+    }
+}

+ 49 - 0
Source/QuestPDF.DocumentationExamples/LayersExamples.cs

@@ -0,0 +1,49 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class LayersExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.ContinuousSize(450);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+                    
+                    page.Content()
+                        .Column(column =>
+                        {
+                            column.Item().PaddingBottom(15).Text("Proposed Business Card Design:").Bold();
+                            
+                            column.Item()
+                                .AspectRatio(4 / 3f)
+                                .Layers(layers =>
+                                {
+                                    layers.Layer().Image("Resources/card-background.jpg").FitUnproportionally();
+
+                                    layers.PrimaryLayer()
+                                        .TranslateY(75)
+                                        .Column(innerColumn =>
+                                        {
+                                            innerColumn.Item()
+                                                .AlignCenter()
+                                                .Text("Horizon Ventures")
+                                                .Bold().FontSize(32).FontColor(Colors.Blue.Darken2);
+
+                                            innerColumn.Item().AlignCenter().Text("Your journey begins here");
+                                        });
+                                });
+                        });
+                });
+            })
+            .GenerateImages(x => "layers.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.VeryHigh, RasterDpi = 144 });
+    }
+}

+ 68 - 0
Source/QuestPDF.DocumentationExamples/LineExamples.cs

@@ -0,0 +1,68 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class LineExamples
+{
+    [Test]
+    public void VerticalLineExample()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.MinSize(new PageSize(0, 0));
+                    page.MaxSize(new PageSize(1000, 1000));
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Row(row =>
+                        {
+                            row.AutoItem().Text("Text on the left");
+                            
+                            row.AutoItem()
+                                .PaddingHorizontal(15)
+                                .LineVertical(3)
+                                .LineColor(Colors.Blue.Medium);
+                            
+                            row.AutoItem().Text("Text on the right");
+                        });
+                });
+            })
+            .GenerateImages(x => "line-vertical.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+    
+    [Test]
+    public void HorizontalLineExample()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.MinSize(new PageSize(0, 0));
+                    page.MaxSize(new PageSize(1000, 1000));
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Column(column =>
+                        {
+                            column.Item().Text("Text above the line");
+                            
+                            column.Item()
+                                .PaddingVertical(10)
+                                .LineHorizontal(2)
+                                .LineColor(Colors.Blue.Medium);
+                            
+                            column.Item().Text("Text below the line");
+                        });
+                });
+            })
+            .GenerateImages(x => "line-horizontal.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

+ 56 - 0
Source/QuestPDF.DocumentationExamples/PageBreakExamples.cs

@@ -0,0 +1,56 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class PageBreakExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(300, 450);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .PaddingTop(15)
+                        .Column(column =>
+                        {
+                            var terms = new[]
+                            {
+                                ("Garbage Collection", "An automatic memory management feature in many programming languages that identifies and removes unused objects to free up memory, preventing memory leaks."),
+                                ("Constructor", "A special method in object-oriented programming that is automatically called when an object is created. It initializes the object's properties and sets up any necessary resources."),
+                                ("Dependency", "A software component or external library that a program relies on to function correctly. Dependencies can include third-party modules, frameworks, or system-level packages that provide additional functionality without requiring developers to write everything from scratch.")
+                            };
+                            
+                            column.Item()
+                                .Extend()
+                                .AlignCenter().AlignMiddle()
+                                .Text("Programming dictionary").FontSize(24).Bold();
+                            
+                            foreach (var term in terms)
+                            {
+                                column.Item().PageBreak();
+                                column.Item().Element(c => GeneratePage(c, term.Item1, term.Item2));
+                            }
+
+                            static void GeneratePage(IContainer container, string term, string definition)
+                            {
+                                container.Text(text =>
+                                {
+                                    text.Span(term).Bold().FontColor(Colors.Blue.Darken2);
+                                    text.Span($" - {definition}");
+                                });
+                            }
+                        });
+                });
+            })
+            .GeneratePdf("page-break.pdf");
+    }
+}

+ 28 - 0
Source/QuestPDF.DocumentationExamples/PlaceholderExamples.cs

@@ -145,4 +145,32 @@ public class PlaceholderExamples
             })
             })
             .GenerateImages(x => "placeholders-image.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
             .GenerateImages(x => "placeholders-image.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
     }
     }
+    
+    [Test]
+    public void ElementExample()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(PageSizes.A5);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Header()
+                        .Height(100)
+                        .Placeholder("Header");
+                    
+                    page.Content()
+                        .PaddingVertical(25)
+                        .Placeholder();
+                    
+                    page.Footer()
+                        .Height(100)
+                        .Placeholder("Footer");
+                });
+            })
+            .GenerateImages(x => "placeholder-element.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.High, RasterDpi = 144 });
+    }
 }
 }

+ 60 - 0
Source/QuestPDF.DocumentationExamples/RepeatExamples.cs

@@ -0,0 +1,60 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class RepeatExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.MinSize(new PageSize(600, 0));
+                    page.MaxSize(new PageSize(600, 600));
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Decoration(decoration =>
+                        {
+                            var terms = new[]
+                            {
+                                ("Algorithm", "A precise set of instructions that defines a process for solving a specific problem or performing a computation. Algorithms are the foundation of programming and are used to optimize tasks efficiently."),
+                                ("Bug", "An error, flaw, or unintended behavior in a program that causes it to produce incorrect or unexpected results. Debugging is the process of identifying, analyzing, and fixing these issues to improve software reliability."),
+                                ("Variable", "A named storage location in memory that holds a value, which can be modified during program execution. Variables make code dynamic and flexible by allowing data manipulation and retrieval."),
+                                ("Compilation", "The process of transforming human-readable source code into machine code (binary instructions) that a computer can execute. This process is performed by a compiler and often includes syntax checks, optimizations, and linking dependencies.")
+                            };
+                            
+                            decoration.Before().Text("Terms and their definitions:").Bold();
+                            
+                            decoration.Content().PaddingTop(15).Column(column =>
+                            {
+                                foreach (var term in terms)
+                                {
+                                    column.Item().Row(row =>
+                                    {
+                                        row.RelativeItem(2)
+                                            .Border(1)
+                                            .Background(Colors.Grey.Lighten3)
+                                            .Padding(15)
+                                            .Repeat()
+                                            .Text(term.Item1);
+                                    
+                                        row.RelativeItem(3)
+                                            .Border(1)
+                                            .Padding(15)
+                                            .Text(term.Item2);
+                                    });
+                                }
+                            });
+                        });
+                });
+            })
+            .GenerateImages(x => $"repeat-with-{x}.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

+ 1 - 0
Source/QuestPDF.DocumentationExamples/Resources/Icons/email.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z" /></svg>

+ 1 - 0
Source/QuestPDF.DocumentationExamples/Resources/Icons/phone.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z" /></svg>

+ 1 - 0
Source/QuestPDF.DocumentationExamples/Resources/Icons/web.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" /></svg>

BIN
Source/QuestPDF.DocumentationExamples/Resources/card-background.jpg


+ 20 - 0
Source/QuestPDF.DocumentationExamples/Resources/company-logo.svg

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 135 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
+    <rect id="Artboard1" x="0" y="0" width="135" height="26" style="fill:none;"/>
+    <g id="Artboard11" serif:id="Artboard1">
+        <g transform="matrix(1.20386,0,0,1.20386,-1.13761,-1.44626)">
+            <path d="M17.9,17.39C17.64,16.59 16.89,16 16,16L15,16L15,13C15,12.451 14.549,12 14,12L8,12L8,10L10,10C10.549,10 11,9.549 11,9L11,7L13,7C14.097,7 15,6.097 15,5L15,4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15L9,16C9,17.097 9.903,18 11,18M12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2Z" style="fill:url(#_Linear1);fill-rule:nonzero;"/>
+        </g>
+        <g transform="matrix(1,0,0,1,-1.7299,1.98777)">
+            <text x="30px" y="17px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:24px;">comp</text>
+            <g transform="matrix(24,0,0,24,135.363,17)">
+            </g>
+            <text x="94.008px" y="17px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:24px;fill:url(#_Linear2);">any</text>
+        </g>
+    </g>
+    <defs>
+        <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(20,20,-20,20,2,2)"><stop offset="0" style="stop-color:rgb(0,229,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(41,121,255);stop-opacity:1"/></linearGradient>
+        <linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(40.9766,27.0771,-17.5552,26.5668,94,-5.02632)"><stop offset="0" style="stop-color:rgb(0,229,255);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(41,121,255);stop-opacity:1"/></linearGradient>
+    </defs>
+</svg>

File diff suppressed because it is too large
+ 0 - 0
Source/QuestPDF.DocumentationExamples/Resources/nuget-logo.svg


+ 72 - 0
Source/QuestPDF.DocumentationExamples/SectionExamples.cs

@@ -0,0 +1,72 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class SectionExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(PageSizes.A5.Landscape());
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Column(column =>
+                        {
+                            var terms = new[]
+                            {
+                                ("Bit", "The smallest unit of data in computing, representing either a 0 or a 1. Multiple bits are combined to form bytes, which are used to store larger data values."),
+                                ("Byte", "A unit of digital information that consists of 8 bits. A byte is commonly used to store a single character of text, such as a letter or a number, in computer memory."),
+                                ("Binary", "A number system that uses only two digits, 0 and 1, which are the fundamental building blocks of computer operations. Computers process and store all data in binary format, including text, images, and instructions."),
+                                ("Array", "A data structure that stores a fixed-size sequence of elements, all of the same type, in a contiguous block of memory. Arrays allow quick access to elements using an index and are commonly used to manage collections of data.")
+                            };
+
+                            // title
+                            column.Item().Extend().AlignMiddle().AlignCenter().Text("Programming Glossary").FontSize(32).Bold();
+                            column.Item().PageBreak();
+                            
+                            // table of contents
+                            column.Item().PaddingBottom(25).Text("Table of Contents").FontSize(24).Bold().Underline();
+                            
+                            foreach (var term in terms)
+                            {
+                                column.Item()
+                                    .PaddingBottom(10)
+                                    .SectionLink($"term-{term}")
+                                    .Text(text =>
+                                    {
+                                        text.Span("Term ");
+                                        text.Span(term.Item1).Bold();
+                                        text.Span(" on page ");
+                                        text.BeginPageNumberOfSection($"term-{term}");
+                                    });
+                            }
+                            
+                            // content
+                            foreach (var term in terms)
+                            {
+                                column.Item().PageBreak();
+                                
+                                column.Item()
+                                    .Section($"term-{term}")
+                                    .Text(text =>
+                                    {
+                                        text.Span(term.Item1).Bold().FontColor(Colors.Blue.Darken2);
+                                        text.Span(" - ");
+                                        text.Span(term.Item2);
+                                    });
+                            }
+                        });
+                });
+            })
+            .GeneratePdf("sections.pdf");
+    }
+}

+ 54 - 0
Source/QuestPDF.DocumentationExamples/ShowEntireExamples.cs

@@ -0,0 +1,54 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class ShowEntireExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(500, 500);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content() 
+                        .Decoration(decoration =>
+                        {
+                            var terms = new[]
+                            {
+                                ("Function", "A reusable block of code designed to perform a specific task. Functions take input parameters, process them, and return results, making code modular, readable, and maintainable. They are an essential component of all programming languages."),
+                                ("Recursion", "A programming technique where a function calls itself in order to solve a problem by breaking it down into smaller, similar subproblems. Recursion is often used for complex algorithms, such as searching, sorting, and tree traversal."),
+                                ("Framework", "A pre-built collection of code, tools, and best practices that provides a structured foundation for developing software. Frameworks simplify development by handling common functionalities, such as database access, user authentication, and UI rendering."),
+                                ("Package", "A self-contained collection of code, typically consisting of functions, classes, and modules, that provides specific functionality. Packages help organize large projects and allow developers to reuse and distribute their code easily."),
+                            };
+                            
+                            decoration.Before().Text("Terms and their definitions:").FontSize(24).Bold().Underline();
+                            
+                            decoration.Content().PaddingTop(15).Column(column =>
+                            {
+                                column.Spacing(15);
+                                
+                                foreach (var term in terms)
+                                {
+                                    column.Item()
+                                        .ShowEntire()
+                                        .Text(text =>
+                                        {
+                                            text.Span(term.Item1).Bold().FontColor(Colors.Blue.Darken2);
+                                            text.Span($" - {term.Item2}");
+                                        });
+                                }
+                            });
+                        });
+                });
+            })
+            .GenerateImages(x => $"show-entire-with-{x}.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

+ 69 - 0
Source/QuestPDF.DocumentationExamples/ShowOnceExamples.cs

@@ -0,0 +1,69 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class ShowOnceExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(350, 500);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Decoration(decoration =>
+                        {
+                            decoration.Before().Column(column =>
+                            {
+                                column.Item()
+                                    .ShowOnce()
+                                    .Row(row =>
+                                    {
+                                        row.ConstantItem(80).AspectRatio(4 / 3f).Placeholder();
+                                        row.ConstantItem(10);
+                                        row.RelativeItem()
+                                            .AlignMiddle()
+                                            .Column(innerColumn =>
+                                            {
+                                                innerColumn.Item().Text("Invoice #1234").FontSize(24).Bold();
+                                                innerColumn.Item().Text($"Generated on {DateTime.Now:d}").FontSize(16).Light();
+                                            });
+                                    });
+                                
+                                column.Item()
+                                    .SkipOnce()
+                                    .Text("Invoice #1234").FontSize(24).Bold();
+                            });
+                            
+                            // generate dummy content
+                            decoration.Content()
+                                .PaddingTop(15)
+                                .ExtendHorizontal()
+                                .Column(column =>
+                                {
+                                    column.Spacing(10);
+                                    
+                                    foreach (var i in Enumerable.Range(1, 15))
+                                    {
+                                        column.Item()
+                                            .Height(30)
+                                            .Background(Colors.Grey.Lighten3)
+                                            .AlignCenter()
+                                            .AlignMiddle()
+                                            .Text($"{i}");
+                                    }
+                                });
+                        });
+                });
+            })
+            .GenerateImages(x => $"show-once-{x}.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

+ 59 - 0
Source/QuestPDF.DocumentationExamples/SkipOnceExamples.cs

@@ -0,0 +1,59 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class SkipOnceExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.Size(500, 500);
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Column(column =>
+                        {
+                            var terms = new[]
+                            {
+                                ("Repository", "A centralized storage location for source code and related files, typically managed using version control systems like Git. Repositories allow multiple developers to collaborate on projects, track changes, and maintain version history."),
+                                ("Version Control", "A system that tracks changes to code over time, enabling developers to collaborate efficiently, revert to previous versions, and maintain a structured development workflow. Popular version control tools include Git, Mercurial, and Subversion."),
+                                ("Abstraction", "A programming concept that hides complex implementation details and exposes only the necessary parts. Abstraction helps simplify code and allows developers to focus on high-level design rather than low-level implementation details."),
+                                ("Namespace", "A container that groups related identifiers, such as variables, functions, and classes, to prevent naming conflicts in a program. Namespaces are commonly used in large projects to organize code efficiently."),
+                            };
+                            
+                            column.Spacing(15);
+                            
+                            foreach (var term in terms)
+                            {
+                                column.Item().Decoration(decoration =>
+                                {
+                                    decoration.Before()
+                                        .DefaultTextStyle(x => x.FontSize(24).Bold().FontColor(Colors.Blue.Darken2))
+                                        .Column(innerColumn =>
+                                        {
+                                            innerColumn.Item().ShowOnce().Text(term.Item1);
+                                            
+                                            innerColumn.Item().SkipOnce().Text(text =>
+                                            {
+                                                text.Span(term.Item1);
+                                                text.Span(" (continued)").Light().Italic();
+                                            });
+                                        });
+
+                                    decoration.Content().Text(term.Item2);
+                                });
+                            }
+                        });
+                });
+            })
+            .GenerateImages(x => $"skip-once-{x}.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

+ 47 - 0
Source/QuestPDF.DocumentationExamples/SvgExamples.cs

@@ -0,0 +1,47 @@
+using QuestPDF.Fluent;
+using QuestPDF.Helpers;
+using QuestPDF.Infrastructure;
+
+namespace QuestPDF.DocumentationExamples;
+
+public class SvgExamples
+{
+    [Test]
+    public void Example()
+    {
+        Document
+            .Create(document =>
+            {
+                document.Page(page =>
+                {
+                    page.MinSize(new PageSize(0, 0));
+                    page.MaxSize(new PageSize(1000, 1000));
+                    page.DefaultTextStyle(x => x.FontSize(20));
+                    page.Margin(25);
+
+                    page.Content()
+                        .Column(column =>
+                        {
+                            column.Spacing(15);
+
+                            column.Item().Text("Business details:").Bold().FontColor(Colors.Blue.Darken2);
+                            
+                            AddContactItem("Resources/Icons/phone.svg", Placeholders.PhoneNumber());
+                            AddContactItem("Resources/Icons/email.svg", Placeholders.Email());
+                            AddContactItem("Resources/Icons/web.svg", Placeholders.WebpageUrl());
+
+                            void AddContactItem(string iconPath, string label)
+                            {
+                                column.Item().Row(row =>
+                                {
+                                    row.ConstantItem(32).AspectRatio(1).Svg(iconPath);
+                                    row.ConstantItem(15);
+                                    row.AutoItem().AlignMiddle().Text(label);
+                                });
+                            }
+                        });
+                });
+            })
+            .GenerateImages(x => $"svg.webp", new ImageGenerationSettings() { ImageFormat = ImageFormat.Webp, ImageCompressionQuality = ImageCompressionQuality.Best, RasterDpi = 144 });
+    }
+}

Some files were not shown because too many files changed in this diff