forked from jasonday/printThis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
54 lines (44 loc) · 1.8 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#printThis
Printing plug-in for jQuery
## Features
* Print specific & multiple DOM elements
* Preserve page CSS/styling
** or add new CSS; the world is your oyster!
* Preserve form entries
### Non-features
really 'Issues'
* canvas/svg elements such as map routes are not preserved
## Usage
### Basic
```javascript
$('selector').printThis();
```
### Advanced
$('#kitty-one, #kitty-two, #kitty-three').printThis({
importCSS: false,
loadCSS: "",
header: "<h1>Look at all of my kitties!</h1>"
});
### All Options
```javascript
$("#mySelector").printThis({
debug: false, * show the iframe for debugging
importCSS: true, * import page CSS
importStyle: false, * import style tags
printContainer: true, * grab outer container as well as the contents of the selector
loadCSS: "path/to/my.css", * path to additional css file - us an array [] for multiple
pageTitle: "", * add title to print page
removeInline: false, * remove all inline styles from print elements
printDelay: 333, * variable print delay; depending on complexity a higher value may be necessary
header: null, * prefix to html
formValues: true * preserve input/form values
});
```
## Please read
* "It's not working" without any details is not a valid issue and will be closed
* A url, or html file, is neccessary to debug. Due to the complexities of printing and this plugin, an example is the best way to debug
* When troubleshooting, set `debug: true` and inspect the iframe
* Every user should be active in the debugging process
## ToDo:
* Look at more efficient form field value persist
* Look at alternative to setTimeout ($.deferred?)