# Output to Printer

**URL:** <https://www.ruby-forum.com/t/output-to-printer/164025>\
**Category:** Rails\
**Created:** [March 27, 2009, 1:04am UTC](https://www.ruby-forum.com/t/output-to-printer/164025 "2009-03-27T01:04:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eengnerd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/2acd7d/32.png) [@eengnerd](https://www.ruby-forum.com/u/eengnerd)\
**Post date:** [March 27, 2009, 1:04am UTC](https://www.ruby-forum.com/t/output-to-printer/164025/1 "2009-03-27T01:04:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eengnerd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/2acd7d/32.png) [@eengnerd](https://www.ruby-forum.com/u/eengnerd)\
**Post date:** [March 27, 2009, 1:24am UTC](https://www.ruby-forum.com/t/output-to-printer/164025/2 "2009-03-27T01:24:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![eengnerd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/2acd7d/32.png) [@eengnerd](https://www.ruby-forum.com/u/eengnerd)\
**Post date:** [March 31, 2009, 12:43am UTC](https://www.ruby-forum.com/t/output-to-printer/164025/3 "2009-03-31T00:43:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eengnerd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/2acd7d/32.png) [@eengnerd](https://www.ruby-forum.com/u/eengnerd)\
**Post date:** [April 1, 2009, 12:12am UTC](https://www.ruby-forum.com/t/output-to-printer/164025/4 "2009-04-01T00:12:01Z")

</div>

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
