# Java: popup & print on click ?

**URL:** https://boards.straightdope.com/t/java-popup-print-on-click/188218
**Category:** Factual Questions
**Created:** [July 13, 2003, 7:48pm UTC](https://boards.straightdope.com/t/java-popup-print-on-click/188218 "2003-07-13T19:48:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![daniel801](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@daniel801](https://boards.straightdope.com/u/daniel801)
#### Post date: [July 13, 2003, 7:48pm UTC](https://boards.straightdope.com/t/java-popup-print-on-click/188218/1 "2003-07-13T19:48:37Z")

</div>

Java script gurus, what code do I use so that when someone clicks on a picture, a popup opens, showing the same pictue but with a greater heighth and width set, then automatically the print dialog box opens for the popup window?

Thanks!

---

<div class="post-metadata">

### Author: ![Nanoda](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Nanoda](https://boards.straightdope.com/u/Nanoda)
#### Post date: [July 13, 2003, 9:49pm UTC](https://boards.straightdope.com/t/java-popup-print-on-click/188218/2 "2003-07-13T21:49:49Z")

</div>

You can probably use [this](http://www.javascript-page.com/printpage.html) or [this.](http://javascript.internet.com/messages/print-page.html)

I’d just make a link to a regular html page with the only content being the larger image, with the javascript being run onLoad. (Although you may want to make sure the [image is loaded](http://www.faqts.com/knowledge_base/view.phtml/aid/848/fid/122) before you print.)
