2021-03-01 16:24:59 +01:00
|
|
|
using QuestPDF.Drawing;
|
|
|
|
|
using QuestPDF.Fluent;
|
|
|
|
|
using QuestPDF.Helpers;
|
|
|
|
|
using QuestPDF.Infrastructure;
|
|
|
|
|
|
|
|
|
|
namespace QuestPDF.Examples.Engine
|
|
|
|
|
{
|
|
|
|
|
public class SimpleDocument : IDocument
|
|
|
|
|
{
|
|
|
|
|
private IContainer Container { get; }
|
|
|
|
|
private Size Size { get; }
|
|
|
|
|
|
|
|
|
|
public SimpleDocument(IContainer container, Size size)
|
|
|
|
|
{
|
|
|
|
|
Container = container;
|
|
|
|
|
Size = size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DocumentMetadata GetMetadata()
|
|
|
|
|
{
|
|
|
|
|
return new DocumentMetadata()
|
|
|
|
|
{
|
|
|
|
|
RasterDpi = PageSizes.PointsPerInch * 2,
|
|
|
|
|
Size = Size
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Compose(IContainer container)
|
|
|
|
|
{
|
2021-03-23 14:43:03 +01:00
|
|
|
container.Background("#FFF").Element(Container.Child);
|
2021-03-01 16:24:59 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|