HighDots Forums  

print this page link

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss print this page link in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
arizona
 
Posts: n/a

Default print this page link - 07-16-2004 , 05:26 PM






Hi, I am trying to make a printer friendly version with a 'print this page'
text link. So far I have found none of them work on the macintosh. Does
anyone know of what I can do to make it work? here are the three I have
tried so far...

1. <A HREF="#" onClick="window.print();return false">Print this Page</A>

2. <a href="javascriptrint()">Print This Page</a>

3. adding this to the head of the document
<script>
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
</script>

then the link is: <a href="javascriptrint_page()">Print this</a>

Number three at least got a result, but not the one intended...I got an
Internet Explorer Script Alert 'Select "Print" from the menu"

I am on OS 9.2.2, IE 5.1.7

It isn't that the mac users won't automatically know to go to the print
menu, but I would like to know if there is a print this page link that works
cross browser/os systems...

tia
Barbara


Reply With Quote
  #2  
Old   
Alan
 
Posts: n/a

Default Re: print this page link - 07-16-2004 , 05:38 PM








Quote:
Hi, I am trying to make a printer friendly version with a 'print this page'
text link. So far I have found none of them work on the macintosh.
Js doesn't have access to a print command on macintosh afaik.

you could sniff for platform and put an escape to an Alert in the function-
"Please use the Print button in your Browser's Menu"

or put the entire function inside of a platform sniffer so it doesn't even
put the Print this Page link on the page if it's a mac.

If it's a popup window with no toolbar so windows users don't see a print
button on the browser window- Mac users will still have access to the
browser's menu to File-->Print



Reply With Quote
  #3  
Old   
arizona
 
Posts: n/a

Default Re: print this page link - 07-16-2004 , 05:41 PM



Seems like too much work when the user just needs to go to their browser
window and click the print button. So, thanks for the info, I will just add

"Please use the Print button in your Browser's Menu"

Quote:

Hi, I am trying to make a printer friendly version with a 'print this page'
text link. So far I have found none of them work on the macintosh.
Js doesn't have access to a print command on macintosh afaik.

you could sniff for platform and put an escape to an Alert in the function-
"Please use the Print button in your Browser's Menu"

or put the entire function inside of a platform sniffer so it doesn't even
put the Print this Page link on the page if it's a mac.

If it's a popup window with no toolbar so windows users don't see a print
button on the browser window- Mac users will still have access to the
browser's menu to File-->Print



Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: print this page link - 07-16-2004 , 10:19 PM



That's the intended result of that script for Mac users.

You cannot trigger a programmatic print in IE5/Mac.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"arizona" <tangled (AT) mAsAn (DOT) com> wrote

Quote:
Hi, I am trying to make a printer friendly version with a 'print this
page'
text link. So far I have found none of them work on the macintosh. Does
anyone know of what I can do to make it work? here are the three I have
tried so far...

1. <A HREF="#" onClick="window.print();return false">Print this Page</A

2. <a href="javascriptrint()">Print This Page</a

3. adding this to the head of the document
script
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
/script

then the link is: <a href="javascriptrint_page()">Print this</a

Number three at least got a result, but not the one intended...I got an
Internet Explorer Script Alert 'Select "Print" from the menu"

I am on OS 9.2.2, IE 5.1.7

It isn't that the mac users won't automatically know to go to the print
menu, but I would like to know if there is a print this page link that
works
cross browser/os systems...

tia
Barbara




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.