Joy Of  Code - Web Design Training and Consulting
Joy Gems Newsletter

PDFs Are Web Pollution

By Bud Kraus
bud@joyofcode.com
Joy Of Code
Creator And Instructor

v4 i2
Originally Published: January 24, 2008

I don't know about you, but when I do a search on the web that leads me to a PDF file, I feel cheated. I think PDFs needlessly clog up the web.

No doubt you are familiar with Acrobat, the Adobe product which transforms most document types - such as Word for Windows - into a locked design, easy to transmit across the net. PDF, or Portable Document Format, is what Acrobat generates.

Need to ensure that what you see is pretty much going to be exactly what your recipient will see? Want to make sure that the document can't be altered and can be printed as designed? PDF is the way to go.

So I have no beef with what PDF is designed to do. My problem is that it's an ersatz web page. It breaks all the customs and benefits of the hypermedia world because it's not hypermedia. It breaks the weave of the web.

You wouldn't dream of putting word documents on the web would you? The arguments not to use PDFs are much the same.

Ever tried clicking on a link in a PDF? Of course not. You can't. PDFs are dead ends. You can't go forward or backward.

So why do people put PDFs online? Usually it's because they don't know how to make web pages (I can certainly fix that) and thus may be unwittingly doing their small part to ruin the web.

In designing my new site I'm doing all that I can to almost eliminate the use of PDFs. Here are a two things you can do to remove the scourge of web pollution by reducing the use of PDFs online.

1. Convert your PDFs to web pages.

Admittedly this isn't a fabulously elegant solution, but Acrobat has an exporting tool which allows content creators to convert PDFs into webpages. My version of Acrobat allows me to convert PDFs with varying degrees of success into HTML 4.01 and CSS 1.0.

A better idea would be to convert the source document itself from which the PDF was created into a webpage, but that is not always possible since you may not always have access to the source document.

2. Use the Print Specs of Cascading Style Sheets

With CSS you can specify how you would like your page to be printed. Not only does this eliminate the need to create a PDF, it also removes the need to make a "Print Friendly" page. Your page will be print friendly, but you won't have to tell the user to click on a link for a special page that prints well.

For example, you might like to remove the navigation element of a web page since there's no reason to print it (can't click on paper - yet).

First, create a link to an external CSS file that will include all of your print specifications. The link will look something like this:

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

media="print" tells the browser to use the CSS print specifications when the user prints the page.

Next, say you have flagged (with the id attribute) your navigation element like this:

<ul id="nav">
<li><a href="a.html">
link a</a></li>
<li><a href="b.html">
link b</a></li>
<li><a href="c.html">
link c</a></li>
</ul>

Then, in your print.css file write the following style rule:

#nav
{display:none;}

Doing this means that your navigation will not print. Very nice!!

There's much more to what can be done with the print specifications of CSS. If you have any questions about this feel free to email me or join the Call-In on Monday, January 28, at Noon EST.

Make sure to see Eric Meyer's article "CSS Design: Going To Print."

Better yet, these are the kinds of things I cover in my Great Web Design With CSS Workshops (see above box for classes at Pratt Institute and FIT in New York City).


I'm not suggesting that you convert all your legacy PDFs into the (X)HTML format. For most businesses and organizations that would be an expensive proposition. I'd just like to see people use the best document format for a given purpose. And when it comes to the web, it's going to be (X)HTML.