标签: thermal-printer

"PrinterException:Paper的可成像宽度太小"我可以看到什么是错的,但我该如何解决?

当我尝试在我当前的大学项目中为特定标签打印机打印时,我收到此错误:

java.awt.print.PrinterException: Paper's imageable width is too small.
    at sun.print.RasterPrinterJob.printPage(Unknown Source)
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at Printer.print(Printer.java:91)
    at Printer.<init>(Printer.java:43)
    at VisitorDBTest.main(VisitorDBTest.java:10)
Run Code Online (Sandbox Code Playgroud)

但我看不出原因.我有这个特定打印机的确切标签代码,标签宽度和高度是正确的.我将可成像尺寸设置为精确的标签尺寸(以1/72英寸为单位),然后我尝试将其设置得更小而没有运气.当我在A4页面上打印到普通喷墨打印机时,此代码工作正常.当我尝试打印到DYMO 450标签打印机(使用不同的Paper和PageFormat对象)时,我只收到错误.看看谷歌搜索结果,看来我几乎是历史上唯一一个得到这个错误的人.

编辑:在将可成像宽度打印到屏幕后,我得到以下结果:

Paper imageable width is 196.0
PageFormat imageable width is 151.0
PrinterJob imageable width is -65.0267716535433
Run Code Online (Sandbox Code Playgroud)

我的理解是,PageFormat都从Paper中获取了可成像的宽度,而PrinterJob从PageFormat中获取了可成像的宽度.我显然在这里遗漏了一些东西.

java printing thermal-printer

0
推荐指数
1
解决办法
4787
查看次数

java中热敏打印机的命令

我有一套用于我的热敏打印机的命令:这是一个例子

ASCII ESC a n
Decimal 27 97 n
Hexadecimal 1B 61 n

Description Default is 0
0 ? m ? 2 or 48 ? m ? 50
Align left: n=0,48
Align middle: n=1,49
Align right: n=2,50 
Run Code Online (Sandbox Code Playgroud)

我想知道如何使用这个命令?? 我知道我需要像这样写入打印机命令:

   byte [] cmd = new byte[3];
   cmd[0]=??
   cmd[1]???
    mmOutputStream.write(cmd);//out put stream of soccket connected to
    //printer by bluetooth
Run Code Online (Sandbox Code Playgroud)

有关更多说明:我想向我的打印机添加命令以使文本显示在中心

java printing android thermal-printer

0
推荐指数
1
解决办法
3998
查看次数

如何将Thermal Bluetooth Printer连接到iOS设备

我有这款Thermal Bluetooth Printer Impress +。我正在制作应打印账单的自定义应用程序。我已经编写了将其连接到iPhone的代码,但是它从未出现在搜索中。它从未达到didDiscoverPeripheral。我不知道怎么了 以下是我用于搜索蓝牙设备的代码。请帮忙。任何帮助将不胜感激。

import UIKit
import CoreBluetooth

class ViewController: UIViewController, CBCentralManagerDelegate, CBPeripheralDelegate {
    var centralManager: CBCentralManager!
    var peripheral: CBPeripheral!
    var writeCharacteristic: CBCharacteristic!
    var service: CBService!
    var characteristic: CBCharacteristic!

    var bluetoothAvailable = false
    let message = "1"

    @IBOutlet weak var labelDeviceName: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()

        centralManager = CBCentralManager(delegate: self, queue: nil)
    }

    func centralManagerDidUpdateState(_ central: CBCentralManager)
    {
        print("Checking state")
        switch (central.state)
        {
        case .poweredOff:
            print("CoreBluetooth BLE hardware is powered off")

        case .poweredOn:
            print("CoreBluetooth BLE hardware …
Run Code Online (Sandbox Code Playgroud)

printing bluetooth thermal-printer swift

0
推荐指数
1
解决办法
2816
查看次数

如何在 CommonJS 项目中包含 Epson SDK for JavaScript

我有一个 WebPack 项目,其中使用 CommonJS 结构导入模块。

现在我需要导入ePOS_SDK_JavaScript_v2.7.0库(文件“epos-2.7.0.js”)。
但它不是有效的 CommonJS 模块。

如何在我的项目中导入库?

谢谢

javascript thermal-printer epson commonjs webpack

0
推荐指数
1
解决办法
459
查看次数

打开/关闭抽屉的C#代码并同时打印收据?

有没有人知道如何创建一个C#应用程序,可以打开连接到计算机的抽屉并同时打印收据?

抽屉名称:PCD-354电子现金抽屉

现金收据打印机:Epson TM-T88v

c# list thermal-printer crystal-reports slidingdrawer

-3
推荐指数
1
解决办法
1万
查看次数