爱普生TM-T88V格式化 [英] Epson TM-T88V formatting

查看:20
本文介绍了爱普生TM-T88V格式化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一台运行 Ubuntu Server 12.04 的小机器,其中直接插入了 Epson TM-T88V.起初我能够很好地打印(使用 lp),但自动切纸器不工作.我意识到它只是没有使用驱动程序中包含的正确 PPD 文件,所以一旦我将打印机设置为使用该切割开始工作正常.

I set up a little machine running Ubuntu Server 12.04 with an Epson TM-T88V plugged into it directly. At first I was able to print fine (using lp) but the auto-cutter wasn't working. I realized it just wasn't using the correct PPD file that was included with the driver, so once I set the printer to use that cutting started working fine.

但是,一旦我使用正确的 PPD 文件获得了它,文本就会打印得如此浅,几乎难以阅读.当我尝试将 ESC/POS 命令直接传递给它时,它本质上就像我回到了原始情况(深色文本,没有剪切).

However, once I got it using the right PPD file the text is printing so light it's almost hard to read. When I tried to pass ESC/POS commands directly to it it was essentially like I'd gone back to the original situation (dark text, no cut).

这真的是我第一次涉足热敏打印机,如果我遗漏了一些简单的东西,我深表歉意.我会以完全错误的方式解决这个问题吗?任何建议将不胜感激.

This is really my first foray into thermal printers, so my apologies if I'm missing something simple. Am I going about this the completely wrong way? Any advice would be greatly appreciated.

我最初是在 SuperUser 上发布的,但我想由于打印机在物理上正常工作,这显然是我在编程方面犯的一个错误.

I originally posted this on SuperUser, but I suppose since the printer is physically working correctly this is obviously a mistake I'm making on the programming side.

这是我用来打印的命令(它是 Node.js).我不知道是否值得注意,当我编写这个应用程序并让它从我的 MBP 工作时,我使用的是 lpr 不是lp.无论出于何种原因,lpr 不会在服务器上做任何事情.

This is the command I'm using to print (it's Node.js). I don't know if it's worth noting that when I wrote this application and had it working from my MBP I was using the lpr not lp. For whatever reason, lpr doesn't do anything on the server.

var toPrint = "echo '" +
            "Order for: " + req.body.name + "\n" +
            "Email: " + req.body.email + "\n\n" +
            "Food Items Ordered: \n" + foodItems +
            "\n\nThank you for using WhyWait!' | lp";
// Print the order!
var printCmd = exec(toPrint, function (error, stdout, stderr) {
  if (error !== null) {
   console.log('exec error: ' + error);
  }
  console.log('Order printed!\n');
});

这是 PPD 文件.

*PPD-Adobe: "4.3"
*% Copyright (C) Seiko Epson Corporation 2010. All rights reserved.
*%
*% Driver for Epson Thermal Printers Series.

*FormatVersion: "4.3"
*FileVersion: "1.0"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "TM-T88V.PPD"
*Manufacturer: "EPSON"
*Product: "(ThermalPrinter)"
*ModelName:"EPSON TM-T88V"
*ShortNickName:"TM-T88V"
*NickName: "EPSON TM-T88V (rastertotmt)"
*PSVersion: "(3010.000) 0"
*LanguageLevel: "3"
*ColorDevice: False
*DefaultColorSpace: Gray
*FileSystem: False
*Throughput: "1"
*LandscapeOrientation: Plus90
*VariablePaperSize: True
*TTRasterizer: Type42
*cupsVersion: 1.2
*cupsManualCopies: True
*cupsModelNumber: 1
*cupsFilter: "application/vnd.cups-raster 0 rastertotmt"

*OpenGroup: General/General

*%Page size settings.
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 11 AnySetup *PageSize
*DefaultPageSize:RP80x297
*PageSize RP80x297/Roll Paper 80 x 297 mm: "<</PageSize[204 841.8]/ImagingBBox null>>setpagedevice"
*PageSize RP58x297/Roll Paper 58 x 297 mm: "<</PageSize[141.7 841.8]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize

*OpenUI *PageRegion: PickOne
*OrderDependency: 11 AnySetup *PageRegion
*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"

*%Custom page size settings.
*MaxMediaWidth: "204"
*MaxMediaHeight: "5669.2"
*NonUIOrderDependency: 100 AnySetup *CustomPageSize
*CustomPageSize True: "pop pop pop <</PageSize [ 5 -2 roll ]/ImagingBBox null>>setpagedevice"
*ParamCustomPageSize Width: 1 points 72 204
*ParamCustomPageSize Height: 2 points 72 5669.2
*ParamCustomPageSize WidthOffset:  3 points 0 0
*ParamCustomPageSize HeightOffset: 4 points 0 0
*ParamCustomPageSize Orientation:  5 int 0 0

*%Resolution settings.
*OpenUI *Resolution/Resolution: PickOne
*OrderDependency: 10 AnySetup *Resolution
*DefaultResolution: 180x180dpi
*Resolution 180x180dpi/180 x 180 dpi: "<</HWResolution[180 180]/cupsRowCount 24>>setpagedevice"
*CloseUI: *Resolution

*%Head speed settings.
*TmtSpeedValue 1: "13"
*TmtSpeedValue 2: "9"
*TmtSpeedValue 3: "5"
*TmtSpeedValue 4: "1"

*OpenUI *TmtSpeed/Printing Speed: PickOne
*OrderDependency: 10 AnySetup *TmtSpeed
*DefaultTmtSpeed: Auto
*TmtSpeed Auto/Use the printer settings : ""
*TmtSpeed 1/1st (Fast): ""
*TmtSpeed 2/2nd: ""
*TmtSpeed 3/3rd: ""
*TmtSpeed 4/4th (Slow): ""
*CloseUI: *TmtSpeed

*%Exit feed direction settings.
*TmtReverseFeedDirection: False

*%Paper reduction settings.
*OpenUI *TmtPaperReduction/Paper Reduction: PickOne
*OrderDependency: 11 AnySetup *TmtPaperReduction
*DefaultTmtPaperReduction: Bottom
*TmtPaperReduction Off/None: ""
*TmtPaperReduction Top/Top margin: ""
*TmtPaperReduction Bottom/Bottom margin: ""
*TmtPaperReduction Both/Top & Bottom margins: ""
*CloseUI: *TmtPaperReduction

*%Paper source settings.
*OpenUI *TmtPaperSource/Paper Source: PickOne
*OrderDependency: 11 AnySetup *TmtPaperSource
*DefaultTmtPaperSource: DocFeedCut
*TmtPaperSource DocFeedCut/Document [Feed, Cut]: ""
*TmtPaperSource DocFeedNoCut/Document [Feed, NoCut]: ""
*TmtPaperSource DocNoFeedCut/Document [NoFeed, Cut]: ""
*TmtPaperSource DocNoFeedNoCut/Document [NoFeed, NoCut]: ""
*TmtPaperSource PageFeedCut/Page [Feed, Cut]: ""
*TmtPaperSource PageFeedNoCut/Page [Feed, NoCut]: ""
*TmtPaperSource PageNoFeedCut/Page [NoFeed, Cut]: ""
*CloseUI: *TmtPaperSource

*CloseGroup: General

*OpenGroup: Buzzer Control/Buzzer Control

*%Buzzer settings.
*OpenUI *TmtBuzzerControl/Buzzer: PickOne
*OrderDependency: 11 AnySetup *TmtBuzzerControl
*DefaultTmtBuzzerControl: Off
*TmtBuzzerControl Off/Not used: ""
*TmtBuzzerControl Before/Sounds before printing: ""
*TmtBuzzerControl After/Sounds after printing: ""
*CloseUI: *TmtBuzzerControl

*%Sound pattern settings.
*OpenUI *TmtSoundPattern/Sound Pattern: PickOne
*OrderDependency: 11 AnySetup *TmtSoundPattern
*DefaultTmtSoundPattern: Internal
*TmtSoundPattern Internal/Internal buzzer: ""
*TmtSoundPattern A/Option buzzer (Pattern A): ""
*TmtSoundPattern B/Option buzzer (Pattern B): ""
*TmtSoundPattern C/Option buzzer (Pattern C): ""
*TmtSoundPattern D/Option buzzer (Pattern D): ""
*TmtSoundPattern E/Option buzzer (Pattern E): ""
*CloseUI: *TmtSoundPattern

