Skip to main content

Printing the Web: Solutions and Techniques

Users don’t read, they scan. In fact, after many years, reading online still didn’t manage to assert itself against reading offline. Therefore long articles are usually printed out and read on paper. However, not every page will be printed out correctly by default - sometimes layout doesn’t fit, sometimes font size isn’t chosen properly or leading simply isn’t big enough. It is also important to include some further references to the printed version of the page, so users can get back to you, once they’ve read the printed version of your article.
Good news: web-developers can control the way web-site looks on the paper.To make sure that no data will lost and the legibility of content remains optimal after the printing, you can, of course, use CSS.
There are many options and techniques you can use developing print layouts. Here is a quick overview of some interesting solutions you can use to generate print layouts “on the fly”.
Printing the Web: CSS-Techniques
Five Simple Steps to Typesetting on the web: Printing the webMike Boulton gives an example on how to design a nice print layout, which looks like print layout in traditional magazines.
Footnote Links: Improving Link Display for PrintAaron Gustafson presents a CSS+JavaScript-based method, which replaces all links on a page with corresponding footnotes. Elegant and extremely (!) useful solution.
10 Minutes to Printer-Friendly PagePrint-layouts can be generated with PHP. Marko Dugonjic shows, how.
From Screen to Print: Creating a Print CSS in DreamweaverThis article will examine how our layout displays one set of elements on the screen, yet when printed, prints a different layout using elements that do not display on screen.You’ll learn about media types and how to take advantage of them and using the cascade to create lightweight, compact pages for print. Since Community MX constantly tweaks its site, some things may be slightly different if you read this article a few months from its publishing date.
A Print CSS PrimerA detailted introduction and tutorial by Kenji Ross.
Print DifferentQuite an old article by Eric Mayer, in which he describes different media types you should consider designing print layouts.
ALA’s New Print StylesEric Meyer about A List Apart Print-Layout. The article is a “follow-up” of the article CSS Design: Going to Print, which was published in ALA 2002.”Say no to “printer-friendly” versions and yes to printer-specific style sheets. CSS expert Eric Meyer shows how to conceive and design print style sheets that automatically format web content for off-screen delivery. Includes tips on hiding inappropriate content, styling text for the printer, and displaying the URL of every link on the page.”
CSS Styling for Print and Other MediaIan Lloyd about the media-attribute and development of user-friendly print layouts.”There are many different media types that you can apply to CSS, some of which are more useful than others, and they let you specify the look, feel, or sound of the web page that is linked to the CSS files. In this section, we’ll look at the various media types that are available.”
Complete CSS Guide: PrintingIn CSS2, the page properties are defined by the @page rule, while several new properties help control page breaking. John Allsopp explains in detail, which guidelines you should keep in mind designing print layouts and how you use @page-rules such as page-break-before, Widows, Orphans etc. efficiently.
Printing The WebJames Kalbach describes common mistakes and discusses important aspects of print layouts regarding usability.”Consider how users interact with other formats and media, particularly paper, and address the reality that people print web pages. With a little planning and foresight creating printable pages is relatively easy and extends a positive user experience to paper.”
Dive Into Mark Print-friendly Linksworks just the way Footnote Links work, but also adds the URLs of Links in the brackets after the links.
Print-Friendly CSS and UsabilityRoger Johansson discusses, whether print layouts, which are different from the page structure, are user-friendly. Themaninblue’s post on the same topic.
Print to PreviewPete McVicar’s JavaScript creates a preview page with a warning message users can use to navigate back to the original page.
Printing Web documents and CSSJim Wilkinson explains, what print layouts should have, (e.g. the URL of the original web-page), which elements should be removed (e.g. navigation) and what how you should handle links, footers and headers. Also problems in different browsers are taken into consideration.”This document describes some of the issues concerning the use of CSS to reformat Web documents for printing (using the media type “print”). We also discuss those aspects that CSS is not able to control or even influence. We assume a good knowledge of CSS and concentrate on practical issues, given the current deficiencies in browsers in implementing print-related CSS.”

Comments

Popular posts from this blog

REST / AJAX calls from within a Jaggery script

<% var mySecureToken = FnMakeRequestCall("https://10.299.99.99:8245/token","POST","Basic RlN4S2RrZEpNN3VaYWhHN0NFcEtlaTZEa3RzYTpXbmUxd29seHp2UTNSQ2RZbXhUUTJ2WkJTd0Fh","application/x-www-form-urlencoded; charset=UTF-8",""application/json; charset=utf-8","grant_type=password&username=pcsadmin&password=pcsadmin");  print(mySecureToken); function FnMakeRequestCall(URL, METHOD, BASICAUTH, CONTENTTYPE, ACCEPTTYPE, INPUTDATA){ if(BASICAUTH){ //var VarBasicAuthCode = util.FnCreateBasicAuthentication(VARSKYSPARKUSERNAME,VARSKYSPARKPASSWORD); var VarBasicAuthCode = session.get('authToken'); } xhr = new XMLHttpRequest(); xhr.open(METHOD, URL); if(BASICAUTH){ xhr.setRequestHeader("Authorization" , VarBasicAuthCode); } xhr.setRequestHeader("Content-Type", CONTENTTYPE); xhr.setRequestHeader("Accept", ACCEPTTYPE); xhr.send(INPUTDATA); var VarRes

CSS Browser detection using jQuery instead of hacks

Browser sniffing is messy. There are a million ways to do it but none of them are particularly clean and most involve conditional statements such as "<!--[if condition]> HTML <![endif]-->" for IE and various other CSS selector hacks for other browsers. I've done a fair amount of browser sniffing with jQuery recently and it's really easy, useful for when you need to detect the browser and version number in your javascript. It occurred to me that it would be easy to detect the browser and then put something in the DOM that your CSS could use for conditional formatting. So I wrote a quick script in JavaScript/jQuery. How it works:   All you have to do is include the JavaScript file in the head of the page and it'll attach 2 classes to your body tag to say what browser and what version is being used so you've got 2 levels of granularity. Possible values are... .browserIE .browserIE6 .browserIE7 .browserIE8 .browserChrome .browserChrome1 .browse

MySQL table and want to build a XML file with it in order to make a RSS feed.

<? php $dom = new DOMDocument() ; include "connection. php "; $queryz = "SELECT * FROM ticker"; $resultz = mysql_query($queryz) or die('Error, query failed'); $row = mysql_fetch_assoc($resultz); $ rss = $dom->createElement(' rss '); while($row = mysql_fetch_array( $resultz )) { $item = $dom->createElement("item"); $item->appendChild($dom->createElement("title", $row['item_title'])); $item->appendChild($dom->createElement("pubDate",$row['item_pubDate'])); $item->appendChild($dom->createElement("description",$row['item_description'])); $item->appendChild($dom->createElement("link",$row['item_link'])); $ rss ->appendChild($item); } $dom->appendChild($ rss ); $dom->save("myxml.xml"); OR <?php header('Content-Type: text/xml; charset=UTF-8'); $dom = new DOMDocument() ;