[fxruby-users] Graphics printing with FXRuby?
David Peoples
davidp at touringcyclist.com
Thu Feb 24 11:27:13 EST 2005
Stephan Kämper wrote:
...
> Ia small app I use
>
> shell = Win32API.new( "shell32", "ShellExecute",
> [ 'L','P','P','P','P','L' ], 'L' )
>
> shell.Call( 0, "print", fname, 0, 0, 0 )
>
> to print plain text. This only works on Windows boxes for obvious
> reasons. BTW, nowadays I'd use DL.
>
> Apparently this (as your workaround) involves creating a temporary file.
>
Thanks for the code example. I did eventually find the similar sample
code in the "Programming Ruby" book -- don't know why I missed that when
I asked this question.
>
> My opinion is that printing shouldn't involve additional software like
> ghostscript and what-not. If (and when) I develop a GUI based program,
> in many cases it's something less experienced user use. And these just
> don't understand that printing is (or might) be a problem at all: After
> all any program can issue a print job - OpenOffice, Word, IrfanView...
>
> But I must confess that I couldn't implement this 'feature' either.
>
I agree that requiring a working installation of Ghostscript to be able
to print is several steps worse than ideal. The notion of stringing
several specialized tools together to get the job done *is* part of the
Unix ethic, but non-technical computer users don't care about the "Unix
ethic", they just want the program to work and not break.
I can certainly handle installing and configuring Ghostscript on my
company's machines if we roll out Ruby versions of our programs
internally. But Ghostscript isn't the easiest install (requiring manual
editing of the PATH, unless I misunderstood) so I'd hate to have to
support that if we ever released these programs to the general public. I
guess if we ever *did* release the programs, I'd need to find some sort
of uber-installer that can include the Ghostscript installer and
automate the PATH update.
David
>
> Happy rubying
>
> Stephan
>
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
--
David Peoples davidp at touringcyclist.com
The Touring Cyclist http://www.touringcyclist.com
11816 St. Charles Rock Road, Bridgeton, MO 63044
tel: 314-739-4648 fax: 314-739-4972
More information about the fxruby-users
mailing list