2012-09-16 108 views
2

我安装了爱普生TM-T20在Ubuntu 12.04,使用官方driver。这是一台热敏打印机,我使用80毫米纸。打印与杯PostScript文档和热敏打印机

我的问题:当我打印的图像(使用PostScript文件),它浪费了大量的纸张,因为图像5厘米周围使用和图像,然后打印机发出25厘米的白皮书。

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

lpr -P tm-t20 -o document.ps 

打印机打印图像(将200x200图像),但是首先发出很多非印刷纸。

打印机不被认可的CUPS(使用Web界面位于localhost:631)。然后我安装它使用以下步骤:

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

然后打印机出现在CUPS网络接口和I配置它(波特率,位奇偶校验等)。当我发送一些文字

打印机工作正常。

这里是打印机PPD的一部分:

*DefaultPageRegion:RP80x297 
*PageRegion RP80x297/Roll Paper 80 x 297 mm: "<</PageSize[204 841.8]/   ImagingBBox null>>setpagedevice" 
*PageRegion RP58x297/Roll Paper 58 x 297 mm: "<</PageSize[141.7 841.8]/   ImagingBBox null>>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" 

我想,这种浪费的论文是因为长期的297毫米出现在PPD文件。然后我尝试添加另一个100mm而不是297mm的配置,但问题仍然存在。

我也tryied添加标签%% 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 

任何想法?

回答

1

最后经过很多痛苦。我发现问题是串行到USB电缆(为了将串行打印机连接到USB端口)。我尝试了两种不同的串行USB电缆,但问题依然存在,最后我得出结论:如果打印机未连接到“真实”串行端口,打印机工作不正常。我在具有串行端口的个人电脑中在相同条件下测试了打印机,它的工作原理非常完美,只需安装epson提供的驱动程序并将chmod 777设置为/ dev/ttyS0即可。在工作列表中,有时我看到错误:“/ usr/lib/cups/filter/pstopdf失败”。但打印机打印确定,就像没有发生错误。

0

我有和chmod 777的/ dev/ttyUSB0为了让打印机工作(即使运行使用sudo命令)。

我得到令人满意的结果(文本是不是在中心)与选择媒体= B8

lp -d tm-t20 -o media=B8 document.ps 

我也试图与

lp -d tm-t20 -o media=Custom.80x90mm document.ps 

但打印机不打印和该作业显示为在杯子网页界面上完成。

如果我尝试用

lp -d tm-t20 -o media=Custom.200x190 document.ps 

打印机打印(不正确居中,我想我需要使用不同的值尝试,直到我得到了想要的结果)。点的纸张尺寸是在这个网站:http://paulbourke.net/dataformats/postscript/

打印机不切纸,我不知道如何给出该选项(打印和切纸)。

打印机所接受的选项有:

lpoptions -p tm-t20 -l 

PageSize/Media Size: *RP80x297 RP58x297 Custom.WIDTHxHEIGHT 
Resolution/Resolution: *203x203dpi 
TmtSpeed/Printing Speed: *Auto 1 2 3 4 
TmtPaperReduction/Paper Reduction: Off Top *Bottom Both 
TmtPaperSource/Paper Source: *DocFeedCut DocFeedNoCut DocNoFeedCut DocNoFeedNoCut PageFeedCut PageFeedNoCut PageNoFeedCut 
TmtBuzzerControl/Buzzer: *Off Before After 
TmtSoundPattern/Sound Pattern: *A B C D E 
TmtBuzzerRepeat/Buzzer Repeat: *1 2 3 5 
TmtDrawer1/Cash Drawer #1: *Off Before After 

如何使打印机打印并裁切纸张?我需要从控制台执行,以便从定制的C++程序中使用它。如果你在Linux下有这种打印机的其他经验,请给我一些建议。我的目标是从C++程序使用打印机,我没有找到一个快速的方法来完成它(直接发送ESC/POS命令到打印机,在Linux下没有官方文档),所以我' m从控制台使用CUPS。

剪纸解决:

lp -d tm-t20 -o media=Custom.200x258 -o source=DocFeedCut document.ps 

我不知道为什么它的工作原理,因为在DocFeedCut是默认选项的选项中。

现在我只会尝试正确地居中文本。

+0

打印机停止工作,现在有时打印,有时不打印。我会发布更多细节... – user1370912