Forum: Ruby on Rails set printer on

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4eb2bceeeaa36189d452ef4111765c98?d=identicon&s=25 rails suheimi (Guest)
on 2006-05-27 18:57
(Received via mailing list)
hi all, I'm newbie on ror. My question is:
how could I set the printer on. The logic is as follow:

set printer on

  my print stmt to printer

set printer off

thx
A4a8fefcbd2cd6d2370609a5e2a3a389?d=identicon&s=25 Rob Merrell (Guest)
on 2006-05-27 19:22
(Received via mailing list)
If I understand you right you want to be able to access somebodies
printer
remotely from your rails application?  As far as I know that can't be
done,
just image how bad banner ads would be if any web page could control
your
printer...

Rob
D5145c421cd25af6fa577c15219add90?d=identicon&s=25 unknown (Guest)
on 2006-05-27 19:46
(Received via mailing list)
You can bring up the printer prompt on the users computer, but I
wouldn't, except maybe on a specific print friendly page which people
will only go to if they want to print, because the users will just get
annoyed at you otherwise.

<body onload="print()">

-N
4eb2bceeeaa36189d452ef4111765c98?d=identicon&s=25 rails suheimi (Guest)
on 2006-05-30 02:43
(Received via mailing list)
how about to local printer ? Say, to usb port or parallel port ? Can
it be done ?
What I'm trying to do is to print the invoice from rails apps.

thx guys
B1102f65359ee629df508c7857f03b1c?d=identicon&s=25 Phillip Hutchings (Guest)
on 2006-05-30 03:31
(Received via mailing list)
On 5/30/06, rails suheimi <rails.suheimi@gmail.com> wrote:
> how about to local printer ? Say, to usb port or parallel port ? Can
> it be done ?
> What I'm trying to do is to print the invoice from rails apps.
>
> thx guys

If you're running on Linux you can create a PDF and send it through
lp, though that requires a printing system that can read PDFs - CUPS
can.
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (Guest)
on 2006-05-30 03:32
(Received via mailing list)
just create a link/button with onclick="window.print()".  ex:

<a href="#" onclick="window.print()">Click Me To Print This Page</a>

this will open the print dialog of your browser and allow you to print
to
the current page.  of course, the user will have to have javascript
turned
on in the browser for this to work.

now, if you want to do printing directly to a networked printer from the
server, that's a different topic altogether.

Chris
This topic is locked and can not be replied to.