Printing: Use –FPDF_RenderPage instead of FPDF_RenderPageBitmap to allow vector graphics
Test / Run tests (push) Successful in 2m38s

This commit is contained in:
2026-08-10 18:35:49 +02:00
parent f13a836ebd
commit 20b19775b1
6 changed files with 365 additions and 118 deletions
+3 -14
View File
@@ -1,7 +1,6 @@
using Elwig.Services;
using Elwig.Windows;
using System;
using System.Drawing.Printing;
using System.Threading.Tasks;
namespace Elwig.Helpers.Printing {
@@ -32,20 +31,10 @@ namespace Elwig.Helpers.Printing {
});
}
public static async Task Print(string path, int copies = 1, bool doublePaged = false) {
await Print(path, new() {
Copies = (short)copies,
Collate = true,
Duplex = doublePaged ? Duplex.Vertical : Duplex.Simplex,
});
}
public static Task Print(string path, PrinterSettings settings) {
public static Task Print(string path, int copies = 1, bool doublePaged = false) {
try {
using var printDoc = new PdfPrintDocument(path) {
PrinterSettings = settings,
};
printDoc.Print();
var printer = new PdfPrinter();
printer.Print(path, copies, doublePaged);
} catch (Exception exc) {
InteractionService.ShowException("Fehler beim Drucken", "Beim Drucken ist ein Fehler aufgetreten", exc);
}