Project Management

Quick Tip: Setting options to print web documents

Ryan Boudreaux addresses the issue of setting options via CSS that allows users to print documents from the web. He provides some resources to help you find a web printing solution.

How many times do you visit an organization's web on the Internet and find it a daunting experience to print out the content? There are many browser tools available that allow the viewer to print web content, but is it really meaningful? Don't you want to control how your web content gets printed, and not let the browser or user make that decision for you?

Do you get around this issue with your own print style sheets, printing widgets, add-ins, or third-party printing web applications? Or is your organization not offering options to print from the web, maybe as a way of making a "green" statement; on the other hand, many folks do not print out web pages at all and this is not an issue.

Considerations for web print options are determined by exactly what content you or your organization wants the browser or user agent to print. Will navigation be included in the print? Typically it is not, but how many times have you printed out a web page from the user agent only to find the top inch or two on the paper is the linking and navigation? Most times the navigation is not very useful information in print form! And what about background images and background colors? The viewer would much appreciate not having to use up a large amount of color ink for unnecessary backgrounds; they just want to read the content, or look at an image. Backgrounds are great on web pages, but when printed, the text is often unreadable. Then you have to think about the text colors, font sizes, content print area sizing, and comments. There are many factors to take into account when developing your web printing strategy.

In my experience, I end up copying the textual and image content that I want to print out, and pasting it into a text file or word processing document and print it from there. This way I can control my own formatting and then save the document if needed for later printing, but most folks do not want to spend the time doing this sort of chore.

There is really no one-size-fits-all solution to creating a print option when it comes to web development. The user experience can vary depending on the browser user agent and version when the page is viewed. The rules for print CSS can be quite buggy at times when purely defining the print specifications for a set of web documents. When going the CSS route for web printing, the simplest way is to declare it in the web documents to be printed, and it should be defined with code similar to this link element:

<link rel="stylesheet" type="text/css" media="print" href="print.css">

Of course, then you need to build out a print CSS to contain all the styles you define. Here are several sampled resources available for creating a web printing solution:

What solution does your organization use for printing from the web?

About

Ryan has performed in a broad range of technology support roles for electric-generation utilities, including nuclear power plants, and for the telecommunications industry. He has worked in web development for the restaurant industry and the Federal g...

1 comments
conchroti
conchroti

I use instapaper.com and send it directly to my kindle. It strips out everything except the content text and is free ...

Editor's Picks