Image: added support for common overloads

This commit is contained in:
Marcin Ziąbek
2021-10-29 01:23:46 +02:00
parent 5a886452cf
commit 011668fb4c
7 changed files with 133 additions and 7 deletions
+41
View File
@@ -0,0 +1,41 @@
using System.IO;
using NUnit.Framework;
using QuestPDF.Examples.Engine;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
namespace QuestPDF.Examples
{
public class ImageExamples
{
[Test]
public void LoadingImage()
{
RenderingTest
.Create()
.PageSize(PageSizes.A5)
.ProducePdf()
.ShowResults()
.Render(page =>
{
page.Padding(25).Stack(stack =>
{
stack.Spacing(25);
stack.Item().Image(File.ReadAllBytes("logo.png"));
stack.Item().Image("logo.png");
});
});
}
[Test]
public void Exception()
{
RenderingTest
.Create()
.PageSize(PageSizes.A5)
.ProducePdf()
.ShowResults()
.Render(page => page.Image("non_existent.png"));
}
}
}