Prev: stuff
Next: FAQ 6.16 How can I do approximate matching?
From: Willem on 9 Jun 2010 11:51 Huub wrote: ) Ok, looks like I haven't been clear enough. ) ) I am talking about printing to paper and the intention is to print an ) existing jpg picture on the paper after which the data from the database ) is printed. ) ) Reading the other reactions, I think it would be easier to first print ) that image using Gimp or so, and then re-use the paper using Perl to ) print the data. Though it would take at least twice as much time. What method are you using to print the data to the printer ? Are you using some module ? Is it pure plain text ? Postscript ? There's probably some Perl module out there that can print combined text and jpg images to a printer. 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: RedGrittyBrick on 9 Jun 2010 13:04 On 09/06/2010 05:40, Huub wrote: > > I'm using Perl to print from database, which works great. So how are you doing that? You might be * Using a Win32 API to make GDI calls etc * Using Perl print() statements to write a text file then exec() a 'lp' command * A gazillion other possibilities. In order to provide a relevant answer, potential helpers might benefit from a little more context. > 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? 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. -- RGB
From: John Bokma on 9 Jun 2010 13:08 Huub <v.niekerk_@_hccnet.nl> writes: > On Wed, 09 Jun 2010 07:34:10 -0700, Jürgen Exner wrote: > >> Huub <v.niekerk_@_hccnet.nl> wrote: >>>I'm using Perl to print from database, which works great. Now I'd like >>>to print a .JPG picture with it. >> >> I am puzzled. >> >> "print" like in print to a sheet of paper? Normally you would use >> whatever means your OS provides for that and normally yes, you could >> initiate that via a Perl program, too, just like you would initiate any >> other external command from a Perl program. >> >> Or "print" like the print() function in Perl? Well, that is mostly for >> text although of course you can use it for binary data, too. >> >> Or what "print" are you talking about? >> >> jue > > Ok, looks like I haven't been clear enough. > > I am talking about printing to paper and the intention is to print an > existing jpg picture on the paper after which the data from the database > is printed. > > Reading the other reactions, I think it would be easier to first print > that image using Gimp or so, and then re-use the paper using Perl to > print the data. Though it would take at least twice as much time. > > > Any suggestion welcome. Install Java, Apache FOP, and Saxon-B XSLT Generate XML via your Perl program Convert this XML via saxonb-xslt to fo Convert fo to pdf (or pick any other of the formats supported) using Apache FOP. It sounds like a lot of trouble, but IMO it's extremely flexible, see: http://johnbokma.com/mexit/2010/02/11/ It's most likely easier than generating your own PDF. Another option is to just generate a HTML file and print that one via a browser (or convert HTML to PDF and print that). But I am quite sure that XSL-FO gives you more control over the output than HTML. -- John Bokma j3b Hacking & Hiking in Mexico - http://johnbokma.com/ http://castleamber.com/ - Perl & Python Development
From: Sherm Pendley on 9 Jun 2010 13:35 Huub <v.niekerk_@_hccnet.nl> writes: > I am talking about printing to paper and the intention is to print an > existing jpg picture on the paper after which the data from the database > is printed. I would generate an HTML document from the database, using Template Toolkit or Mason, and referring to the JPEG pic in an <img ...> element. > Reading the other reactions, I think it would be easier to first print > that image using Gimp or so, and then re-use the paper using Perl to > print the data. Please tell me you're joking... sherm-- -- Sherm Pendley <www.shermpendley.com> <www.camelbones.org> Cocoa Developer
From: Huub on 9 Jun 2010 14:02
On Wed, 09 Jun 2010 15:51:07 +0000, Willem wrote: > Huub wrote: > ) Ok, looks like I haven't been clear enough. ) > ) I am talking about printing to paper and the intention is to print an > ) existing jpg picture on the paper after which the data from the > database ) is printed. > ) > ) Reading the other reactions, I think it would be easier to first print > ) that image using Gimp or so, and then re-use the paper using Perl to ) > print the data. Though it would take at least twice as much time. > > What method are you using to print the data to the printer ? Are you > using some module ? Is it pure plain text ? Postscript ? > > There's probably some Perl module out there that can print combined text > and jpg images to a printer. > > > SaSW, Willem 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. |