Printing throught LPT1

E

Edgar Gonzalez

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,
 
E

Edgar Gonzalez

Edgar said:
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???
 
M

MonkeeSage

Jordan said:
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::PrintOperation
].
HTH,
Jordan

Well i am in windows, how could i do that?

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/WIN32OLE.html
[2] http://raa.ruby-lang.org/cat.rhtml?category_major=Library;category_minor=Win32

Regards,
Jordan
 
J

Jano Svitok

Jordan said:
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::PrintOperation
].

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-forum.com/topic/83266 for some hints.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top