question

op27no2 avatar image
op27no2 asked op27no2 commented

ImagePrintJob printing black

Hi,

ImagePrintJob doesn't seem to be printing my bitmap. I can set the bitmap to my UI so it appears correct, but then when I try to print it as follows it just prints a black rectangle.

PrintJob printJob = new ImagePrintJob.Builder().bitmap(b).build(); printJob.print(mContext, account);

What am I missing?

Thanks!

Print
3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Have you you tried other images? Can you link to the image you are attempting to print?

0 Likes 0 ·
op27no2 avatar image op27no2 commented ·

Just creating it w/ canvas and drawText. This approach works when loading the bitmap with a receipt registration provider. I just want to print it directly now with ImagePrintJob if possible.

Bitmap image = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(image); canvas.drawText(string, 0, 0, paint);

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

For starters, use RGB_565. Compress and output the image as a PNG and provide a link. Let's see what it looks like. And again, try with some other images.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community