On my Ubuntu 16.04 LTS system, I have a Citizen CL-S621Z label printer, with 50x80mm labels (portrait), and a 50x80mm PDF that I wish to print:
Trouble is, CUPS turns the job 270° degrees, so that it comes out sideways:
The input PDF file has no page rotation itself, as revealed by
My print command line is:
I've attempted a number of options to prevent automatic page rotation, including
-o landscape and
-o orientation-requested=N (for values of
N between 0 and 7), and none of these seem to have any effect.
The job seems to pass through
pdftopdf and then
pdftops in the CUPS filter graph, and as far as I can tell, the rotation occurs when the job hits the latter filter, after which the page rotation is set to 270°:
~> /usr/sbin/cupsfilter -P test.ppd -m application/vnd.cups-postscript label.pdf > filtered.ps ~> ps2pdf filtered.ps ~> pdfinfo filtered.pdf [...] Page size: 142 x 227 pts Page rot: 270
/usr/lib/cups/filter/pdftops is from
1.8.3-2ubuntu3. Oddly, the problem does not occur on Raspbian, which has
Update: I was able to get the desired orientation by carefully editing the PPD file to exactly match the label dimensions:
*DefaultPageSize: w142h227 *PageSize w142h227/1.97x3.15": "<</PageSize[142 227]/ImagingBBox null>>setpagedevice" *PageRegion w142h227/1.97x3.15": "<</PageSize[142 227]/ImagingBBox null>>setpagedevice" *ImageableArea w142h227/1.97x3.15": "0 0 142 227" *PaperDimension w142h227/1.97x3.15": "142 227"
Thanks to Michael from the CUPS team.