首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何使用Epson JavaPOS ADK将位图转换为字节

如何使用Epson JavaPOS ADK将位图转换为字节
EN

Stack Overflow用户
提问于 2018-08-10 21:54:59
回答 1查看 722关注 0票数 0

我想在爱普生POS打印机上打印位图形式的收据。不过,打印机不是直接连接的。回执渲染是在后端sent服务上完成的,生成的字节将发送到前端,即实际连接打印机的前端。

所以我研究了一下Epson JavaPOS ADK,但我发现只有调用直接连接的打印机的代码,但没有实用程序类之类的东西。

所以我的问题是:有没有人知道用Epson JavaPOS ADK“打印”到字节而不是打印机的方法?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2018-08-11 01:31:01

下面的方法是可以想象的。

  1. 存储在BMP文件中并打印。

代码语言:javascript
复制
- Store the Bitmap data notified from the Web service as a BMP file in the frontend file system (not the session local storage of the browser).
- Print the BMP file using the `printBitmap` method of the POSPrinter device.
- Delete the BMP file when printing is completed normally. 

  1. 按数据在内存中的形式打印数据。(当爱普生JavaPOS和打印机支持时)

代码语言:javascript
复制
- Convert the Bitmap data notified from the Web service into the BMP file image on the memory.
- Print the BMP file image using the `printMemoryBitmap` method of the POSPrinter device.
- When the printing is completed normally, release the memory of the BMP file image. 

  1. (如果前端是Windows机)在Windows标准打印机上打印。

代码语言:javascript
复制
- Handle printers as Windows standard printers rather than handling them in JavaPOS.
- Switch the printer mode setting and device driver to those of Windows standard printer.
- Convert Bitmap data like page printing using the Windows standard printing API and print it.

当然,将Web服务通知的位图数据转换为BMP文件或Windows打印数据是必要的,但可以通过使用操作系统的API或Java库函数来完成。

基于注释添加的Postscript。

在这种情况下,您可能正在使用ePOS开发工具包而不是JavaPOS开发工具包。

然而,至少有一些软件开发是必要的。

下面有四种类型,请根据您的前端环境进行尝试。

Epson ePOS SDK for Universal Windows apps

Epson ePOS SDK for Android

Epson ePOS SDK for iOS

Epson ePOS SDK for JavaScript

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51788103

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档