I need to do a mail merge to a postscript printer. Does anyone know of
any tools that is available to the Python community?
I checked the libraries and other Python documentation and failed to
find any help on printing to a postscript printer!
--
Regards
Clement
a few options:
there's PIDDLE:
http://www.strout.net/python/piddle/intro.html
if you have PIL installed, there's a very basic PostScript
driver in there:
http://www.pythonware.com/library/pil/handbook/psdraw.htm
and yes, Tkinter can print the contents of a canvas to a
PostScript printer, and Grail (http://grail.cnri.reston.va.us/grail/)
comes with an HTML to PostScript converter...
</F>
It's not clear what you want. Can't you just open a connection to
the printer and write to it? The API will differ by platform; on Unix
you'd do something like:
import os
printer = os.popen("lpr", "w")
printer.write("%!PS-Adobe-2.0\n")
...
printer.close()
I imagine you can get some sort of handle to a printer on Windows
that allows similar operations.
On the other hand, you may want something a little higher level.
Grail (http://grail.python.org/) includes support for printing to a
PostScript printer (Unix-style) via an extended "writer" object; see
the formatter module in the standard library for a description of the
interface. It's pretty easy to use, but may not be what you're
looking for. Adapting it to work on Window shouldn't be too hard if
you can get a way to send the PostScript to the printer yourself.
-Fred
--
Fred L. Drake, Jr. <fdr...@acm.org>
Corporation for National Research Initiatives