[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Printing throught LPT1

Edgar Gonzalez

11/30/2007 4:18:00 AM

Hello, somebody has print to a printer from Ruby???

I thought a library called Etch for printing, but it doesn't have any
documentation :s

Regards,
--
Posted via http://www.ruby-....

5 Answers

Edgar Gonzalez

12/1/2007 3:55:00 AM

0

Edgar Gonzalez wrote:
> Hello, somebody has print to a printer from Ruby???
>
> I thought a library called Etch for printing, but it doesn't have any
> documentation :s
>
> Regards,

Nobody knows???
--
Posted via http://www.ruby-....

MonkeeSage

12/1/2007 5:52:00 AM

0

On Nov 30, 9:55 pm, Edgar Gonzalez <edgaralfo...@gmail.com> wrote:
> Edgar Gonzalez wrote:
> > Hello, somebody has print to a printer from Ruby???
>
> > I thought a library called Etch for printing, but it doesn't have any
> > documentation :s
>
> > Regards,
>
> Nobody knows???
> --
> Posted viahttp://www.ruby-....

It depends on your OS for one thing. I'm not aware of a project that
provides a uniform cross-platform API to printing for ruby (that
doesn't mean there isn't one). The closest thing I know of is
Gtk::PrintOperation from ruby-gtk [ http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3APrin...
].

HTH,
Jordan

Edgar Gonzalez

12/1/2007 6:48:00 AM

0

Jordan Callicoat wrote:
> On Nov 30, 9:55 pm, Edgar Gonzalez <edgaralfo...@gmail.com> wrote:
>> Posted viahttp://www.ruby-....
> It depends on your OS for one thing. I'm not aware of a project that
> provides a uniform cross-platform API to printing for ruby (that
> doesn't mean there isn't one). The closest thing I know of is
> Gtk::PrintOperation from ruby-gtk [
> http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3APrin...
> ].
>
> HTH,
> Jordan

Well i am in windows, how could i do that?
--
Posted via http://www.ruby-....

MonkeeSage

12/1/2007 7:31:00 AM

0

On Dec 1, 12:47 am, Edgar Gonzalez <edgaralfo...@gmail.com> wrote:
> Jordan Callicoat wrote:
> > On Nov 30, 9:55 pm, Edgar Gonzalez <edgaralfo...@gmail.com> wrote:
> >> Posted viahttp://www.ruby-....
> > It depends on your OS for one thing. I'm not aware of a project that
> > provides a uniform cross-platform API to printing for ruby (that
> > doesn't mean there isn't one). The closest thing I know of is
> > Gtk::PrintOperation from ruby-gtk [
> >http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3APrin...
> > ].
>
> > HTH,
> > Jordan
>
> Well i am in windows, how could i do that?
> --
> Posted viahttp://www.ruby-....

I'm not sure. I assume you could use the win32ole module that ships
with ruby 1.8 [1], or perhaps one of the third-party win32 modules
[2]. But I have no idea how. Maybe someone who knows about ruby +
win32 can help (Daniel Berger?). You could also probably write a
little C extension to call the windows API, but that may be more work
than necessary. Sorry I can't be of more help.

[1] http://www.ruby-doc.org/core/classes/WIN...
[2] http://raa.ruby-lang.org/cat.rhtml?category_major=Library;category_m...

Regards,
Jordan

Jano Svitok

12/1/2007 8:33:00 AM

0

On Dec 1, 2007 7:47 AM, Edgar Gonzalez <edgaralfonzo@gmail.com> wrote:
> Jordan Callicoat wrote:
> > On Nov 30, 9:55 pm, Edgar Gonzalez <edgaralfo...@gmail.com> wrote:
> >> Posted viahttp://www.ruby-....
> > It depends on your OS for one thing. I'm not aware of a project that
> > provides a uniform cross-platform API to printing for ruby (that
> > doesn't mean there isn't one). The closest thing I know of is
> > Gtk::PrintOperation from ruby-gtk [
> > http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3APrin...
> > ].
> >
> > HTH,
> > Jordan
>
> Well i am in windows, how could i do that?

You can open file 'PRN:' (note the double colon). That should provide
you with a line printer
(i.e. no graphics, just ascii output). I'm not sure whether it is
still supported.

Other than that, I guess the easiest way would be to create pdf
somehow and print that,
either using some command line tool, or Win32API/Win32OLE.

See http://www.ruby-...topic/83266 for some hints.