DPI-based image scaling prototype (not ready for production)

This commit is contained in:
MarcinZiabek
2023-04-22 09:30:46 +02:00
parent 1c9bccbeb2
commit 8a358a8fa2
6 changed files with 84 additions and 2 deletions
@@ -0,0 +1,22 @@
using System;
using System.Diagnostics;
using System.IO;
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
namespace QuestPDF.Examples.Engine
{
public static class Helpers
{
public static void GeneratePdfAndOpen(this Document document, string? fileName = null)
{
fileName ??= $"{Guid.NewGuid():D}.pdf";
var filePath = Path.GetTempPath() + fileName;
var documentData = document.GeneratePdf();
File.WriteAllBytes(filePath, documentData);
Process.Start("explorer", filePath);
}
}
}