views:

41

answers:

1

Hey all,
I am trying to make a thing where in other applications you can print to a certain printer and python will get the data. How would I go about making this? It would have to work in all applications, so it would appear as a normal printer, and work on Linux and Windows, even if I have to rewrite it for both.

So to recap: One opens a program and hits the print button. It brings up the printer dialogue and they select the python printer, like any other printer. After they accept, the python program which loaded the module (this will probably be a module) gets the data that the other application printed.

+1  A: 

Most Linux distros (and OS X) and use CUPS to do printing these days. A CUPS backends for a specific printer is ultimately just an executable, which you can make do anything you want. The CUPS project provides filter/backend API documentation. There also exists at least one open-source CUPS virtual printer in the form of CUPS-PDF, which might make for a useful example to consult.

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

llasram
+1 for CUPS. CUPS works on windows limited to 32 bit Post Script. So the answer is "Use PS and CUPS for all platforms." http://cups.org/index.php
drewk