简体   繁体   中英

How to convert a bitmap to bytes using the Epson JavaPOS ADK

i want to print receipts as bitmaps on Epson POS printers. The printers are not directly attached though. The receipt rendering is done on the backend webservice, and the generated bytes will be sent to the frontend, where the printer is actually attached.

So i took a look into the Epson JavaPOS ADK, but i found only code to call directly attached printers, but no utility classes or so.

So my question is: Does anyone know a way to use the Epson JavaPOS ADK to "print" to bytes instead to a printer?

Thx!

The following means are conceivable.

  1. Store in BMP file and print.

    • 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.

  2. Print data as it is in memory. (When EPSON JavaPOS and printer supports it)

    • 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.

  3. (When the front end is a Windows machine) Print on a Windows standard printer.

    • 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.

Of course, it is necessary to convert the Bitmap data notified from the Web service into BMP file or Windows print data, but it can be done by using API of your OS or Java library function.


Postscript added based on comment.

In that case, you may be using the ePOS SDK instead of the JavaPOS ADK.
However, at least some software development is necessary.

There are four types below, so please try it according to your frontend environment.

Epson ePOS SDK for Universal Windows apps
Epson ePOS SDK for Android
Epson ePOS SDK for iOS
Epson ePOS SDK for JavaScript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM