Results 1 to 7 of 7

Thread: Quick question on printing

  1. #1
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Quick question on printing

    Having trouble getting graphics to print.( in both FF1.07 and IE6 )

    I used the pie.js script from:
    http://www.dynamicdrive.com/dynamicindex11/piegraph.htm

    Am I missing something or doing something wrong.

    ps I did try jg.setPrintable(true)

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I just did a little experimentation and the printing can be enabled by finding this line in wz_jsgraphics.js:

    Code:
    	this.setPrintable(false);
    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).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    For IE, I just discovered that this will work:

    HTML Code:
    <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:

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You can still try my above suggestion, it:

    Code:
    <link rel="alternate" media="print" href="pieprint.htm">
    may work live but, it doesn't work locally. Here is an alternative scriptlet:

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    jscheuer1

    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.

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <script type="text/javascript">
    doprint=false
    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)
    doprint=true
    </script>
    where pie.htm is the name of the page with your pie chart on it and then in wz_jsgraphics.js change:

    Code:
    	this.setPrintable(true);
    to:

    Code:
    	this.setPrintable(doprint);
    That way you will not need any extra pages or script files.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •