Transferring data from a virtual printer to python

I am trying to make sure that in other applications you can print on a specific printer, and python will get the data. How can i do this? It should work in all applications, so it will look like a regular printer and work with Linux and Windows, even if I have to rewrite it for both.

So, to repeat: one opens the program and presses the print button. It invokes a dialog with the printer, and they select the python printer, like any other printer. After they agree, the python program that loaded the module (it will probably be the module) will receive data that was printed by another application.

+3
source share
1 answer

Most Linux distributions (and OS X) and the use of CUPS for printing these days. CUPS containers for a particular printer are ultimately just an executable file that you can do just about anything. The CUPS project provides documentation on the filter / backend API . There is also at least one open source CUPS virtual printer in the form of CUPS-PDF , which can help you find a useful example.

On the Windows side, I'm afraid I can't help you.

+2
source

Source: https://habr.com/ru/post/1765837/


All Articles