Skip to content

Commit 6856351

Browse files
chenjun198218202781743
authored andcommitted
fix: 修复打印PDF文件时逐份打印选项异常
修复打印PDF文件时逐份打印选项异常 Log: 修复文档查看器打印预览逐份打印不正常问题 Bug: https://pms.uniontech.com/bug-view-267279.html Influence: 打印PDF时正常逐份打印 Change-Id: I077c325080ac5cf12c955f0d311490a5d44c21fd
1 parent 440d87a commit 6856351

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/widgets/dprintpreviewdialog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,9 @@ void DPrintPreviewDialogPrivate::setupPrinter()
13571357
pview->isPageByPage(printer->copyCount(), isFirst);
13581358
//由于手动设置逐页打印,这种情况下,输出打印机的打印份数为1
13591359
printer->setCopyCount(1);
1360+
} else {
1361+
// 设置多分打印时逐份打印
1362+
printer->setCollateCopies(true);
13601363
}
13611364
}
13621365

src/widgets/dprintpreviewwidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,10 @@ PrintOptions DPrintPreviewWidgetPrivate::printerOptions()
746746
options.append(QPair<QByteArray, QByteArray>(QStringLiteral("copies").toLocal8Bit(), QString::number(previewPrinter->copyCount()).toLocal8Bit()));
747747
options.append(QPair<QByteArray, QByteArray>(QStringLiteral("fit-to-page").toLocal8Bit(), QStringLiteral("true").toLocal8Bit()));
748748

749+
if (previewPrinter->collateCopies()) {
750+
options.append(QPair<QByteArray, QByteArray>(QStringLiteral("collate").toLocal8Bit(), QStringLiteral("true").toLocal8Bit()));
751+
}
752+
749753
if (pageRangeMode != DPrintPreviewWidget::AllPage) {
750754
QString pageRangeString;
751755
if (pageRangeMode == DPrintPreviewWidget::CurrentPage) {

0 commit comments

Comments
 (0)