README
Printer
Printer for browsers.
Usage
import Printer from "dom-printer";
const p = new Printer();
p.append(document.getElementById('first-page'));
p.split();
p.append(document.getElementById('second-page'));
p.print();
Constructor Parameters
Name | Type | Attributes | Description |
---|---|---|---|
content | Element, HTMLCollection, NodeList | <optional> | Content for print |
importCSS | Boolean | <optional> | Import style of current page or not. The default is true |
style | String | <optional> | Custom style. The default is '' |
preview | Boolean | <optional> | Preview instead of print. The default is false |
Methods
print()
Print actionappend(elem: Element | HTMLCollection | NodeList, clone: boolean = true)
Append elementsplitPage()
Split pageclear()
Clear contentdestroy()
Destroy printer instance