Use JavaScript to Print an Image

UPDATE: This article is no longer supported and is NOT guaranteed to work.

Using JavaScript you can have images print when clicked on. What this script will do for you is open whatever image is specified in the JavaScript in a new browser window along with the Print options window.

This method is useful if you are looking for a way to have either a print button for a specific image on a page. Please refer to the demo to see exactly how this can be accomplished. Remember to specify the image’s width and height in the JavaScript onClick event.

If you want to see the demo please click through and we’ll show you how to use JavaScript to print images by clicking a link.

Demo JavaScript Print Image Button:

Print this Fluffy Kitten by Clicking Below
Click to Print the Image Above