Hi guys,
I am trying to print an image on a printer that supports ESC/POS protocol. To do this, I need to send in the bytes to the printer using ESC/POS protocol. I am following this guide here :
What I tried so far is to read the image file like this below.
Is this the correct way to get the actual bytes when I access it using “fileHandle:read( “*a” )” ?
local filename = 'Icon.bmp' local localDir = system.ResourceDirectory local mime = require "mime" local path if localDir ~= nil then path = system.pathForFile( filename , localDir ) else path = system.pathForFile( filename ) end local fileHandle = io.open( path, "rb" ) local imageRawData if fileHandle then imageRawData = fileHandle:read( "\*a" ) io.close( fileHandle ) end print( imageRawData )