*%Buzzer repeat settings.
*OpenUI *TmtBuzzerRepeat/Buzzer Repeat: PickOne
*OrderDependency: 11 AnySetup *TmtBuzzerRepeat
*DefaultTmtBuzzerRepeat: 1
*TmtBuzzerRepeat 1/1: ""
*TmtBuzzerRepeat 2/2: ""
*TmtBuzzerRepeat 3/3: ""
*TmtBuzzerRepeat 5/5: ""
*CloseUI: *TmtBuzzerRepeat

*CloseGroup: Buzzer Control

*OpenGroup: Cash Drawer Control/Cash Drawer Control

*%Drawer settings.
*OpenUI *TmtDrawer1/Cash Drawer #1: PickOne
*OrderDependency: 11 AnySetup *TmtDrawer1
*DefaultTmtDrawer1: Off
*TmtDrawer1 Off/Does not open: ""
*TmtDrawer1 Before/Open before printing: ""
*TmtDrawer1 After/Open after printing: ""
*CloseUI: *TmtDrawer1

*OpenUI *TmtDrawer2/Cash Drawer #2: PickOne
*OrderDependency: 11 AnySetup *TmtDrawer2
*DefaultTmtDrawer2: Off
*TmtDrawer2 Off/Does not open: ""
*TmtDrawer2 Before/Open before printing: ""
*TmtDrawer2 After/Open after printing: ""
*CloseUI: *TmtDrawer2

*CloseGroup: Cash Drawer Control

*%Drawer pulse settings.
*TmtDrawer1Pulse On: 10
*TmtDrawer1Pulse Off: 100
*TmtDrawer2Pulse On: 10
*TmtDrawer2Pulse Off: 100

*%Pitch of feed settings.
*TmtFeedPitch: 360

*%Used command set version.
*TmtCommandSetVersion OutputRaster: 2

*%Line number of band.
*TmtBandLines: 256

*%Message defines.
*TmtMessage ParameterError: "Invalid parameter."

*% End

推荐答案

大多数热敏打印机有两种打印方法:

There are two methods of printing to most thermal printers:

  1. 普通 (2D) - 例如从 Libre Office 打印
  2. Raw(通用文本/原始 PCL 命令)- 例如直接从控制台打印原始文件.
  1. Normal (2D) - Such as printing from Libre Office
  2. Raw (Generic Text/Raw PCL Commands) - Such as printing a raw file directly from the console.

您提到的打印机,TM88是用于打印收据的流行热敏打印机;它可以两者兼而有之;它具有原始功能,但使用正确的软件可以从其他应用程序打印.TM88 使用的原始语言是ESCP2 或更常见的ESC/POS.Epson 的所有 TM 系列打印机都支持 ESC/POS.

The printer you mention, the TM88 is popular thermal printer used for printing receipts; it can do both; it's raw capable but with the right software can print from other applications. The raw language the TM88 uses is ESCP2 or more commonly ESC/POS. All TM-series printers from Epson are ESC/POS capable.

您遇到的问题是您试图向需要一些 2D 内容的驱动程序发送原始命令.有几种方法可以实现这一点.

  1. 将两台打印机(一台映射到 2D 驱动程序,一台映射到通用/文本驱动程序 -- 这在 CUPS 中称为原始、通用")打印到一台,然后再打印到另一台.
  2. 了解您正在执行的操作的原始命令.这种情况下,一般是:Hex:0x1B 0x69(剪纸)
  3. 保持驱动程序已安装,但无论如何通过使用 lpr -o raw 和文件系统中的平面文件直接向处于原始模式的 cups 发出命令来强制原始.
  1. Map two printers (one to the 2D driver, one to a Generic/Text driver -- This is called "Raw, Generic" in CUPS) print to one, then the other.
  2. Learn the raw commands for the action you're preforming. In this case, it's generally: Hex: 0x1B 0x69 (cut paper)
  3. Keep the driver installed, but force raw anyway by issuing the command directly to cups in raw mode using lpr -o raw with a flat file from the file system.

奖励:需要踢出现金抽屉吗?0x10 0x14 0x01 0x00 0x05(脉冲/现金抽屉).警告,请对照您的 ESCP 编程指南交叉引用所有原始命令.

Bonus: Need to kick out a cash drawer? 0x10 0x14 0x01 0x00 0x05 (pulse/cash drawer). Warning, please cross reference all raw commands against your ESCP programming guide.

这篇关于爱普生TM-T88V格式化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