question

whosbuddy avatar image
whosbuddy asked whosbuddy answered

Custom receipts aren't printing to emulator's sdcard

I've created my own custom print job

ImagePrintJob2 imagePrint = new ImagePrintJob2.Builder(getReactApplicationContext()).bitmap(newBitmap).build();
imagePrint.print(getReactApplicationContext(), TenderActivity.getAccount());

and newBitmap shows my custom receipt correctly in android studio. Once these lines run, the emulator give the toast notification, "View sent to Printer". However, when I run

adb pull /sdcard/receipts/ ~/Downloads/

or

adb pull /sdcard/clover/image-print/ ~/Downloads/

the receipts only occasionally pull from my sdcard.

If I adb shell into my emulator and view the directorys listed in the commands above, most of the time, it seems like the print jobs are not saving.

The print jobs have shown up in my downloads folder, but only rarely. Is this an issue related to the emulator?

How can I achieve a more consistent behaviour?

Clover FlexPrintEmulator
10 |2000 characters needed characters left characters exceeded

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

1 Answer

whosbuddy avatar image
whosbuddy answered

The printer wasn't printing because there were some failed print jobs in the queue due to a NPE somewhere in my code. Once the queue was cleared, the printer worked as expected.

10 |2000 characters needed characters left characters exceeded

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

Welcome to the
Clover Developer Community