Skip to content

dompuiu/jquery-page-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

jQuery Page Print

This plugin shows a print preview of the current page in a modal window. It's inspired from the jQuery Print Preview plugin.

The plugin also tries to capture the "CTRL + P" and "Command + P" keybindings. The modal window is shown when you press the keys for the first time. Pressing the keys while the modal is opened will open the print window of the browser. Unlike traditional print previews this plugin brings in all content and print styles within a modal window.

The icons used in the plugin were taken from the FatCow Web Hosting Icon Set.

How To Use

In order to use this plugin you must insert into the page the followings:

  • The jQuery script file;
  • The plugin file;
  • The plugin dependencies: CSS file and sprite image.

You can initialize the plugin by calling pagePrint function on any jQuery collection.

Example:
$('<a href="#">Print this page</a>').prependTo('body').css({position: 'absolute', top: 0}).pagePrint();.

Demo:
You can see a demo here.

Config Options

The following config options can be sent when calling the plugin:

  • backgroundColor: the background color of the opened modal window (default: '#fff');
  • baseCls: the base CSS class to apply to this widget elements (default: 'page-print');
  • destroyOnHide: clean the DOM of the created elements and events (default: false);
  • opacity: opacity of the modal window mask (default: 0.75);
  • paperMargin: the paper margin (default: '1cm');
  • paperWidth: the paper width (default: '19cm');
  • zIndex: z-index of the modal window and mask (default: 10000);

Supported Browsers

  • Internet Explorer 7, 8 and 9
  • Google Chrome
  • Firefox
  • Opera

License

Licensed under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published