Code Comments
Programming Forum and web based access to our favorite programming groups.I want to see if I understand what is available here for printing a report from a Tk app to a printer on a Win32 system. 1) I can use canvas->postrcipt() to create a postscript file of the canvas. So, since I currently have a ROText widget for my report, can I just make that widget an embedded window on a canvas parent and then be able to use postcript as described? Or must I actually place the text report onto the canvas? 2) How can I call the Win32 printer list to select the printer? Once selected, can I send the text or the postscript conversion of the text to that selected printer using a Tk (or perhaps a Win32) method? Thanks, John
Post Follow-up to this messagein Tk there is no module to select a printer. the way is to transform the postscript file into a pdf-document with ghostscript (ps2pdf) and print with the acrobat reader. you also can use the modules Spreadsheet::WriteExcel or Win32::OLE::Const 'Microsoft Excel' to create an excel-sheet and print this with excel. I use the second way, and it works fine Pit
Post Follow-up to this messageWhen you say you print with excel do you mean the user has to actually launch Excel? Or can call the print command in Excel from the perl module and then get the Printers Dialog box that you see when you select print interactively?
Post Follow-up to this messagein my application excel will be started by Win32::Process the other possibility I've never tested Pit
Post Follow-up to this message"Johnny Google" <john_pataki@yahoo.com> wrote in message news:1100719497.337781.192940@c13g2000cwb.googlegroups.com... > When you say you print with excel do you mean the user has to actually > launch Excel? Or can call the print command in Excel from the perl > module and then get the Printers Dialog box that you see when you > select print interactively? > You could use the Win32::OLE module to open Excel in the background and print the file to the default printer. The Excel application could be completely hidden so the user never knows what's happening. - Shawn
Post Follow-up to this message"Johnny Google" <john_pataki@yahoo.com> wrote in message news:<1100709606.254484.120010@f14 g2000cwb.googlegroups.com>... > I want to see if I understand what is available here for printing a > report from a Tk app to a printer on a Win32 system. > > 1) I can use canvas->postrcipt() to create a postscript file of the > canvas. So, since I currently have a ROText widget for my report, can I > just make that widget an embedded window on a canvas parent and then be > able to use postcript as described? Or must I actually place the text > report onto the canvas? This works, at least on Unix. However, embedded widgets are handled by taking a snapshot of the widget, which means that the content show up as a rasterized image. The quality would be probably worse than using canvas text items. Regards, Slaven
Post Follow-up to this messageYou can use Win32::Printer to print "natively" from perl. It works quite well. It is a wrapper around GDI. The docs are pretty good. Take a look.
Post Follow-up to this messageHi I've tried to install the Win32-printer Module via ppm in ActivePerl 5.8.4.810. the PPM says to me "Sucessfully installed Win32-Printer version 0.7 ", but nothing will be downloaded. Whats wrong ? Pit
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.