Prev: stuff
Next: FAQ 6.16 How can I do approximate matching?
From: Willem on 9 Jun 2010 14:18 Huub wrote: ) I use DBI to get the data from the database, after which it is printed as ) pure plain text. So I'm not converting anything to XML, HTML, pdf or so. ) This has worked for some years now, and no problem. ) ) And my initial question was if there is a Perl module that enables me to ) print both a jpg image and the data from the database in 1 single ) printjob. But if I understood it correctly, the Graphics modules are ) intended to create a graphical image, rather than to fetch one for e.g. ) printing on paper. Yes, you want a printing module for that, not a graphics module. For example, on Win32 you have stuff like Win32::Printer, which can print several image formats, according to the docs. Or you could generate HTML or XSL-FO or something with the text and the graphics you want, and then print that. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT
From: Steve C on 9 Jun 2010 15:48 Huub wrote: > Hi, > > I'm using Perl to print from database, which works great. Now I'd like to > print a .JPG picture with it. However, searching CPAN I find a LOT of > graphics modules. Any recommendation which one to use for this? > The intermediate form between binary data and a printer is a page description language. ASCII is the original text-only PDL, but you can't use it for anything more complex. Good choices for page description with images are postscript, pdf, or pcl, all of which can be generated from perl. HTML works too if value ease over precision. It just depends on your printing environment.
From: Ilya Zakharevich on 9 Jun 2010 22:08 On 2010-06-09, RedGrittyBrick <RedGrittyBrick(a)spamweary.invalid> wrote: > I'd have the Perl program write a Postscript file containing image data > and text, then use OS-dependant commands to spool that to a Postscript > printer or via a Postscript aware print subsystem like CUPS or > Ghostscript. Your mileage is likely to vary. CPAN is your friend. Nowadays it looks like PostScript would be the last choice... Generating PDF might be easy (did not try it), and it is much easier to print... Myself, I would go through enscript or TeX - this would cover the typesetting needs (instead of trying to reinvent things in Perl). Hope this helps, Ilya
From: John Bokma on 10 Jun 2010 02:08 Ilya Zakharevich <nospam-abuse(a)ilyaz.org> writes: > On 2010-06-09, RedGrittyBrick <RedGrittyBrick(a)spamweary.invalid> wrote: >> I'd have the Perl program write a Postscript file containing image data >> and text, then use OS-dependant commands to spool that to a Postscript >> printer or via a Postscript aware print subsystem like CUPS or >> Ghostscript. Your mileage is likely to vary. CPAN is your friend. > > Nowadays it looks like PostScript would be the last choice... > Generating PDF might be easy (did not try it), and it is much easier > to print... > > Myself, I would go through enscript or TeX - this would cover the > typesetting needs (instead of trying to reinvent things in Perl). > > Hope this helps, > Ilya Over a year ago I played with lout: http://en.wikipedia.org/wiki/Lout_%28software%29 Maybe also something to look into? -- John Bokma j3b Hacking & Hiking in Mexico - http://johnbokma.com/ http://castleamber.com/ - Perl & Python Development
From: RedGrittyBrick on 10 Jun 2010 06:01
On 10/06/2010 03:08, Ilya Zakharevich wrote: > On 2010-06-09, RedGrittyBrick<RedGrittyBrick(a)spamweary.invalid> wrote: >> I'd have the Perl program write a Postscript file containing image data >> and text, then use OS-dependant commands to spool that to a Postscript >> printer or via a Postscript aware print subsystem like CUPS or >> Ghostscript. Your mileage is likely to vary. CPAN is your friend. > > Nowadays it looks like PostScript would be the last choice... I think it depends on your skillset, I happen to know a little PostScript and like the language a lot, this obviously biases my choice. > Generating PDF might be easy (did not try it), Yes, there appear to be some good CPAN modules for writing PDF. > and it is much easier to print... This isn't something I find any problems with. Most laser printers above entry level will support PostScript printing. Some of them support PDF printing. Most (if not all) Unix/Linux systems will have print systems that can rasterise PostScript for non-Postscript printers. > Myself, I would go through enscript or TeX - this would cover the > typesetting needs I also use enscript and a2ps. I found writing TeX (or rather LaTeX) still needs a lot of markup and the production chain can be complicated and prone to generating mysterious error messages. What TeX toolset do you use? I use grutatxt a lot - which can generate HTML and LaTeX (and thence PDF) from plain text. It is available as a Perl module. I'm not sure about the inclusion of images other than for HTML though. I certainly prefer keeping source matter in a plain text form rather than in any proprietary form that is likely to become obsolete and unreadable. The OP might look at these as well as markdown, asciidoc etc > (instead of trying to reinvent things in Perl). That is a good point. It depends a bit on how much "typesetting" you need to do but I guess I must agree. -- RGB |