PHILADELPHIA REFLECTIONS
The musings of a Philadelphia Physician who has served the community for nearly six decades

Related Topics

Website Development
The website technology supporting Philadelphia Reflections is PHP, MySQL and DHTML. The web hosting service is Internet Planners.

Computers and Websites
Much of the early development of the electronic computer took place in Philadelphia. We lost the lead, but it might return.

Right Angle Club 2007
A report, to the year 2007 shareholders of the Right Angle Club of Philadelphia, by their outgoing president.

Webpage Printing

This site offers a Print button for all Reflections and Topics. Formatting the text on the pages to print nicely works quite well; how to specify what to do with images remains a bit unclear (as of August 2006).

The "trick", if it can be called that, to special print formatting is the media attribute for CSS styling. The main stylesheet for this website is called in a LINK statement as follows:

<link rel="stylesheet" type="text/css" media="all" href="stylesheets/reflectionsLayout.css">

The media attribute tells the browser to use this sylesheet for all media types, i.e., for screens and printers. In the pages that are formattted to print is a stylesheet that cascades below the main stylesheet and therefore supercedes it. This stylesheet controls the printing.

The specification of

<body onload="window.print()"> (all lower case for XHTML purposes)

is what forces the print dialog to appear.

The remaining problem is how to specify CSS formatting for images so that text flows around them as we want. The formatting seems to work on screen for all browsers but only on some browsers for printing.


<style type="text/css" media="print">

/*
	Style Sheet to print Philadelphia Reflections
*/


body			{
				margin:		0;
				padding:	0;
				width:		100%;
				}				
				

#wrapper		{
				margin:		0;
				padding:	0;
				width:		100%;
				}
		
		
#center			{
				margin-top:		0;
				margin-bottom:	0;
				margin-right:	0;
				margin-left:	0;
				padding:		0;
				}


				
#content		{
				font-size:120%;
				}
				
</style>


(my thanks to http://centricle.com/tools/html-entities/ for HTML encoding)

(1120)

Please enter your comments here

Name

Comments

captcha image