Browse Source

Adjustment: increased the default DPI setting from 144 to 288 to better match industry standards and provide visuals of expected quality. To counterbalance for potential output size increase, the image quality has been decreased from "very high" to "high" (JPEG 90 to 75).

Marcin Ziąbek 2 years ago
parent
commit
35bc902e4d

+ 1 - 1
Source/QuestPDF/Fluent/GenerateExtensions.cs

@@ -111,7 +111,7 @@ namespace QuestPDF.Fluent
 
         #region Helpers
 
-        private static void OpenFileUsingDefaultProgram(string filePath)
+        internal static void OpenFileUsingDefaultProgram(string filePath)
         {
             var process = new Process
             {

+ 2 - 2
Source/QuestPDF/Fluent/ImageExtensions.cs

@@ -35,7 +35,7 @@ namespace QuestPDF.Fluent
         /// 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.
+        /// Default value is 288.
         /// </summary>
         public ImageDescriptor WithRasterDpi(int dpi)
         {
@@ -47,7 +47,7 @@ namespace QuestPDF.Fluent
         /// 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 ImageDescriptor WithCompressionQuality(ImageCompressionQuality quality)
         {

+ 3 - 3
Source/QuestPDF/Infrastructure/DocumentSettings.cs

@@ -17,15 +17,15 @@
         /// When the image contains an alpha channel, it is always encoded using the PNG format and this option is ignored.
         /// The default value is "high quality".
         /// </summary>
-        public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.VeryHigh;
+        public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.High;
 
         /// <summary>
         /// 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.
+        /// Default value is 288.
         /// </summary>
-        public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 2;
+        public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 4;
  
         public ContentDirection ContentDirection { get; set; } = ContentDirection.LeftToRight;
         

+ 3 - 3
Source/QuestPDF/Infrastructure/ImageGenerationSettings.cs

@@ -13,13 +13,13 @@ namespace QuestPDF.Infrastructure
         /// Encoding quality controls the trade-off between size and quality.
         /// The default value is "high quality".
         /// </summary>
-        public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.VeryHigh;
+        public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.High;
 
         /// <summary>
         /// The DPI (pixels-per-inch) at which the document will be rasterized. This parameter controls the resolution of produced images.
-        /// Default value is 144.
+        /// Default value is 288.
         /// </summary>
-        public int RasterDpi { get; set; } = DocumentSettings.DefaultRasterDpi * 2;
+        public int RasterDpi { get; set; } = DocumentSettings.DefaultRasterDpi * 4;
 
 
         public static ImageGenerationSettings Default => new ImageGenerationSettings();