Created attachment 359088 [details] Proposed patch Description of problem: pstops will not place the page labels at the proper position when printing in landscape. Version-Release number of selected component (if applicable): cups-libs-1.3.7-11 How reproducible: 100% reproducible Steps to Reproduce: 1. Create a Postscript printer queue 2. Print a text document with a page-label in landscape lpr -o "page-label=Hello landscape" /etc/passwd Actual results: The page label is not seen on the page Expected results: The page label is shown on the page in landscape mode Additional info: The page-label gets printed differently depending on the orientation of the document, but only for multiple sheet per page, and only for some values: In do_setup() from filter/pstops.c the page-label is rotated only for 2 and 6 pages on each sheet: 2015 2016 if (doc->number_up == 2 || doc->number_up == 6) 2017 { 2018 /* 2019 * For 2- and 6-up output, rotate the labels to match the orientation 2020 * of the pages... 2021 */ 2022 2023 if (Orientation & 1) 2024 write_label_prolog(doc, doc->page_label, PageBottom, 2025 PageWidth - PageLength + PageTop, PageLength); 2026 else 2027 write_label_prolog(doc, doc->page_label, PageLeft, PageRight, 2028 PageLength); 2029 } 2030 else 2031 write_label_prolog(doc, doc->page_label, PageBottom, PageTop, PageWidth); 2032 } 2033 When using landscape, the orientation is set initially to "1" (0 for portrait) in SetCommonOptions() from filter/common.c but that value is later overridden in copy_comments() from filter/pstops.c: [...] 725 else if (!strncmp(line, "%cupsRotation:", 14)) 726 { 727 /* 728 * Reset orientation of document? 729 */ 730 731 int orient = (atoi(line + 14) / 90) & 3; 732 733 if (orient != Orientation) 734 { 735 /* 736 * Yes, update things so that the pages come out right... 737 */ 738 739 Orientation = (4 - Orientation + orient) & 3; 740 UpdatePageVars(); 741 Orientation = orient; 742 } 743 } [...] By using the initial value passed for orientation to position the label, it shows on the page. The attached patch does two things: 1. Save the original orientation to use it when positioning the label 2. Use that orientation to palce the label accordingly This patch would need more intensive testing and review :)
I haven't been able to reproduce this. Please attach the PPD used in your testing.
Created attachment 359540 [details] ppd file The issue has been reported on a HP LaserJet 9000, and reproduced by our partner also on a HP Laserjet 4250dtn. Attaching the ppd file for the 4250dtn
Created attachment 359541 [details] Another ppd file This ppd file is also used according to the /etc/cups/printers.conf
Created attachment 359561 [details] landscape.pdf OK, problem reproduced. Here is the real test procedure: 1. Print a landscape PDF like so: lp -opage-label=label landscape.pdf The output is incorrect and appears as follows: +----------------+ |Landscape | | | | _______ | | |label| | +----------------+ Correct output would contain two labels, one at each side of the page, in the middle of the side. Examples, with '*' representing the label: +----------------+ | **** | | | | | | **** | +----------------+ +----------------+ | | |* *| |* *| | | +----------------+ This error occurs for PostScript and raster-type printers.
Created attachment 360470 [details] New proposed patch Same logic as previously, this patch seems to produce the expected behavior, ie the labels are places correctly in landscape too. Both landscape and portrait seem to work.
My comment #6 is for a different problem then (PS/PDF input already in landscape orientation). Thanks for the patch; submitted upstream.
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.