Printing: Use FPDF_RenderPage instead of FPDF_RenderPageBitmap to allow vector graphics
Test / Run tests (push) Successful in 2m38s
Test / Run tests (push) Successful in 2m38s
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user