After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792394 - Wrong orientation when printing landscape document with both 'Auto Rotate' and 'Select page size using document page size' options selected
Wrong orientation when printing landscape document with both 'Auto Rotate' an...
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: printing
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 756671 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-01-10 04:09 UTC by Jason Crain
Modified: 2018-03-29 20:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
blue2.pdf - PDF in landscape orientation (173.51 KB, application/pdf)
2018-01-10 04:09 UTC, Jason Crain
  Details
print-operation: Fix orientation of auto-rotate option (1.80 KB, patch)
2018-01-10 04:16 UTC, Jason Crain
committed Details | Review

Description Jason Crain 2018-01-10 04:09:21 UTC
Created attachment 366586 [details]
blue2.pdf - PDF in landscape orientation

Forwarding from https://bugs.debian.org/856729

If you print a landscape document with evince, such as the attached PDF from the above bug report, and have both the "Auto Rotate and Center" and "Select page size using document page size" options selected in the "Page Handling" page of the Print dialog, evince will print the document with the wrong orientation.

Image in the Debian bug report, https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=856729;filename=landscape-failed.jpg;msg=5, shows what the printed document looks like when both these options are selected.

The issue is in libview/ev-print-operation.c in the ev_print_operation_print_request_page_setup function.  When "Select page size" is enabled it will create a custom paper size the same size as the page.  Then if "Auto Rotate" is enabled and the page is wider than tall it will set it to landscape orientation, rotating the page, which is wrong since the paper was already the same size as the page.  The same thing will happen if you create a custom paper size in the print dialog which is wider than it is tall and select the "Auto Rotate" option.
Comment 1 Jason Crain 2018-01-10 04:16:19 UTC
Created attachment 366587 [details] [review]
print-operation: Fix orientation of auto-rotate option

When printing a landscape document, if both the "Auto Rotate and Center"
and "Select page size using document page size" options are enabled,
evince will choose the wrong orientation.  This will also occur with any
document if you use a custom paper size which is wider than it is tall
and enable the auto rotate option, but do not enable the "Select page
size" option.

Fix this by having the auto rotate option pick landscape orientation if
and only if the document's orientation does not match the paper's
unrotated orientation.
Comment 2 Carlos Garcia Campos 2018-01-20 06:46:21 UTC
Review of attachment 366587 [details] [review]:

Ok, thanks
Comment 3 Jason Crain 2018-01-21 17:45:28 UTC
Attachment 366587 [details] pushed as e7840f9 - print-operation: Fix orientation of auto-rotate option
Comment 4 Jason Crain 2018-03-29 20:21:47 UTC
*** Bug 756671 has been marked as a duplicate of this bug. ***