[PyQt] pdf print

Jim Bublitz jbublitz at nwinternet.com
Thu Feb 26 23:06:53 GMT 2009


On Thursday 26 February 2009 13:41:41 pm Nahuel Defossé wrote:
> Hi
> I've created pdf output in a StringIO file which I'd like to print in
> my PyQt4 app. Should I save it and send it to the system default
> reader? or could I automate this task? Is it possible to pirnt the
> file directly from PyQt? Thanks
> Nahuel

I use pdfs for checks, invoices, etc. ReportLab lets you do very precise 
layout easily.  I just save them as a temporary file and then use 
os.system and an lpr command to send them to the printer (under Linux):

Then cups worries about finding the printer, checking its status, 
managing the queue, translating to Postscript, etc.

Not sure how you'd do it with Windows or if you can send pdfs directly 
to the printer.

Jim



More information about the PyQt mailing list