|
@@ -35,33 +35,7 @@ namespace QuestPDF.Examples
|
|
|
|
|
|
|
|
text.Span(Placeholders.LoremIpsum());
|
|
text.Span(Placeholders.LoremIpsum());
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.Span("This text is a normal text, ");
|
|
|
|
|
- text.Span("this is a bold text, ", TextStyle.Default.Bold());
|
|
|
|
|
- text.Span("this is a red and underlined text, ", TextStyle.Default.Color(Colors.Red.Medium).Underlined());
|
|
|
|
|
- text.Span("and this is slightly bigger text.", TextStyle.Default.Size(16));
|
|
|
|
|
-
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.Span("The new text element also supports injecting custom content between words: ");
|
|
|
|
|
- text.Element().PaddingBottom(-10).Height(16).Width(32).Image(Placeholders.Image);
|
|
|
|
|
- text.Span(".");
|
|
|
|
|
-
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.Span("This is page number ");
|
|
|
|
|
- text.CurrentPageNumber();
|
|
|
|
|
- text.Span(" out of ");
|
|
|
|
|
- text.TotalPages();
|
|
|
|
|
-
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.ExternalLocation("Please visit QuestPDF website", "https://www.questpdf.com");
|
|
|
|
|
-
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.Span(Placeholders.Sentence());
|
|
|
|
|
|
|
+ text.Line("This is target text that does not show up. > This is a short sentence that will be wrapped into second line hopefully, right? <");
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -84,7 +58,6 @@ namespace QuestPDF.Examples
|
|
|
.Border(1)
|
|
.Border(1)
|
|
|
.Padding(5)
|
|
.Padding(5)
|
|
|
.Padding(10)
|
|
.Padding(10)
|
|
|
- .Debug()
|
|
|
|
|
.Text(text =>
|
|
.Text(text =>
|
|
|
{
|
|
{
|
|
|
text.DefaultTextStyle(TextStyle.Default);
|
|
text.DefaultTextStyle(TextStyle.Default);
|
|
@@ -93,52 +66,61 @@ namespace QuestPDF.Examples
|
|
|
|
|
|
|
|
text.Span(Placeholders.LoremIpsum());
|
|
text.Span(Placeholders.LoremIpsum());
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
|
|
|
text.Span("This text is a normal text, ");
|
|
text.Span("This text is a normal text, ");
|
|
|
text.Span("this is a bold text, ", TextStyle.Default.Bold());
|
|
text.Span("this is a bold text, ", TextStyle.Default.Bold());
|
|
|
text.Span("this is a red and underlined text, ", TextStyle.Default.Color(Colors.Red.Medium).Underlined());
|
|
text.Span("this is a red and underlined text, ", TextStyle.Default.Color(Colors.Red.Medium).Underlined());
|
|
|
text.Span("and this is slightly bigger text.", TextStyle.Default.Size(16));
|
|
text.Span("and this is slightly bigger text.", TextStyle.Default.Size(16));
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
|
|
|
text.Span("The new text element also supports injecting custom content between words: ");
|
|
text.Span("The new text element also supports injecting custom content between words: ");
|
|
|
text.Element().PaddingBottom(-10).Height(16).Width(32).Image(Placeholders.Image);
|
|
text.Element().PaddingBottom(-10).Height(16).Width(32).Image(Placeholders.Image);
|
|
|
text.Span(".");
|
|
text.Span(".");
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
|
|
|
text.Span("This is page number ");
|
|
text.Span("This is page number ");
|
|
|
text.CurrentPageNumber();
|
|
text.CurrentPageNumber();
|
|
|
text.Span(" out of ");
|
|
text.Span(" out of ");
|
|
|
text.TotalPages();
|
|
text.TotalPages();
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
|
|
|
text.ExternalLocation("Please visit QuestPDF website", "https://www.questpdf.com");
|
|
text.ExternalLocation("Please visit QuestPDF website", "https://www.questpdf.com");
|
|
|
|
|
+
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
+
|
|
|
|
|
+ text.Span(Placeholders.Paragraphs());
|
|
|
|
|
|
|
|
- text.NewLine();
|
|
|
|
|
-
|
|
|
|
|
- text.Span("This is target text that does not show up.");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
+
|
|
|
|
|
+ text.Span(Placeholders.Paragraphs(), TextStyle.Default.Italic());
|
|
|
|
|
+
|
|
|
|
|
+ text.Line("This is target text that does not show up. " + Placeholders.Paragraph());
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
[Test]
|
|
[Test]
|
|
|
- public void PageNumber()
|
|
|
|
|
|
|
+ public void HugeList()
|
|
|
{
|
|
{
|
|
|
RenderingTest
|
|
RenderingTest
|
|
|
.Create()
|
|
.Create()
|
|
|
- .PageSize(500, 400)
|
|
|
|
|
|
|
+ .PageSize(PageSizes.A4)
|
|
|
.FileName()
|
|
.FileName()
|
|
|
- .ProduceImages()
|
|
|
|
|
|
|
+ .ProducePdf()
|
|
|
.ShowResults()
|
|
.ShowResults()
|
|
|
.Render(container =>
|
|
.Render(container =>
|
|
|
{
|
|
{
|
|
|
container
|
|
container
|
|
|
|
|
+ .Padding(20)
|
|
|
.Padding(10)
|
|
.Padding(10)
|
|
|
.Box()
|
|
.Box()
|
|
|
.Border(1)
|
|
.Border(1)
|
|
|
|
|
+ .Padding(5)
|
|
|
.Padding(10)
|
|
.Padding(10)
|
|
|
.Text(text =>
|
|
.Text(text =>
|
|
|
{
|
|
{
|
|
@@ -146,10 +128,30 @@ namespace QuestPDF.Examples
|
|
|
text.AlignLeft();
|
|
text.AlignLeft();
|
|
|
text.ParagraphSpacing(10);
|
|
text.ParagraphSpacing(10);
|
|
|
|
|
|
|
|
- text.Span("This is page number ");
|
|
|
|
|
- text.CurrentPageNumber();
|
|
|
|
|
- text.Span(" out of ");
|
|
|
|
|
- text.TotalPages();
|
|
|
|
|
|
|
+ text.Span("This text is a normal text, ");
|
|
|
|
|
+ text.Span("this is a bold text, ", TextStyle.Default.Bold());
|
|
|
|
|
+ text.Span("this is a red and underlined text, ", TextStyle.Default.Color(Colors.Red.Medium).Underlined());
|
|
|
|
|
+ text.Span("and this is slightly bigger text.", TextStyle.Default.Size(16));
|
|
|
|
|
+
|
|
|
|
|
+ text.Span("The new text element also supports injecting custom content between words: ");
|
|
|
|
|
+ text.Element().PaddingBottom(-10).Height(16).Width(32).Image(Placeholders.Image);
|
|
|
|
|
+ text.Span(".");
|
|
|
|
|
+
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var i in Enumerable.Range(1, 100))
|
|
|
|
|
+ {
|
|
|
|
|
+ text.Line($"{i}: {Placeholders.Paragraph()}");
|
|
|
|
|
+
|
|
|
|
|
+ text.EmptyLine();
|
|
|
|
|
+
|
|
|
|
|
+ text.ExternalLocation("Please visit QuestPDF website", "https://www.questpdf.com");
|
|
|
|
|
+
|
|
|
|
|
+ text.Span("This is page number ");
|
|
|
|
|
+ text.CurrentPageNumber();
|
|
|
|
|
+ text.Span(" out of ");
|
|
|
|
|
+ text.TotalPages();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|