在我的 Ubuntu 16.04 LTS 系统上,我有一台 Citizen CL-S621Z 标签打印机,带有 50x80mm 标签(纵向)和我希望打印的 50x80mm PDF:
问题是,CUPS 将工作旋转了 270° 度,因此它从侧面出来:
输入的 PDF 文件本身没有页面旋转,如下所示pdfinfo:
admin@bukittinggi ~> pdfinfo label.pdf
Creator: cairo 1.13.1 (http://cairographics.org)
Producer: cairo 1.13.1 (http://cairographics.org)
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 1
Encrypted: no
Page size: 141.732 x 226.772 pts
Page rot: 0
File size: 32443 bytes
Optimized: no
PDF version: 1.5
Run Code Online (Sandbox Code Playgroud)
我的打印命令行是:
lpr label.pdf
Run Code Online (Sandbox Code Playgroud)
我已经尝试了一些选项,以防止自动页面旋转,包括-o 'nopdfAutoRotate',-o portrait,-o landscape和-o orientation-requested=N(为值N7介于0),以及这些都不似乎有任何效果。
作业似乎通过pdftopdf,然后pdftops在 CUPS 过滤器图中,据我所知,当作业碰到后一个过滤器时发生旋转,之后页面旋转设置为 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
Run Code Online (Sandbox Code Playgroud)
/usr/lib/cups/filter/pdftops来自cups-filters-core-drivers版本1.8.3-2ubuntu3。奇怪的是,该问题不会出现在 Raspbian 上,它的cups-filters-core-drivers版本为1.0.61-5+deb8u3.
更新:通过仔细编辑 PPD 文件以完全匹配标签尺寸,我能够获得所需的方向:
*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"
Run Code Online (Sandbox Code Playgroud)
感谢 CUPS 团队的 Michael。
小智 7
我们在使用 Zebra 的 PPD 文件的 Zebra Z4MPLUS 打印机上遇到了同样的问题。PPD 文件有 8.00x4.00" 作为标签尺寸,但这对我们不起作用。使用自定义 4x8in 也不起作用。我们必须在 PPD 文件中创建一个 4.00x8.00" 标签尺寸,然后在杯子。我们通过在 PPD 中编辑一个 4.00x13.00" 的标签尺寸来做到这一点,我们知道我们不需要。这是一个diff original.ppd edited.ppd
40c40
< *DefaultPageSize: Custom.4x8in
---
> *DefaultPageSize: w288h576
80c80
< *PageSize w288h936/4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice"
---
> *PageSize w288h576/4.00x8.00": "<</PageSize[288 576]/ImagingBBox null>>setpagedevice"
98c98
< *DefaultPageRegion: Custom.4x8in
---
> *DefaultPageRegion: w288h576
138c138
< *PageRegion w288h936/4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice"
---
> *PageRegion w288h576/4.00x8.00": "<</PageSize[288 576]/ImagingBBox null>>setpagedevice"
154c154
< *DefaultImageableArea: Custom.4x8in
---
> *DefaultImageableArea: w288h576
194c194
< *ImageableArea w288h936/4.00x13.00": "0.00 0.00 288.00 936.00"
---
> *ImageableArea w288h576/4.00x8.00": "0.00 0.00 288.00 576.00"
209c209
< *DefaultPaperDimension: Custom.4x8in
---
> *DefaultPaperDimension: w288h576
249c249
< *PaperDimension w288h936/4.00x13.00": "288.00 936.00"
---
> *PaperDimension w288h576/4.00x8.00": "288.00 576.00"
Run Code Online (Sandbox Code Playgroud)