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?
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.
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.
aspx will contain the controls to be printed. Print. aspx will act as a popup page to invoke the print functionality.
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" />
Our gracious host wrote a good blog post on this topic:
Coding Horror: Stylesheets for Print and Handheld
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With