AturSams
AturSams

Reputation: 7952

html jquery - print specific image in page

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

Answers (2)

ricardo_escovar
ricardo_escovar

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

AturSams
AturSams

Reputation: 7952

I found this plugin that does the trick:

http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/

$('img#some_id').printElement();

Upvotes: 1

Related Questions