Reputation: 7952
I have an html page with a link like this:
<a href="javascript:window.print()">Print QR code</a>
When a user clicks it, it does what you think it will.. prints the whole page.. sadly, it does not print the QR code at all. How do I specify what I want to print? Like, lets say I want to print a specific image on the page?
Upvotes: 0
Views: 19640
Reputation: 477
I know this is an old post, but just wanted to share you this solution that worked very well without using jquery.
http://www.codescratcher.com/javascript/print-image-using-javascript/#comment-762
Upvotes: 2
Reputation: 7952
I found this plugin that does the trick:
http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/
$('img#some_id').printElement();
Upvotes: 1