Bug 363788 - Fit to page printing does incorrect scaling and unwanted offsetting
Summary: Fit to page printing does incorrect scaling and unwanted offsetting
Status: RESOLVED DUPLICATE of bug 383734
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: 0.21.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-01 10:21 UTC by Tristan Miller
Modified: 2017-11-26 17:27 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A sample A0-size document (testa0.pdf) (82.81 KB, application/pdf)
2016-06-01 10:22 UTC, Tristan Miller
Details
A sample A5-size document (testa5.pdf) (82.81 KB, application/pdf)
2016-06-01 10:23 UTC, Tristan Miller
Details
Scan showing result of printing testa0.pdf on A4 paper with okular (46.70 KB, application/pdf)
2016-06-01 10:25 UTC, Tristan Miller
Details
Scan showing result of printing testa5.pdf on A4 paper with okular (473.76 KB, application/pdf)
2016-06-01 10:26 UTC, Tristan Miller
Details
Scan showing result of printing testa0.pdf or testa5.pdf on A4 paper with "lpr -o fit-to-page" (473.76 KB, application/pdf)
2016-06-01 10:26 UTC, Tristan Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2016-06-01 10:21:54 UTC
As a consequence of Bug 319476, Okular now tries to fit the document to the page size when printing.  However, it doesn't work at all for me.  Trying to print a PDF which uses a larger page size than the printer media results in the document being scaled down far too small.  And trying to fit a PDF which uses a smaller page size than the printer media results in the document being scaled up the appropriate amount, but then offset several centimetres on the page, resulting in much of it being cut off.

I have tried this with several different HP and Brother printers and always get the same result.  By contrast, using CUPS's "lpr -o fit-to-page" works as expected.  I also have no problems printing such documents with other PDF viewers such as evince.

I will add several attachments to this report with sample A0 and A5-size documents, along with scans of what happens when I use Okular and lpr to print these on A4 paper.

Reproducible: Always
Comment 1 Tristan Miller 2016-06-01 10:22:47 UTC
Created attachment 99302 [details]
A sample A0-size document (testa0.pdf)
Comment 2 Tristan Miller 2016-06-01 10:23:57 UTC
Created attachment 99303 [details]
A sample A5-size document (testa5.pdf)
Comment 3 Tristan Miller 2016-06-01 10:25:44 UTC
Created attachment 99304 [details]
Scan showing result of printing testa0.pdf on A4 paper with okular
Comment 4 Tristan Miller 2016-06-01 10:26:06 UTC
Created attachment 99305 [details]
Scan showing result of printing testa5.pdf on A4 paper with okular
Comment 5 Tristan Miller 2016-06-01 10:26:55 UTC
Created attachment 99306 [details]
Scan showing result of printing testa0.pdf or testa5.pdf on A4 paper with "lpr -o fit-to-page"
Comment 6 Burkhard Lück 2016-06-01 10:33:11 UTC
Kubuntu 16.04 Xenial 
$ okular --version
Qt: 4.8.7
KDE: 4.14.16
Okular: 0.24.2
Poppler 0.41.0

I can print your a5 + a0 test documents to an A4 printer without the scaling issues you reported
Comment 7 Luigi Toscano 2016-06-01 10:37:48 UTC
The version of cups packages could be another important information to report (for both cases, when it works and when it does not).
Comment 8 Burkhard Lück 2016-06-01 10:47:50 UTC
Ghostscript 9.18 (2015-10-05)
cups 2.1.3-4
Comment 9 Tristan Miller 2016-06-01 11:02:48 UTC
I'm using CUPS 1.5.4.  (According to https://en.opensuse.org/Portal:Printing#Deal_with_the_major_incompatible_changes_since_CUPS_1.6 this is the latest version available for openSUSE 13.2, though the next release will feature CUPS 2.x.)
Comment 10 Grzegorz Wozniak 2016-11-06 08:33:37 UTC
Same behaviour on Debian 8:
Okular version:
Version 0.20.2
Using KDE Development Platform 4.14.2

Cups: 1.7.5-11+deb8u1

Ghostscript: 9.06~dfsg-2+deb8u4
Comment 11 Ferry 2016-11-21 13:20:47 UTC
This is regressing in Okular 0.25.0 (using KDE platform 4.14.22) in Kubuntu Yakkety Yak (16.10).

Okular prints A4 pages in A5 size (so unnecessarily shrinks the page) on a A4 printer, this does not happen with other applications (Documentviewer printing the same pdf, Libreoffice printing other documents).

This happens when printing to our cups printer server (Kubuntu Xenial) which prints to the HP laser (2 different tried both with network connection and PS support).
When printing directly to the network printer the downscaling does not happen.
Comment 12 Petrer 2016-12-07 14:32:54 UTC
I'm also impacted by this printing issue but in a different way. I have a pdf that is exactly correct size of some labels we have - including the margins. When I use okular to print it scale it down and then it no longer lines up on the labels. 
My only workaround for the moment is to open the pdf in firefox and print from there, because in there it is a check box "ignore scaling and fit" which I can leave unchecked and with that get my labels to line up.
Comment 13 Christian Herenz 2017-01-27 20:02:24 UTC
(In reply to Ferry from comment #11)

> Okular prints A4 pages in A5 size (so unnecessarily shrinks the page) on a
> A4 printer, this does not happen with other applications (Documentviewer
> printing the same pdf, Libreoffice printing other documents).

I can confirm the A4 to A5 shrinking here.

Qt: 4.8.6
KDE: 4.14.25
Okular: 0.26.1

CUPS 1.7.5
Comment 14 Sergio 2017-07-12 15:53:48 UTC
Unconditionally trying to fit the document to the page side is not always the sensible thing to do.

For instance, if you have a photo in a PDF document, and that is smaller than the paper in your printer, you cannot put it on paper at its intended size.

Okular should provide the options to:
- Do not scale
- Fit to page
- Reduce to page

As almost all PDF readers do.
Comment 15 Nate Graham 2017-09-13 02:32:18 UTC

*** This bug has been marked as a duplicate of bug 383734 ***
Comment 16 Karl 2017-11-26 13:42:51 UTC
(In reply to Petrer from comment #12)
> I'm also impacted by this printing issue but in a different way. I have a
> pdf that is exactly correct size of some labels we have - including the
> margins. When I use okular to print it scale it down and then it no longer
> lines up on the labels. 
> My only workaround for the moment is to open the pdf in firefox and print
> from there, because in there it is a check box "ignore scaling and fit"
> which I can leave unchecked and with that get my labels to line up.

I have the same problem. My PDF and PS files have correct margins of, for example, 1 inch. Printing with okular makes the margins larger and thus scales the documents down. Furthermore, it is no longer possible to set the margins to zero. (Okular 1.1.2 that ships with openSUSE leap 42.3)

Since there seems to be no way to avoid this behavior I can no longer use okular at all. This is sad, as earlier versions did not have this bug.

I do not know of any document without proper margins. These margins are generally wider than the hardware limits of the printer. Hence, there is in general no need to scale a document to the area within the hardware limits. Hence, the default behaviour of okular should be to print a document without any scaling, i.e. it should by default _not_ try to fit the document to the page. Any other behaviour should be an option.
Comment 17 Nate Graham 2017-11-26 17:27:02 UTC
This bug is marked as a duplicate of Bug 383734, which is marked as fixed in the Okular that comes with KDE Applications 17.08. If you are using that version (or a newer one) and still see the issue, please mention it in Bug 383734.