michaelweghorn created this revision. michaelweghorn added a reviewer: Okular. Restricted Application added a project: Okular. michaelweghorn requested review of this revision.
REVISION SUMMARY This adds a checkbox in the print dialog to make it possible to select whether or not to scale the printed document to the printable area when printing. QPrinter::setFullPage() is used which makes the print margins to be ignored in case of the QPrinter based approach (e.g. "Force rasterization" option enabled). For the case where FilePrinter is used, the "fit-to-page" option is (not) passed based on the value that was set. BUG: 336617 TEST PLAN 1. Open a PDF file in Okular (using a document size that matches a paper size available on the printer used later makes it easier to see things behave as expected) 2. open print dialog, go to "PDF options" and notice that there is a new "Fit to printable area" checkbox that is enabled by default. 3. don't change any options, print to a printer that has hardware margins Expected result: the document is scaled to the printable area (e.g. scaled down so that the printer's hardware margins remain empty) as it has been without this change. 4. disable the "PDF options" -> "Fit to printable area" checkbox and print again Expected result: the document is not scaled at all now. 5. print again, now leaving "Fit to printable area" enabled and selecting "Force rasterize" in addition. Expected result: The document is scaled to the printable area (as it was without this change). 5. print again, now disabling "Fit to printable area" and selecting "Force rasterize" in addition. Expected result: The document is scaled to the full page size, i.e. ignoring the printers hardware margins. REPOSITORY R223 Okular BRANCH michaelweghorn/kdebug336617_makeFitToPageOptional REVISION DETAIL https://phabricator.kde.org/D10974 AFFECTED FILES core/fileprinter.cpp generators/poppler/generator_pdf.cpp To: michaelweghorn, #okular Cc: michaelweghorn, ngraham, aacid