Printing: Print all copies as one single print job
This commit is contained in:
@@ -24,19 +24,19 @@ namespace Elwig.Helpers.Printing {
|
||||
|
||||
using var printer = new Win32Printer.Printer(PrinterName);
|
||||
printer.TrySetDuplex(doublePaged ? Duplexing.TwoSidedLongEdge : Duplexing.OneSided);
|
||||
for (int i = 0; i < copies; i++) {
|
||||
printer.StartDocument(Path.GetFileName(pdfPath));
|
||||
bool documentStarted = true;
|
||||
try {
|
||||
for (int i = 0; i < copies; i++) {
|
||||
for (int j = 0; j < pageCount; j++) {
|
||||
PrintPage(document, printer, j);
|
||||
}
|
||||
}
|
||||
printer.EndDocument();
|
||||
documentStarted = false;
|
||||
} finally {
|
||||
if (documentStarted) printer.AbortDocument();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
PdfiumNative.FPDF_CloseDocument(document);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user