Implement interaction with printer
What is the problem or limitation you are having?
Toga currently offers support to some hardware, like camera and computer screen, but doesn't offer direct access to printer or scanner.
Describe the solution you'd like
The ideal implementation of this feature would be able to handle:
- Raw text
- Text files (e.g. txt or pdf)
- Image files (e.g. png or jpeg)
One pice of the content listed above would be handed to the OS-specfic print dialog, like the ones attached below, where page selection, printer selection, orientation and other configurations should happen, outside of the Toga application.
Linux (GTK): https://docs.gtk.org/gtk4/class.PrintUnixDialog.html
Windows:
MacOS:
Android:
Describe alternatives you've considered
Handling printers and printing in python is not very straightfoward:
- there is a package dedicated to windows
win32print,win32ui - the solution I found for Unix systems would issue a
lpcommand to the system, using Python'ssubprocesspackage
Additional context
No response
I'm generally skeptical about adding support for hardware devices to Toga, but in this case it definitely makes sense, because the printer dialog will need to be linked to the app's existing UI.