Bug 332443 - When printing, margins are not respected unless "properties" dialog is opened and accepted
Summary: When printing, margins are not respected unless "properties" dialog is opened...
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: 0.18.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-22 13:54 UTC by pres1234
Modified: 2018-01-17 13:58 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pres1234 2014-03-22 13:54:19 UTC
This explains the inconsistent results I kept getting in #332331.

If print is pressed within the print dialog, without opening the printer "properties" dialog and accepting it, the margins default to 10pt on each side instead of respecting the printer's default margins.

If print is pressed first, here is what's sent to CUPS:
page-bottom=10 page-left=10 page-right=10 page-top=10

However if the properties dialog is opened and accepted, here is what is sent (the defaults for my printer):
page-bottom=36 page-left=18 page-right=18 page-top=9

The offending function seems to be QPrinter::getPageMargins() on line 654 in core/fileprinter.cpp. That's a Qt function, so this could be a Qt bug, but I'm not sure if there's a way to work around it in Okular.


Reproducible: Always

Steps to Reproduce:
1. Print document without opening "Properties"
2. Observe 10pt margins sent to printer.
3. Print again after opening and accepting "Properties"
4. Observe printer default margins sent to printer.
Actual Results:  
10pt margins sent unless Properties dialog is accepted.

Expected Results:  
Default printer margins are sent without having to open and accept Properties dialog.
Comment 1 Albert Astals Cid 2014-05-10 18:49:00 UTC
Yes, it's a Qt bug and i don't think there's a way to workaround it sadly, when i get some time i'll try having a look.

Thanks for caring about Okular :)
Comment 2 Richard Llom 2014-05-10 20:29:36 UTC
(In reply to comment #1)
> Yes, it's a Qt bug and i don't think there's a way to workaround it sadly,
> 
Indeed, see:
https://bugreports.qt-project.org/browse/QTBUG-15351
and bug 198172
(ie this one is a dup)
Comment 3 Michael Weghorn 2018-01-17 13:58:20 UTC
I just had a short look and could not reproduce the issue.

@pres1234:
Does the problem still occur for you?
If so, what Okular and Qt versions are you using?