Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to make a printer-friendly ASP.NET page?

Tags:

asp.net

I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables?

Is there one elegant solution that works for the majority of the cases?

like image 966
Bryant Hankins Avatar asked Sep 05 '08 19:09

Bryant Hankins


People also ask

How do I make my printer page friendly?

Use high contrast between your background and text. For maximum readability, using black text on a white background works best. Adjust font sizing improve readability. Text that might be easy to read on a computer screen is sometimes too small or too large when you're reading it from a printed page.

What is printer friendly page?

Printer-friendly pages are designed to fit on an 8.5"x11" or A4 sheet (see paper sizes) and include only the content (plain text and images) of the page, along with source information. Inline hyperlinks become ordinary text, links on the margins may or may not be shown.

Can ASPX be printed?

aspx will contain the controls to be printed. Print. aspx will act as a popup page to invoke the print functionality.


2 Answers

You basically make another CSS file that hide things or gives simpler "printer-friendly" style to things then add that with a media="print" so that it only applies to print media (when it is printed)

<link rel="stylesheet" type="text/css" media="print" href="print.css" />
like image 51
Ryan Farley Avatar answered Sep 28 '22 14:09

Ryan Farley


Our gracious host wrote a good blog post on this topic:

Coding Horror: Stylesheets for Print and Handheld

like image 45
Ian Nelson Avatar answered Sep 28 '22 14:09

Ian Nelson