question

imenu360 avatar image
imenu360 asked imenu360 commented

ImagePrintJob to print image not working

we are trying to print custom receipt using ImagePrintJob for clover station. But it is not printing anything though temp file is creating successfully .

Our sample code is -

1 .

InputStream is = (InputStream) new URL("http://example.com/receipt.png").getContent();

Bitmap b = BitmapFactory.decodeStream(is); PrintJob imagePrint = new ImagePrintJob.Builder().bitmap(b).maxWidth().build();

imagePrint.print(getApplicationContext(), mAccount);

2 .

PrintJob imagePrint = new ImagePrintJob.Builder().urlString("http://example.com/receipt.png").build();

imagePrint.print(getApplicationContext(), mAccount);

Please guide how to use ImagePrintJob .

Print
1 comment
10 |2000

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

imenu360 avatar image imenu360 commented ·

We got it working just by adding following in Manifest :

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community