npm.io
2.2.0 • Published 5 years ago

dom-printer

Licence
ISC
Version
2.2.0
Deps
0
Size
54 kB
Vulns
0
Weekly
0
Stars
1

Printer

npm browser

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 action
  • append(elem: Element | HTMLCollection | NodeList, clone: boolean = true) Append element
  • splitPage() Split page
  • clear() Clear content
  • destroy() Destroy printer instance

Keywords