Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Printing to printers on Win32
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


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-17-04 08:58 PM


Re: Printing to printers on Win32
in 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



Report this thread to moderator Post Follow-up to this message
Old Post
Pit
11-17-04 08:58 PM


Re: Printing to printers on Win32
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?


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-17-04 08:58 PM


Re: Printing to printers on Win32
in my application excel will be started by Win32::Process
the other possibility I've never tested

Pit


Report this thread to moderator Post Follow-up to this message
Old Post
Pit
11-18-04 01:57 PM


Re: Printing to printers on Win32
"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




Report this thread to moderator Post Follow-up to this message
Old Post
Shawn Zabel
11-19-04 01:57 AM


Re: Printing to printers on Win32
"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

Report this thread to moderator Post Follow-up to this message
Old Post
Slaven Rezic
11-19-04 01:58 PM


Re: Printing to printers on Win32
You 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.

Report this thread to moderator Post Follow-up to this message
Old Post
sandor
11-21-04 08:58 AM


Re: Printing to printers on Win32
Hi

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


Report this thread to moderator Post Follow-up to this message
Old Post
Pit
11-29-04 09:05 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:54 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.