Closed waplet closed 2 years ago
Your PPD file is badly broken:
$ cupstestppd STOCK.ppd
../STOCK.ppd: FAIL
**FAIL** DefaultPageSize Custom.4x8in does not exist.
**FAIL** DefaultPageRegion Custom.4x8in does not exist.
**FAIL** REQUIRED ImageableArea for PageSize w288h576
REF: Page 41, section 5.
REF: Page 102, section 5.15.
**FAIL** REQUIRED PaperDimension for PageSize w288h576
REF: Page 41, section 5.
REF: Page 103, section 5.15.
**FAIL** Size "w288h576" has unexpected dimensions (0x0).
**FAIL** Size "w288h576" defined for PageSize but not for PageRegion.
[...]
$
As the errors are on the page size you are actually using it is very probable that Ghostscript got confused.
If you got the PPD file in this state from the printer manufacturer, please report a bug.
If you added page sizes by yourself, make sure that all lines for each added page size are correct and that cupstestppd
does not report any FAIL.
If you use Custom.4x8in
as page size you do not need to edit the manufacturers PPD file at all. It is in the nature of custom page sizes that they do not need to be explicitly listed in the PPD file.
Oh, yeah, seems that i was testing, if adding custom page sizes gives any better luck. But it turned out that it did not matter, the ghostscript always did landscape rotation.
Basically this is the one - https://opensource.apple.com/source/cups/cups-136/cups/ppd/zebra.ppd
I have found the bug now and fixed it, in Ghostscript's CUPS/PWG/Apple Raster output device. The fix will be included in the next Ghostscript release. I will also apply the patch to the Ghostscript package in Ubuntu, so it will be also included in the upcoming 22.10.
The problem was that the custom page size you have requested got matched against the PPD's page sizes and your PPD contains an 8x4in size and no 4x8in size. So your requested custom size got matched against the 8x4in size and so your page rotated. Now I have chabged the Ghostscript code to not try to match custom page sizes against the PPD's sizes.
Would this mean, that adding w288h576
correctly in PPD would have worked? Of course having a correct PPD.
Yes, it had worked if the entry had been complete and correct (consisting of a line for each PageSize, PageRegion, PaperDimension, and ImageableArea). With this (please check with cupstestppd
) your requested size had been matched against the PPD successfully, already in the first attempt to use the given orientation and not in the 2nd run to try rotated by 90 degrees, and you had gotten the correct result. This way you can overcome the time until a fixed version of Ghostscript gets available to you.
With the Ghostscript fix the page size entries in the PPD do not matter any more as the custom size is not matched against them any more.
Okay, managed to update "base" driver in /usr/share/cups/drv/sample.drv , which generates the PPDs for added printers, just added 2 lines.
#media "w288h576/4.00x8.00\"" 288 576
and under ZPL Label driver
MediaSize w288h576
And this seem to work with current GS version.
Really appreciate your knowledge and your help!
Printfile: cf2.pdf
4x8 label on regular Zebra printer PPD STOCK.ppd.zip
Trying to print 4x8" label on similar Zebra but with a 4x8 paper loaded.
Ghostscript randomly decides to always rotate such dimensions in a landscape? Why?
cf2.apple.zip
And it's not possible to override, if i add additional
landscape
attribute, then it is just flipped by 180 degrees.I have a feeling that this might not be related to cupsfilter, but the ghostscript cups driver itself?!