View Full Version : Quick question on printing

03-23-2006, 08:41 PM
:( Having trouble getting graphics to print.( in both FF1.07 and IE6 )

I used the pie.js script from:

Am I missing something or doing something wrong.

ps I did try jg.setPrintable(true)


03-24-2006, 04:17 AM
PLEASE: Include the URL to your problematic webpage that you want help with.

03-24-2006, 04:34 AM
I just did a little experimentation and the printing can be enabled by finding this line in wz_jsgraphics.js:


and changing it to true. However, this makes the page look horrible in IE6. No problem in FF. Perhaps there is an update on the author's site. You could have a link to an identical page that simply uses a version of wz_jsgraphics.js with that set as true, explain that it is the printable version and that it will look strange in some browsers but print fine (even with the messed up screen, the print preview looked fine in IE).

03-24-2006, 04:25 PM
For IE, I just discovered that this will work:

<link rel="alternate" media="print" href="pieprint.htm">

Placed in the head, it can reference the alternate version that looks bad onscreen but prints well. That way IE can have the good looking version online but, when it comes time to print, get the version that works. Opera will print either version well. It only remains how to get the FF people over to the printer friendly version. There could be a link to the printer version that only shows in FF:

<script type="text/javascript">
if (!(document.all)&&!(window.opera))
document.write('<a href="pieprint.htm">Printer Friendly Version</a>')

03-24-2006, 05:31 PM
You can still try my above suggestion, it:

<link rel="alternate" media="print" href="pieprint.htm">

may work live but, it doesn't work locally. Here is an alternative scriptlet:

<script type="text/javascript">
if (!window.opera)
document.write('<a href="pieprint.htm" target="_blank">Printer Friendly Version</a><br>')

03-24-2006, 07:11 PM

Thanks for the info, I got it working by changing the setPrintable in wz_jsgraphics.js.

I was trying to do it from pie.js.

I'll also look at your other suggestion.

Thanks again.

03-24-2006, 10:28 PM
Well if the <link alternate= thing won't work, here is a good way to do it -

On your pie page have this script above all of the code for the pie chart:

<script type="text/javascript">
if (!window.opera&&this.location.search.indexOf('doprint')==-1)
document.write('<a href="pie.htm?doprint=true" target="_blank">Click for Printer Friendly Version</a><br>')
if (this.location.search.indexOf('doprint')>-1)

where pie.htm is the name of the page with your pie chart on it and then in wz_jsgraphics.js change:




That way you will not need any extra pages or script files.