I'm developing application which prints using Bixolon SPP-R300 mobile printer via Bluetooth.
I've managed to make the Bluetooth connection, print Text and do lineFeed
but i still don't know how to print images.
For the text i have this working:
returnValue = mBxlService.PrintText("Text Example",
BxlService.BXL_ALIGNMENT_LEFT,
BxlService.BXL_FT_DEFAULT,
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
The mBxlService
have a method for image too (mBxlService.PrintImage
).
I want to print a image from the drawable
folder in the project. Something like drawable/image.png
Someone have worked with this printer or know how to print images with it? There is few information about this, and i'm really trying here.
Other thing is, every time i connect the printer to android a pairing request happens, there is something to bypass that? to do that by code?
This is the printer: Bixolon SPP-R300
Thanks in advance and sorry for my language, English is not my main language.
Take a look at this link (it has a snipped of code to print image) Android print image using BIXOLON SPP-R300
And here is the how you can get URI to your resource: how to get an uri of an image resource in android
So, overall code will look something like this:
Sure, you need to replace "your.package.name" and R.drawable.image_1.
Also, there is a chance that it won't like a path to resources. In such case, I would recommend to spit the image out to SD card and print it from there.