question

deven avatar image
deven asked Jeffrey Blattman answered

I want to know about passing 'ReceiptPrintJob object' in ImagePrintJob.printJob(object) is print image on Receipt?

Here is my code.

PrintJob pjReceipt = new ReceiptPrintJob.Builder().orderId(order_id).build();

PrintJob pjImage = new ImagePrintJob.Builder().bitmap(bitmap).maxWidth().printJob(pjReceipt).build();

new PrintJobsConnector(PaymentSuccessListner.this).print(p, pjImage);

i want to print image in receipt without using ContentProvider technique, so i want to know, is this way works?

10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered

If you are expecting to be able to concatenate print jobs, the answer is no, that's not how it works. If you are not happy w/ the Receipt Registration mechanism or Smart Receipts, you'll need to construct the complete bitmap yourself. Please keep in mind memory constraints. You need to be prepared to chunk your bitmap to avoid out of memory problems.

10 |2000

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