Minor fixes

This commit is contained in:
MarcinZiabek
2023-05-11 23:58:53 +02:00
parent 5d2d97097c
commit fc8a788cf7
3 changed files with 8 additions and 6 deletions
+1 -3
View File
@@ -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
View File
@@ -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);
}
@@ -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;