[reportlab] print directly to printer

Derrick 'dman' Hudson dman at dman13.dyndns.org
Thu Dec 18 22:53:18 CET 2003


On Thu, 18 Dec 2003 19:27:10 +0100, Karlheinz Klingbeil wrote:
> I have deonwloaded and tested reportlab, which seems to be good enough for
> my needs with printing reports, formatted text and such things.
> 
> But i have a question:
> 
> I have not seen any hint in the docu how to print a generated PDF directly
> to the printer in a portable manner, it has to work under all OS's

On some UNIX systems (mine and others with a suitable
PDF->printer_language filter), open a pipe to 'lp' and feed the PDF to
it.  On other UNIX systems you'll need to convert the PDF to PS first,
then pipe it to lp.  (PS is the standard interchange format for
printed material)

On Windows - I have no idea.

Is your program GUI-based or not?  If it is, then I think wxPython has
some printer abstraction code you can use to let the user choose the
printer, etc.  Otherwise I don't know of any existing packages to
insulate you from platform differences in the printing sub-system.

-- 
The fear of the Lord leads to life:
Then one rests content, untouched by trouble.
        Proverbs 19:23
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org




More information about the Python-list mailing list