transfer text file to lpt1 port

42 views
Skip to first unread message

ahmed el attar

unread,
Sep 3, 2012, 2:11:35 PM9/3/12
to rubyonra...@googlegroups.com
Hello,

I'm new ruby developer, any idea about : send text file to lpt1 port
where i have installed an intermec printer?

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Sep 3, 2012, 4:09:49 PM9/3/12
to rubyonra...@googlegroups.com
On 3 September 2012 19:11, ahmed el attar <li...@ruby-forum.com> wrote:
> Hello,
>
> I'm new ruby developer, any idea about : send text file to lpt1 port
> where i have installed an intermec printer?

Are you trying to do this on the client PC or on the server? If on
the server you can call out to the OS using system() so presumably you
could do it that way.

Colin

ahmed el attar

unread,
Sep 4, 2012, 5:25:54 AM9/4/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1074484:
Thanks Colin, yes i try on the server, but you can help me please about
this command ?

Ahmed

Colin Law

unread,
Sep 4, 2012, 6:18:06 AM9/4/12
to rubyonra...@googlegroups.com
Did you try looking at the ruby documentation? This for example
http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-system

Colin

ahmed el attar

unread,
Sep 4, 2012, 7:14:36 AM9/4/12
to rubyonra...@googlegroups.com
Thanks, but i want send text file from server to client (lpt1 port),
it's possible?

sjm

unread,
Sep 5, 2012, 5:00:27 AM9/5/12
to rubyonra...@googlegroups.com
Hi,

You said, in response to Colin's question, that you wanted to send it to lpt1 port on the server.  Now you're saying that it is to be sent to the lpt1 port on the client?

This would not be possible via HTTP, the server cannot take control of the client.  The best you could achieve (IMHO) is to render the text file to the browser, and use JavaScript to open the browser's print dialogue.

If this is a Ruby question rather than a Rails question, then you would need to write a server and a client application with the client requesting the file from the server using a standard (or your own proprietary) protocol, once the received it [the client] could open the port and send the received text file to it.

I hope that this helps.

All the best,

Steve

sjm

unread,
Sep 5, 2012, 5:02:08 AM9/5/12
to rubyonra...@googlegroups.com
>> You said, in response to Colin's question, that you wanted to send it to lpt1 port on the server.  Now you're saying that it is to be sent to the lpt1 port on the client?

You never said that, I misread it - lol, sorry.

Steve

Matt Jones

unread,
Sep 5, 2012, 7:32:15 AM9/5/12
to rubyonra...@googlegroups.com


On Tuesday, 4 September 2012 07:15:28 UTC-4, Ruby-Forum.com User wrote:
Thanks, but i want send text file from server to client (lpt1 port),
it's possible?


This seems to come up every couple months - check out this thread from January for some discussion:


Not sure if the final method there (using jzebra) will work for your app, but it seems like a good start.

--Matt Jones
Reply all
Reply to author
Forward
0 new messages