0

I have a POS machine (in debug mode) that I wanted to use to print some receipts and other things, but the applications I use cannot use the printer, they print using other POS machines like Sunmi V1 and P2 and common thermal printers, but with this (Positive L3) No, none of the applications I tested can print or identify the printer of this machine, I have the printer API of this POS and I can print using this API, in addition to having a test application from the manufacturer, which can print normally using the printer, but I don't have the applications source code to implement this API in them.

Would it be possible to create some application/service that would divert printing attempts to this printer? Or some application that can "simulate" a connected printer and forward print attempts to the POS printer? (Using the same API), or some way for it to be recognized?

Out of curiosity: I've seen one of this same model with the printer accessible via bluetooth with InnerPrint from POS Sunmi V1, but I don't know how they did it

PS: sorry for my bad english

JNMP
  • 31
  • 2
  • "however the applications I use cannot use the printer" -- can those applications print at all? If so, does it seem like they are using [the Android print framework](https://developer.android.com/training/printing)? – CommonsWare Sep 25 '22 at 19:22
  • Yes they can, however when I try to print through them nothing happens, but when using the POS manufacturer's test app or creating a simple app that makes use of the API, the printer works. – JNMP Sep 25 '22 at 20:18
  • If you have their API, you can potentially create an app that interfaces that api with android's print API, https://developer.android.com/reference/android/printservice/PrintService should be the thing you need to implement a printer. Either one that actually prints using that 3rd party api or one that simulates printing on it. Quick google search for android.permission.BIND_PRINT_SERVICE came up with https://github.com/pelya/android-print-plugin-cups – zapl Sep 25 '22 at 20:52
  • "however when I try to print through them nothing happens" -- if the apps are seeing the printer and are printing through the Android print framework, then this feels like a support issue for your printer manufacturer. The implication would be that the printer manufacturer already supplies a print app that does what @zapl suggests, but it does not work. While you could attempt to write your own, it may be difficult for you to do better than what the printer manufacturer is doing. – CommonsWare Sep 25 '22 at 20:55
  • @CommonsWare I think they can't see it, so much so that it doesn't even appear in "Printers" in the settings, no application can find or recognize it – JNMP Sep 25 '22 at 21:06
  • Does the printer manufacturer make an app for Android that makes the printer available as a print service? – CommonsWare Sep 25 '22 at 21:11
  • @CommonsWare What it provides is a pdf with a printer API and a .zip with the code of a test application (which prints texts, bitmaps, qrcodes, barcodes...) in this case it's this zip, it's the test application code in the br.com.positivo.printerapp package, and another package with API implementation https://www.mediafire.com/file/h8k78fmi7cpshqd/PrinterApp.zip/file – JNMP Sep 25 '22 at 21:52
  • You are welcome to follow the advice of zapl and create a custom print service, if the manufacturer does not do so themselves. However, Android printing is based on PDFs, and your printer API may not be able to handle content like that. – CommonsWare Sep 25 '22 at 22:05
  • @CommonsWare I don't remember seeing anything related to PDFs in the documentation, and the way Positivo is, they will never create this service. Regarding pdf printing, it supports bitmap printing, so I think I can convert the pages into an image and send it to her, right? It is a small thermal POS printer – JNMP Sep 25 '22 at 22:18
  • That is worth a try. You might try setting up your Android device with a traditional laser or inkjet printer, then test printing from those apps. If that works, you can then start to see whether the output from those apps will work well with your printer, before you invest the time in trying to write the print service. For example, if the apps are designed for printing to letter-size pages, the scaled-down bitmaps for your printer may result in text that is too small to read. – CommonsWare Sep 25 '22 at 22:32
  • 1
    @CommonsWare The apps I use work great on other POS with 58mm printers I'll try to do it and post when I have any positive results. – JNMP Sep 25 '22 at 22:37
  • @CommonsWare I managed to create a service that creates and adds a printer, now I have a second problem, converting the printjob into a format that the printer understands (bitmap for example) – JNMP Sep 27 '22 at 10:59

0 Answers0