Skip to content

jQuery.printElement Options

erikzaadi edited this page Sep 13, 2010 · 2 revisions

jQuery Print Element Options:

printMode

Type:String
Default:‘iframe’
Description:
Sets wether the plugins behavior is to open a popup of the element to print before
printing, or to create a hidden iframe.
Possible values: ‘iframe’ | ‘popup’

Examples

Example
$("selector").printElement({printMode:'popup'});

pageTitle

Type:String
Default:’’
Description:Print Page Title (name of the file sent to the printer)

Examples

Example
$("selector").printElement({pageTitle:'thisWillBeTheNameInThePrintersLog.html'});

overrideElementCSS

Type:Array
Default:null
Description:array of paths to alternate css files (optimized for print)

Examples

Example
$("selector").printElement({overrideElementCSS:['thisWillBeTheCSSUsed.css','thisWillBeTheCSSUsedAsWell.css']});

printBodyOptions

Type:Object
Default:
{styleToAdd: ‘padding:10px;margin:10px;’, classNameToAdd: ’’}
Description:
Contains:
<br/>
<strong>styleToAdd : </strong>style attributes to add to the body of print document
<br/>
<strong>classNameToAdd : css class to add to the body of print document</strong>

Examples

Example
$("selector").printElement({printBodyOptions:{styleToAdd:'padding:10px;margin:10px;color:#FFFFFF !important;',classNameToAdd : 'thisWillBeTheClassUsedAsWell'}});

leaveOpen

Type:Boolean
Default:false
Description:in case of popup, determines if the print page will remain open or not

Examples

Example
$("selector").printElement({leaveOpen:true,printMode:'popup'});

iframeElementOptions

Type:Object
Default:
{styleToAdd: ‘position:absolute;width:0px;height:0px;’,classNameToAdd: ’’}
Description:
Contains:
<br/>
<strong>styleToAdd : </strong>style attributes to add to the iframe element
<br/>
<strong>classNameToAdd : css class to add to the iframe element</strong>

Examples

Example
$("selector").printElement({iframeElementOptions:{styleToAdd:'position:absolute;width:0px;height:0px;bottom:0px;',classNameToAdd : 'thisWillBeTheClassUsedAsWell'}});
Clone this wiki locally