java用打印机打印小票_使用CUPS和热敏打印机打印postscript文档

在Ubuntu 12.04上,作者使用Epson TM-T20热敏打印机遇到问题,打印图像时会先输出大量空白纸张。打印机通过serial:/dev/ttyUSB0连接,并通过lpadmin命令配置。尽管尝试修改PPD文件和添加%%DocumentMedia标签以减少浪费,但问题依然存在。寻求解决方案。
摘要由CSDN通过智能技术生成

我使用官方的driver在Ubuntu 12.04中安装了epson TM-T20 . 这是一台热敏打印机,我使用的是80mm纸 .

我的问题:当我打印图像(使用附言文档)时,它会浪费大量纸张,因为图像使用大约5厘米,而图像前的打印机会发出25厘米的白纸 .

我使用以下命令将文档发送到打印机:

lpr -P tm-t20 -o document.ps

打印机打印图像(200x200图像),但首先发出大量未打印的纸张 .

CUPS无法识别打印机(使用localhost:631上的Web界面) . 然后我使用以下过程安装它:

sudo lpadmin -p tm-t20 -E -v serial:/dev/ttyUSB0 -P /usr/share/ppd/epson-tm-t20-rastertotmt.ppd

然后打印机出现在CUPS Web界面中,我对其进行了配置(波特率,位奇偶校验等) .

发送一些文本时打印机工作正常 .

这是打印机ppd的一部分:

*DefaultPageRegion:RP80x297

*PageRegion RP80x297/Roll Paper 80 x 297 mm: "<>setpagedevice"

*PageRegion RP58x297/Roll Paper 58 x 297 mm: "<>setpagedevice"

*CloseUI: *PageRegion

*DefaultImageableArea: RP80x297

*ImageableArea RP80x297/Roll Paper 80 x 297 mm: "0 0 204 841.8"

*ImageableArea RP58x297/Roll Paper 58 x 297 mm: "0 0 141.7 841.8"

*DefaultPaperDimension: RP80x297

*PaperDimension RP80x297/Roll Paper 80 x 297 mm: "204 841.8"

*PaperDimension RP58x297/Roll Paper 58 x 297 mm: "141.7 841.8"

我认为这种纸张的浪费是因为ppd文件中出现的长297mm . 然后我尝试添加另一个100毫米而不是297毫米的配置,但问题仍然存在 .

我也尝试将标签%% DocumentMedia添加到ps文件中,但同样的问题:

%!PS-Adobe-3.0

%%Creator: GIMP PostScript file plugin V 1.17 by Peter Kirchgessner

%%Title: yay.ps

%%CreationDate: Thu Sep 13 13:44:26 2012

%%DocumentData: Clean7Bit

%%LanguageLevel: 2

%%Pages: 1

%%BoundingBox: 14 14 215 215

%%

%%EndComments

%%DocumentMedia: Plain 72 72 0 white Plain

%%BeginProlog

% Use own dictionary to avoid conflicts

10 dict begin

%%EndProlog

%%Page: 1 1

% Translate for offset

14.173228346456694 14.173228346456694 translate

% Translate to begin of first scanline

0 199.99999999999997 translate

199.99999999999997 -199.99999999999997 scale

% Image geometry

200 200 8

% Transformation matrix

[ 200 0 0 200 0 0 ]

% Strings to hold RGB-samples per scanline

/rstr 200 string def

/gstr 200 string def

/bstr 200 string def

{currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop}

{currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop}

{currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop}

true 3

%%BeginData: 14759 ASCII Bytes

任何的想法?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值