Forum: Ruby on Rails Output to Printer

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.
8c0b00d9715d7d5d4792134599fe4232?d=identicon&s=25 eengnerd (Guest)
on 2009-03-27 01:04
(Received via mailing list)
It was very surprising to me to find out that there is no current,
GPL'ed "ruby-" package designed for outputting HTML / CSS pages to a
printer.  For reasons of principle, I won't use any add on modules for
ruby that are not GPL'ed.  Does anyone know of a package currently
under development that is at least reasonably close to such support?

Arthur
D93ae163042e0a937941e0ba4d8ed5d7?d=identicon&s=25 Eric (Guest)
on 2009-03-27 01:24
(Received via mailing list)
I'm not sure if I understand completely, but I would just render a
'printer_friendly' layout.

And you do know that Rails itself is not GPL, right?
8c0b00d9715d7d5d4792134599fe4232?d=identicon&s=25 eengnerd (Guest)
on 2009-03-31 00:43
(Received via mailing list)
I found THE solution for this problem and it is extremely simple.  In
the line:
<%= stylesheet_link_tag 'scaffold', 'TCO', :media => :all %>
all that was required was to add the part:
, :media => all
to the existing line.  This gives me a print out that matches the
screen.

Arthur
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-04-01 00:12
eengnerd wrote:
> I found THE solution for this problem and it is extremely simple.  In
> the line:
> <%= stylesheet_link_tag 'scaffold', 'TCO', :media => :all %>
> all that was required was to add the part:
> , :media => all
> to the existing line.  This gives me a print out that matches the
> screen.
>
> Arthur

generally is not a good practice to use the same CSS for screen and for
printer.

For printer is better to use a CSS that hide header , footer and menu
and flat down colors to simple grayscale for better laser printing
This topic is locked and can not be replied to.