From 045b2a43b8ea46e7af85ea4f8306776c6aa28010 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Wed, 17 May 2023 16:08:47 +0200 Subject: [PATCH] Settings for the GenerateImages() method --- .../Infrastructure/ImageGenerationSettings.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Source/QuestPDF/Infrastructure/ImageGenerationSettings.cs diff --git a/Source/QuestPDF/Infrastructure/ImageGenerationSettings.cs b/Source/QuestPDF/Infrastructure/ImageGenerationSettings.cs new file mode 100644 index 0000000..29be37d --- /dev/null +++ b/Source/QuestPDF/Infrastructure/ImageGenerationSettings.cs @@ -0,0 +1,28 @@ +using SkiaSharp; + +namespace QuestPDF.Infrastructure +{ + public class ImageGenerationSettings + { + /// + /// The file format used to encode the image(s). + /// + public SKEncodedImageFormat Format { get; set; } = SKEncodedImageFormat.Png; + + /// + /// The quality level to use for the image(s). This is in the range from 0-100. + /// + public int Quality { get; set; } = 100; + + /// + /// The DPI (pixels-per-inch) at which images and features without native PDF support will be rasterized. + /// A larger DPI would create a PDF that reflects the original intent with better fidelity, but it can make for larger PDF files too, which would use more memory while rendering, and it would be slower to be processed or sent online or to printer. + /// When generating images, this parameter also controls the resolution of the generated content. + /// Default value is 144. + /// + public int RasterDpi { get; set; } = 144; + + + public static ImageGenerationSettings Default => new ImageGenerationSettings(); + } +} \ No newline at end of file