diff --git a/Source/QuestPDF/Elements/Image.cs b/Source/QuestPDF/Elements/Image.cs index ca91841..14fd0f2 100644 --- a/Source/QuestPDF/Elements/Image.cs +++ b/Source/QuestPDF/Elements/Image.cs @@ -12,9 +12,7 @@ namespace QuestPDF.Elements internal bool UseOriginalImage { get; set; } internal int? TargetDpi { get; set; } internal ImageCompressionQuality? CompressionQuality { get; set; } - - private const float ImageSizeSimilarityToleranceMax = 0.75f; - + ~Image() { if (DocumentImage is { IsDocumentScoped: true }) diff --git a/Source/QuestPDF/Fluent/GenerateExtensions.cs b/Source/QuestPDF/Fluent/GenerateExtensions.cs index 391053b..5479a59 100644 --- a/Source/QuestPDF/Fluent/GenerateExtensions.cs +++ b/Source/QuestPDF/Fluent/GenerateExtensions.cs @@ -29,9 +29,13 @@ namespace QuestPDF.Fluent DocumentGenerator.GeneratePdf(stream, document); } + private static int GenerateAndShowCounter = 0; + public static void GeneratePdfAndShow(this IDocument document) { - var filePath = Path.Combine(Path.GetTempPath(), $"QuestPDF Document.pdf"); + GenerateAndShowCounter++; + + var filePath = Path.Combine(Path.GetTempPath(), $"QuestPDF Document {GenerateAndShowCounter}.pdf"); document.GeneratePdf(filePath); OpenFileUsingDefaultProgram(filePath); } diff --git a/Source/QuestPDF/Infrastructure/DocumentSettings.cs b/Source/QuestPDF/Infrastructure/DocumentSettings.cs index 2447ac1..650408f 100644 --- a/Source/QuestPDF/Infrastructure/DocumentSettings.cs +++ b/Source/QuestPDF/Infrastructure/DocumentSettings.cs @@ -15,7 +15,7 @@ /// Encoding quality controls the trade-off between size and quality. /// When the image is opaque, it will be encoded using the JPEG format with the selected quality setting. /// When the image contains an alpha channel, it is always encoded using the PNG format and this option is ignored. - /// The default value is "very high quality". + /// The default value is "high quality". /// public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.VeryHigh; @@ -25,7 +25,7 @@ /// When generating images, this parameter also controls the resolution of the generated content. /// Default value is 144. /// - public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 2; + public int RasterDpi { get; set; } = DefaultRasterDpi * 2; public ContentDirection ContentDirection { get; set; } = ContentDirection.LeftToRight;