2

私は、EpsonTM-T88Vを直接接続したUbuntuServer12.04を実行する小さなマシンをセットアップしました。最初は(lpを使用して)きれいに印刷できましたが、自動カッターが機能していませんでした。ドライバに含まれている正しいPPDファイルを使用していないことに気付いたので、プリンタを使用するように設定すると、その切断は正常に機能し始めました。

ただし、適切なPPDファイルを使用して取得すると、テキストが印刷されるため、非常に軽く、ほとんど読みにくくなります。ESC / POSコマンドを直接渡そうとしたとき、それは本質的に元の状況に戻ったようなものでした(暗いテキスト、カットなし)。

これは本当にサーマルプリンターへの私の最初の進出です、それで私が何か簡単なものを逃したならば私の謝罪。私はこれを完全に間違った方法で行っていますか?アドバイスをいただければ幸いです。

私はもともとスーパーユーザーにこれを投稿しましたが、プリンターが物理的に正しく動作しているので、これは明らかにプログラミング側で犯している間違いだと思います。

これは私が印刷に使用しているコマンドです(Node.jsです)。このアプリケーションを作成し、MBPから動作させたときに、notを使用していたことに注意する価値があるかどうかはわかりlprません lp。何らかの理由で、サーバー上では何もlprしません。

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
4

1 に答える 1

4

ほとんどのサーマルプリンターに印刷するには、次の2つの方法があります。

  1. 通常(2D)-LibreOfficeからの印刷など
  2. Raw(汎用テキスト/ RawPCLコマンド)-コンソールから直接rawファイルを印刷するなど。

あなたが言及するプリンター、TM88はレシートの印刷に使用される人気のあるサーマルプリンターです。両方を行うことができます。生の機能がありますが、適切なソフトウェアを使用すると、他のアプリケーションから印刷できます。TM88が使用する生の言語は、ESCP2またはより一般的にESC/POSです。エプソンのすべてのTMシリーズプリンタにESC/POS対応しています。

あなたが遭遇している問題は、いくつかの2Dコンテンツを期待するドライバーに生のコマンドを送信しようとしていることです。これを実現する方法はいくつかあります。

  1. 2台のプリンター(1台は2Dドライバーに、1台はGeneric / Textドライバーに-これはCUPSでは「Raw、Generic」と呼ばれます)を一方にマップし、次にもう一方に印刷します。
  2. 実行しているアクションの生のコマンドを学びます。この場合、一般的には次のようになります。16進数:(0x1B 0x69カット紙)
  3. lpr -o rawドライバーをインストールしたままにしますが、ファイルシステムのフラットファイルを使用してrawモードでカップに直接コマンドを発行することにより、とにかくrawを強制します。

ボーナス:キャッシュドロワーを蹴り出す必要がありますか?0x10 0x14 0x01 0x00 0x05(パルス/キャッシュドロワー)。警告、すべての生のコマンドをESCPプログラミングガイドと相互参照してください。

于 2016-08-16T01:59:35.297 に答える