MarcinZiabek 2 年 前
コミット
fc8a788cf7

+ 1 - 3
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 })

+ 5 - 1
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);
         }

+ 2 - 2
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".
         /// </summary>
         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.
         /// </summary>
-        public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 2;
+        public int RasterDpi { get; set; } = DefaultRasterDpi * 2;
  
         public ContentDirection ContentDirection { get; set; } = ContentDirection.LeftToRight;