GNOME Bugzilla – Bug 792394
Wrong orientation when printing landscape document with both 'Auto Rotate' and 'Select page size using document page size' options selected
Last modified: 2018-03-29 20:21:47 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.
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.
Review of attachment 366587 [details] [review]: Ok, thanks
Attachment 366587 [details] pushed as e7840f9 - print-operation: Fix orientation of auto-rotate option
*** Bug 756671 has been marked as a duplicate of this bug. ***