[PyKDE] Printing (General)

Ken Godee ken at perfect-image.com
Tue Mar 11 17:17:01 GMT 2003


> > What do some of the other people do to get clean reporting from
> > PyQt. Or does anyone have any other report/generation/printing
> > solutions.
> 
> Have you looked at QPrinter? I haven't actually used it that I can
> recall, but you should be able to lay out reports in QtDesigner and
> print them at higher dpi - at least that's what I get from
> reading the QPrinter docs.

Nope, QPrinter allows you to set many functions of your
device, including resolution, but won't do any layout stuff.
Yes you can layout using Designer, then pyuic, then create
an instance of that object in your app and grabwidget with 
QPainter but the problem is it's only at screen resolution 
ie. 81dpi. If you then set your QPrint device to 600dpi your image will
print out aprx. 1/8 scale. If you try to scale up to 600dpi, that
won't work either, it will be bigger(full scale), but image will still
be at 81dpi. Either way destroys even normal size fonts, QPainter
grabwidget converts widget to a pixmap and hands off to QPrinter which
paints to your device (or something like that).

> What I've done for printing forms (invoices, purchase orders,
> packing lists, etc) is use ReportLab which is a Python PDF
> generator. The way I used it is probably at a lower level than
> you're looking for, however I think they have some higher level
> stuff too. I don't have a URL handy, but a search on "ReportLab"
> should turn it up pretty quickly. I wouldn't necessarily call it
> 'easy' though.

I would like to print directly to the printer and not to a PDF.
I don't really care if it's easy or not, I just want it handle
images/fonts/lines correctly and print out at a decent
resolution.

Here's some of the following I've looked at.....

Kuger (Qt based,shows promise, no images though)
ReKall (Qt/python based, shows promise)
DataVision (Java Based shows promise)
JFreeReport
ReportLab
JReport
GRG
ReportManager
Latex
and many more.....

When I started down this road I didn't think I'd have to 
reinvent the wheel. I still can't believe I'm just not missing 
something?
So far if possible the best combo I can see is to
try to extend python with Java (pyJava?) a couple of
the programs out there come with complete Java Librarys
for report generating/design with complete font scaling and
image handling, headers, grouping, etc. But I really wanted
to stay in the Qt camp.




More information about the PyQt mailing list