[okular] [Bug 527883] New: Selecting "None; print original size" (or setting it as default) forcibly enables "Force rasterization", degrading vector print quality to 300 DPI bitmap
Ernst Kloppenburg
bugzilla_noreply at kde.org
Tue Oct 27 11:12:41 GMT 2026
https://bugs.kde.org/show_bug.cgi?id=527883
Bug ID: 527883
Summary: Selecting "None; print original size" (or setting it
as default) forcibly enables "Force rasterization",
degrading vector print quality to 300 DPI bitmap
Classification: Applications
Product: okular
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: PDF backend
Assignee: okular-devel at kde.org
Reporter: ernst.kloppenburg at gmx.de
Target Milestone: ---
SUMMARY
(Disclaimer: This code analysis and bug report were prepared with AI
assistance. But I think it is correct.)
In Okular's PDF print options (`generators/poppler/generator_pdf.cpp`, class
`PDFOptionsPage`), selecting `Scale mode: None; print original size` (or
configuring it as the default in Settings -> Configure Backends -> PDF, i.e.
`PrintScaleMode=2`) automatically checks the "Force rasterization" checkbox:
// Set scale mode to users default
m_scaleMode->setCurrentIndex(PDFSettings::printScaleMode());
// Set rasterizing if scale mode is 1 or 2
if (m_scaleMode->currentIndex() != 0) {
m_forceRaster->setCheckState(Qt::Checked);
}
connect(m_scaleMode, &QComboBox::currentIndexChanged, this, [=, this](int
index) {
m_forceRaster->setChecked(index != 0);
});
When "Force rasterization" is enabled, `PDFGenerator::print()` rasterizes every
page into a 300x300 DPI bitmap (`pp->renderToImage(300, 300)`) and draws it via
`QPainter` instead of passing vector PDF/PostScript to CUPS. On 600-1200 DPI
laser printers, this makes text and line art visibly blurry/jagged and
substantially increases spooling size and time (as others have reported in
various bug reports already).
Furthermore, when a user configures "None; print original size" as their
default in Settings -> Configure Backends -> PDF specifically to avoid opening
the "PDF Options" tab on every print job, "Force rasterization" is silently
checked in the background every time they press Ctrl+P and hit Enter.
WHY "FORCE RASTERIZATION" HAS BEEN TIED TO "SCALE MODE"
Tracing the git history shows how `m_forceRaster` and `m_scaleMode` became
coupled:
1. Commit 2e97d587 (Dec 2018) introduced the `Scale mode` combobox
(`FitToPrintableArea`, `FitToPage`, `None`), initially implemented only inside
the `if (forceRasterize)` `QPainter` branch, so `m_scaleMode` was disabled
unless `m_forceRaster` was checked.
2. Commit 748884b4 (Apr 2019, D18179, "PDF: Implement scaling options for
non-rasterized printing") implemented `FilePrinter::ScaleMode::NoScaling` vs
`FitToPrintArea` for non-rasterized CUPS printing and enabled `m_scaleMode`
when `m_forceRaster` is unchecked. (Later, commit 6d2dec63 in Sept 2024 also
added direct PDF-to-CUPS piping using this same `filePrinterScaleMode`).
3. However, `PDFOptionsPage::ignorePrintMargins()` (`generator_pdf.cpp:132`,
added in commit 8bf1a911) only returns `true` for `scaleMode() == FitToPage`,
returning `false` for `None`. Consequently, when `scaleMode == None`,
`printer.fullPage()` remains `false`, and `FilePrinter::optionPageMargins()`
(`core/fileprinter.cpp:474`) still passes `-o page-left=... -o page-top=... -o
page-right=... -o page-bottom=...` (the printer's hardware margins) to `lpr`
even when `scaleMode == ScaleMode::NoScaling`.
4. In Sept 2021 (Bug 434247 / Bug 442775, commit 51d91bfd, MR 487), because
users reported that changing `Scale mode` did not behave as expected without
checking `Force rasterization`, `m_scaleMode` was wired to auto-check
`m_forceRaster` whenever `index != 0`.
5. In May 2023 (Bug 463732, commit 8afcf256), when
`PDFSettings::printScaleMode()` was added to allow configuring the default
scale mode, `if (m_scaleMode->currentIndex() != 0)
m_forceRaster->setCheckState(Qt::Checked);` was added to `PDFOptionsPage()`,
causing "Force rasterization" to be turned ON by default whenever the user's
configured default scale mode is 1 or 2.
RELATIONSHIP TO OTHER BUG REPORTS (WHY THIS IS NOT A DUPLICATE)
Users affected by this behavior have recently commented on two existing bug
reports:
- Bug 399447 Comment 10 & 11 (https://bugs.kde.org/show_bug.cgi?id=399447#c11)
- Bug 463732 Comment 12 (https://bugs.kde.org/show_bug.cgi?id=463732#c12)
However, this issue is distinct from both of those reports:
- Bug 399447 is about Qt's `QPrintDialog` remembering the expanded state of the
"Options >>" button across sessions.
- Bug 463732 (RESOLVED FIXED) was about adding a configuration option for the
default PDF print scale mode (`PrintScaleMode`), whose implementation (commit
8afcf256) introduced the startup check that forces `m_forceRaster` ON when
`PrintScaleMode != 0`.
- Bug 434247 (RESOLVED FIXED) was the 2021 report where commit 51d91bfd tied
`m_scaleMode` changes to `m_forceRaster` as a workaround.
Therefore, this bug is filed separately to specifically track disentangling
"Force rasterization" from "Scale mode" (especially for "None; print original
size") and fixing margin handling in the non-rasterized printing path.
STEPS TO REPRODUCE
1. Open Okular -> Settings -> Configure Backends... -> PDF, and set "Default
scaling mode when printing:" to "None; print original size" (or open the Print
dialog and select "None; print original size" in the PDF Options tab).
2. Open a vector PDF document and press Ctrl+P -> Options >> -> PDF Options.
3. Observe the state of the "Force rasterization" checkbox and the resulting
print output on a laser printer.
OBSERVED RESULT
"Force rasterization" is automatically checked whenever "None; print original
size" is selected or configured as default. If the user prints without manually
unchecking "Force rasterization" every time, Okular renders the PDF to a 300
DPI raster image instead of sending vector data to CUPS.
EXPECTED RESULT
1. Selecting "None; print original size" (or configuring it as the default
scaling mode) should not force "Force rasterization" ON.
2. Non-rasterized printing with "None; print original size"
(`FilePrinter::ScaleMode::NoScaling`) should omit hardware page margins
(`page-left`/`page-top`/`page-right`/`page-bottom`) as well as `fit-to-page`,
printing vector PDF/PostScript at true 1:1 (100%) original size.
WORK IN PROGRESS / PATCH
I am working on a patch / Merge Request to address this by:
1. Updating `PDFOptionsPage::ignorePrintMargins()` and
`FilePrinter::optionPageMargins()` so that `ScaleMode::NoScaling` (`None; print
original size`) does not apply printable-area hardware margins.
2. Disentangling `m_forceRaster` from `m_scaleMode` in `PDFOptionsPage` so that
"None; print original size" does not automatically enable 300 DPI bitmap
rasterization.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list