Re: [PyKDE] Printing (General)
On 11-Mar-03 Ricardo Javier Cardenes Medina wrote: > If they end implementing a good table support, then I could > change my mind, but not now. If I had to pick the features most lacking in Linux widget sets or Linux in general it would have to be report generation and a good table widget (inplace editing, good navigation but with clean redraws/flicker-free, support virtualizing a large number of rows like Delphi tables do, etc). Qt (and GTK last time I looked) have improved but still fall short in my opinion. Either one would be a good project - unfortunately I can't keep up with the projects I'm doing now. Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Printing (General)
On Tue, Mar 11, 2003 at 12:07:40PM -0800, Jim Bublitz wrote: > As far as report generation/layout - I agree there isn't a good > general purpose solution that I'm aware of (good project > possibility for someone who's interested). It would be fine porting FOP back to Python :') (now it's 100% Java, but it started as a Python project, IIRC) :'), or contributing to it's porting to C++ and subsequent SIP-sization }:) > Apparently I did the layout using ReportLab/platypus and somehow > (can't find the piece of code that did it) got the PDF output into Rerporlab is a fine tool, but it needs further development to achieve some sophisticated features. I used it extensively five months ago on a project, generating PDF on the fly to serve it via HTTP, and if I had to start again, I'd probably drop it in favour of Jython+FOP :-/ If they end implementing a good table support, then I could change my mind, but not now. pgp0.pgp Description: PGP signature
RE: [PyKDE] Printing (General)
On 11-Mar-03 Ken Godee wrote: > 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). > 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. As far as report generation/layout - I agree there isn't a good general purpose solution that I'm aware of (good project possibility for someone who's interested). As far a QPrinter - I went back and looked at my code. I haven't worked on this for about a year and the project wasn't completed. Apparently I did the layout using ReportLab/platypus and somehow (can't find the piece of code that did it) got the PDF output into a widget (pixmap?) which I just passed into QPrinter (scaled by (.8, .8) for some reason). I'm not sure how I did the PDF->widget stuff. I was using the KDE PDF viewer (as a KPart) for previewing, but I don't think that's how it was done. At any rate, I didn't have any trouble getting good quality output from QPrinter. There were only 5 or 6 lines of actual QPrinter code - I'd forgotten that I even used it. All of the PDF layout was in inches. KDE (kdeprint in kdelibs) basically uses an extended QPrinter (KPrinter) for printing - you might look at the kdeprint code or the code for apps like KWrite or KWord and see how they do it. There is a kdeprint module for PyKDE, but I haven't done much with it - no examples yet. I wish I could be more helpful, but I haven't looked at the subject for quite a while and can't do the digging at the moment. I'm still using a pretty kludgy system for forms printing myself. Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
RE: [PyKDE] Printing (General)
> > 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. ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Printing (General)
> 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. Haven't tried working with QPrinter through Designer... Take a look at the helpviewer example included with qt to get an idea for how to use it with QRichText. > > 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" http://www.reportlab.com > should turn it up pretty quickly. I wouldn't necessarily call it > 'easy' though. I ended up using this on the last app I worked on and I must agree. It's not terribly easy to use, but it does work well. My biggest complaint is that it generates PDF files and I wanted to print stuff from inside my app rather than just saving a PDF file to be printed later. I had some nasty os.system() stuff on the Linux side, but never figured out anything useful on the Windows side. I may have just missed something though... I do have a little code (circa 2.5 years ago) that works with the current version of reportlab that you're free to dig through. Greg ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
Re: [PyKDE] Printing (General)
If you find something useful, I'd *love* to know. I'm fighting the same sort of problem right now and ended up using QRichText and laying everything out in the psuedo html understood by Qt. It works ok, but the html support isn't very comprehensive. Greg On Monday 10 March 2003 08:54 pm, Kenneth Godee wrote: > Ok, since I still consider myself a newbee to > PyQt maybe I'm missing something? > > 1. Line by Line printing at screen res. with single size font > seems easy enough, oh, wait better make that the a fixed resolution > because screen resolution can change from computer to computer. > Results fair, but to plain to be usefull. > > 2. Other than that I can't seem to find ANY kind of report > layout/generator. So what does everyone do to layout a page(s) with > different fonts, font sizes, boxes etc., position each and every piece hand > coded and postioned pixel by pixel? Thats the only way I can figure it out. > > 3. How do you add logos or art work at a higher resolutions(ie. 600dpi), > 81dpi doesn't cut it. I tried scaling up, of coarse that doesn't work. I > even tried creating a layout of something like 6,000 x 4,000 and adding > 600dpi artwork, fonts at like 200 points and grabing the widget and > printing at HiResolution(600dpi). It looked good but brought my 2ghz > machine to a crawl even for a simple layout. I tried using Designer as a > report layout designer and "grabbing" an instance of that even at 81dpi, > but once it gets converted to a pixmap, even the normal size fonts get > trashed. > > 4. I'll battle it out one way or the other, but maybe I'm missing > something? I hate the thought of going to something like an external app > and not staying with PyQt for report generation. I've looked at > most(everyone I could find, anyway) of the external report generators and > most don't look promising, if you just want to do direct printing and not > PDF. I guess this is why some of these external programs can generate > extreme pricing, for all the reasons above. > > What do some of the other people do to get clean reporting from > PyQt. Or does anyone have any other report/generation/printing solutions. > > Thanks, > Ken > > > > > ___ > PyKDE mailing list[EMAIL PROTECTED] > http://mats.gmd.de/mailman/listinfo/pykde ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
RE: [PyKDE] Printing (General)
On 11-Mar-03 Kenneth Godee wrote: > Ok, since I still consider myself a newbee to > PyQt maybe I'm missing something? > 1. Line by Line printing at screen res. with single size font > seems easy enough, oh, wait better make that the a fixed > resolution because screen resolution can change from computer to > computer. Results fair, but to plain to be usefull. > 2. Other than that I can't seem to find ANY kind of report > layout/generator. So what does everyone do to layout a page(s) > with different fonts, font sizes, boxes etc., position each and > every piece hand coded and postioned pixel by pixel? Thats the > only way I can figure it out. > > 3. How do you add logos or art work at a higher resolutions(ie. > 600dpi), 81dpi doesn't cut it. I tried scaling up, of coarse > that doesn't work. I even tried creating a layout of something > like 6,000 x 4,000 and adding 600dpi artwork, fonts at like 200 > points and grabing the widget and printing at > HiResolution(600dpi). > It looked good but brought my 2ghz machine to a crawl even for a > simple layout. I tried using Designer as a report layout > designer and "grabbing" an instance of that even at 81dpi, but > once it gets converted to a pixmap, even the normal size fonts > get trashed. > 4. I'll battle it out one way or the other, but maybe I'm missing > something? I hate the thought of going to something like an > external app and not staying with PyQt for report generation. > I've looked at most(everyone I could find, anyway) of the > external report generators and most don't look promising, if you > just want to do direct printing and not PDF. I guess this is why > some of these external programs can generate extreme pricing, > for all the reasons above. > 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. 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. Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Printing (General)
Ok, since I still consider myself a newbee to PyQt maybe I'm missing something? 1. Line by Line printing at screen res. with single size font seems easy enough, oh, wait better make that the a fixed resolution because screen resolution can change from computer to computer. Results fair, but to plain to be usefull. 2. Other than that I can't seem to find ANY kind of report layout/generator. So what does everyone do to layout a page(s) with different fonts, font sizes, boxes etc., position each and every piece hand coded and postioned pixel by pixel? Thats the only way I can figure it out. 3. How do you add logos or art work at a higher resolutions(ie. 600dpi), 81dpi doesn't cut it. I tried scaling up, of coarse that doesn't work. I even tried creating a layout of something like 6,000 x 4,000 and adding 600dpi artwork, fonts at like 200 points and grabing the widget and printing at HiResolution(600dpi). It looked good but brought my 2ghz machine to a crawl even for a simple layout. I tried using Designer as a report layout designer and "grabbing" an instance of that even at 81dpi, but once it gets converted to a pixmap, even the normal size fonts get trashed. 4. I'll battle it out one way or the other, but maybe I'm missing something? I hate the thought of going to something like an external app and not staying with PyQt for report generation. I've looked at most(everyone I could find, anyway) of the external report generators and most don't look promising, if you just want to do direct printing and not PDF. I guess this is why some of these external programs can generate extreme pricing, for all the reasons above. What do some of the other people do to get clean reporting from PyQt. Or does anyone have any other report/generation/printing solutions. Thanks, Ken ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde