From e3ce194fd152cfe66daa63cea436a0dfc78da4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zi=C4=85bek?= Date: Sun, 16 Jan 2022 17:03:01 +0100 Subject: [PATCH] Simple SVG example --- QuestPDF.Examples/QuestPDF.Examples.csproj | 4 + QuestPDF.Examples/SvgImageExample.cs | 36 +++++ QuestPDF.Examples/pdf-icon.svg | 149 +++++++++++++++++++++ 3 files changed, 189 insertions(+) create mode 100644 QuestPDF.Examples/SvgImageExample.cs create mode 100644 QuestPDF.Examples/pdf-icon.svg diff --git a/QuestPDF.Examples/QuestPDF.Examples.csproj b/QuestPDF.Examples/QuestPDF.Examples.csproj index 13b26ba..33c0812 100644 --- a/QuestPDF.Examples/QuestPDF.Examples.csproj +++ b/QuestPDF.Examples/QuestPDF.Examples.csproj @@ -12,6 +12,7 @@ + @@ -28,6 +29,9 @@ PreserveNewest + + PreserveNewest + diff --git a/QuestPDF.Examples/SvgImageExample.cs b/QuestPDF.Examples/SvgImageExample.cs new file mode 100644 index 0000000..ff92d05 --- /dev/null +++ b/QuestPDF.Examples/SvgImageExample.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; +using QuestPDF.Examples.Engine; +using QuestPDF.Fluent; +using QuestPDF.Helpers; +using QuestPDF.Infrastructure; +using SkiaSharp; +using Svg.Skia; + +namespace QuestPDF.Examples +{ + public class SvgImageExample + { + [Test] + public void BorderRadius() + { + RenderingTest + .Create() + .PageSize(175, 100) + .ProduceImages() + .ShowResults() + .Render(container => + { + container + .Background(Colors.Grey.Lighten2) + .Padding(25) + .Canvas((canvas, space) => + { + using var svg = new SKSvg(); + svg.Load("pdf-icon.svg"); + + canvas.DrawPicture(svg.Picture); + }); + }); + } + } +} \ No newline at end of file diff --git a/QuestPDF.Examples/pdf-icon.svg b/QuestPDF.Examples/pdf-icon.svg new file mode 100644 index 0000000..a44518f --- /dev/null +++ b/QuestPDF.Examples/pdf-icon.svg @@ -0,0 +1,149 @@ + + + + + PDF file icon + + + + + + + + + + image/svg+xml + + PDF file icon + 08/10/2018 + + + Adobe Systems + + + + + CMetalCore + + + Fuente del texto "PDF": +Franklin Gothic Medium Cond + + + + + + + + + + + + + + + + + + + + + + + + + + +