SkyRanger Posted January 31, 2008 Share Posted January 31, 2008 I am trying to figure out if there is a way to print an image from a link instead of printing the page you are on, I have this part figured out for the print page: <a title=" Print this page" href=" #" onClick=" window.print()" >Print this page</a> Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 31, 2008 Share Posted January 31, 2008 try this: <script language="javascript"> function printpic() { var picture = window.open("http://www.google.com/intl/en_ALL/images/logo.gif"); picture.print(); } </script> <a href="javascript:void(0)" onclick="printpic()">Print It!</a> Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted February 1, 2008 Author Share Posted February 1, 2008 Thanks phpQuestioner, works perfectly for the single image on the page to print. Now I just have to figure out how to be able to do that for all of the images that are on the page. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted February 1, 2008 Share Posted February 1, 2008 So I am assuming that these images you want to print are in one page - right? Why don't you just create a css style sheet for print media and set-up your css for this stylesheet to hide everything on the page, except for your images? Then just add a window.print() onclick event to a button. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.