Bug 498929 - Printing dimensions are inaccurate
Summary: Printing dimensions are inaccurate
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: 21.12.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-20 17:52 UTC by Oliver Becker
Modified: 2025-01-24 14:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Technical drawing with specific dimensions (3.41 KB, application/pdf)
2025-01-20 17:52 UTC, Oliver Becker
Details
Dimensioned box (100x150mm) (1.14 KB, application/pdf)
2025-01-23 10:02 UTC, Oliver Becker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Becker 2025-01-20 17:52:56 UTC
Created attachment 177553 [details]
Technical drawing with specific dimensions

When printing a PDF with a technical drawing, the resulting print's dimensions are off by ~3,5%, whereas other programs (e.g. Inkscape) print the same PDF with correct dimensions.


STEPS TO REPRODUCE
1. Open a PDF with drawings with a specific size
2. Print the file with a printer
3. Measure the resulting dimensions

OBSERVED RESULT
Dimensions are off by ~3,5% (8.3mm vs. the correct 8.6mm).

EXPECTED RESULT
Dimensions are correct (within margins of error regarding resolution of PDF/printer).

SOFTWARE/OS VERSIONS
Linux: Ubuntu 22.04.5 LTS
KDE Plasma Version: 5.24.7
KDE Frameworks Version:  5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
* Could not reproduce by just printing the PDF again as a PDF, has to be printed with a printer.
* Dimensions in the attached PDF can be verified by importing it in an appropriate program (e.g. Inkscape)
Comment 1 John Kizer 2025-01-23 07:19:36 UTC
Hi - thanks for the bug report! Okular 21.12 is no longer supported by KDE - could I please ask you to see if this issue still persists in an up-to-date version? The current 24.12.1 version should be available on Ubuntu via either Snap or Flatpak.

Thanks!
Comment 2 Oliver Becker 2025-01-23 10:01:39 UTC
(In reply to John Kizer from comment #1)
> Hi - thanks for the bug report! Okular 21.12 is no longer supported by KDE -
> could I please ask you to see if this issue still persists in an up-to-date
> version? The current 24.12.1 version should be available on Ubuntu via
> either Snap or Flatpak.
> 
> Thanks!

I just tested it with 24.12.1 with the same results. Okular prints a 100mm wide rectangle with 96.3mm vs Inkscape's 100mm.
Printed with 0.05mm line width and measured with calipers.
Comment 3 Oliver Becker 2025-01-23 10:02:37 UTC
Created attachment 177611 [details]
Dimensioned box (100x150mm)

I added a better PDF for testing with a 100x150mm box
Comment 4 Oliver Sander 2025-01-23 10:06:33 UTC
By default, Okular scales the page slightly to fit onto the printable part of the physical page. If you need the exact size then in the print dialog please choose "pdf options -> scale mode -> original size". That should suppress the scaling (and will in turn cut off everything to close to the margins).
Comment 5 Oliver Becker 2025-01-23 10:33:18 UTC
(In reply to Oliver Sander from comment #4)
> By default, Okular scales the page slightly to fit onto the printable part
> of the physical page. If you need the exact size then in the print dialog
> please choose "pdf options -> scale mode -> original size". That should
> suppress the scaling (and will in turn cut off everything to close to the
> margins).

That worked, thank you!

Now only two questions remain:
* Is there a way to set the default to "original size"?
* Wouldn't a user expect a PDF with margins already at least as wide as the printers (e.g. created with a word processor) to be printed as is, without it being scaled down unnecessarily (in this case)?
Comment 6 Oliver Sander 2025-01-24 14:09:02 UTC
* Is there a way to set the default to "original size"?

Not as far as I know. That would certainly be helpful, and likely not difficult to code.

* Wouldn't a user expect a PDF with margins already at least as wide as the printers (e.g. created with a word processor) to be printed as is, without it being scaled down unnecessarily (in this case)?

I have no strong opinion on this.

I am closing this bug report.  You may open a wishlist bug about being able to change the default (or make the print dialog remember your previous settings), but I'm pretty such a bug report exists already.
Comment 7 Sune Vuorela 2025-01-24 14:18:25 UTC
(In reply to Oliver Becker from comment #5)
> (In reply to Oliver Sander from comment #4)
> > By default, Okular scales the page slightly to fit onto the printable part
> > of the physical page. If you need the exact size then in the print dialog
> > please choose "pdf options -> scale mode -> original size". That should
> > suppress the scaling (and will in turn cut off everything to close to the
> > margins).
> 
> That worked, thank you!
> 
> Now only two questions remain:
> * Is there a way to set the default to "original size"?
> * Wouldn't a user expect a PDF with margins already at least as wide as the
> printers (e.g. created with a word processor) to be printed as is, without
> it being scaled down unnecessarily (in this case)?

it should be configurable https://invent.kde.org/graphics/okular/-/merge_requests/700 ?