Print Specified Area Of A Page - PrintArea

File Size: 293 KB
Views Total: 79083
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Print Specified Area Of A Page - PrintArea

PrintArea is a jQuery Plugin that allows your visitors to a specific area of the page. The printed area is either opened in a popup or in a hidden iframe by using json settings.

How to use it:

1. Include jQuery library and PrintArea.js

<script src="jquery-1.9.0.js" type="text/JavaScript" language="javascript"></script>
<script src="jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>

2. Markup

<div id="print_button">Print</div>
<div class="PrintArea">
Contents
</div>

3. Call the plugin

<script>
    $("div#print_button").click(function(){
    $("div.PrintArea").printArea( [OPTIONS] );
});
</script>

4. Call the plugin

<script>
    $("div#print_button").click(function(){
    $("div.PrintArea").printArea( [OPTIONS] );
});
</script>

5. Options

mode:"iframe","popup"  //printable window is either iframe or browser popup
popHt: 500   // popup window height
popWd: 400  // popup window width
popX: 500   // popup window screen X position
popY: 600  //popup window screen Y position
popTitle: // popup window title element
popClose: false,true  // popup window close after printing
strict: undefined,true,false // strict or looseTransitional html 4.01 document standard or undefined to not include at all only for popup option

Change logs:

v2.4.1 (2014-11-13)

  • Fix issue

v2.4.0 (2014-03-26)

  • Fix issue

v2.3.3 (2013-11-23)

  • Fixed: Chrome not rendering and Printing in Popup correctly

v2.3.2 (2013-10-23)

  • Corrected for loop

This awesome jQuery plugin is developed by RitsC. For more Advanced Usages, please check the demo page or visit the official website.