question

meerchant avatar image
meerchant asked oliver-johnson answered

How can I print to a USB printer using its low level SDK instead of the Clover SDK?

I have two Star Micronics printers, one is a USB printer and the other is a networked printer. In our app, if we connect to the networked printer, we can us use the Star SDK to print a ticket/order which looks exactly how we want it with both text and a barcode and a line cut. But the moment we plug in the USB printer, we can no longer use the Star SDK to send commands to the printer. We have to use the Clover SDK printing methods and those are at a much higher level and don't give us the control that we need. Is there a way to be able to use the USB printer's SDK to send lower level commands to it instead of the higher level Clover SDK? I tried going into printer settings/app and removing the usb printer as the default order and default receipt printer, but that didn't help.

10 |2000

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

Jacob Abrams avatar image
Jacob Abrams answered meerchant commented

We have restricted 3rd party applications from communicating directly with USB devices without approval and whitelisting. Generally we approve apps that want to control USB hardware that Clover doesn't already support such as USB pole display devices and USB label printers. Since Star Micronics printers are already supported by Clover so I doubt we would allow a single application to take control of the printer since that would exclude and/or disrupt other applications from using it.

Is it not possible for you to use the Clover ViewPrintJob or ImagePrintJob classes in the clover-android-sdk? They should allow you to print anything you want.

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.

meerchant avatar image meerchant commented ·

I had tried ImagePrintJob and TextPrintJob but what I really need is one job that does both an image and text and lets me control the spacing between the two. I'll have to try ViewPrintJob which seems to convert the contents of a view to an image an then print it. This may work for us, but the reason I preferred being able to communicate directly with the printer is that does a good job wrapping text on multiple lines and the ability to control text font sizes. I'm not sure how well the text wrapping will work if its all part of an image.

Thanks for the suggestion to try the ViewPrintJob.

0 Likes 0 ·
jems-ford avatar image
jems-ford Suspended answered
USB printer is the best printer for printing the documents. A printer is an external hardware output device that takes the electronic data stored on a computer or other device and generates a hard copy of it. If you are facing any type of issues related to the Canon Printer Please visit https://www.canonprintersupportnumbers.com/blog/how-to-fix-canon-printer-offline-error/
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