[thelist] Big diagram on webpage, Javascript to print?

Rob Smith rob.smith at THERMON.com
Fri Feb 6 11:18:55 CST 2004


We had a similar problem here with our organizational charts. Sometimes
these would be around 800-900 pixels wide. Too far some browsers, definitely
too far for your typical A4. The only way to print these out was to change
the orientation of the page, just before you print this out. Unacceptable.

My solution was two links below the large viewable image. "Printer Friendly
| Normal Size"

The links behind them were this:
Printer Friendly - <a href="mypage.asp?width=400">
Normal size - <a href="mypage.asp">

The image tag was this:
<img src="myImage.gif" <% if request.querystring("width") <> "" then
response.write " width=" & request.querystring("width") %>

... this automatically adjusted the height correctly as well. 

It's still a sloppy, but effective. The images print, but some are seen best
with a magnifying glass. :-\

Cheers,

Rob


More information about the thelist mailing list