print-dom
Lightweight and fast print tool for browser.
Demo
Advantages
- Simple API.
- Small bundle size: 3.8KB (1.54KB gzipped).
- No dependencies.
- Faster than print-js
Installation
npm i print-dom -S # OR yarn add print-dom -S
Usage
; ;
with options
; ;
Options
Property | Description | Type | Default |
---|---|---|---|
noPrint | Ignore list when printing. | String[] |
[".no-print"] |
documentTitle | Print page's title. | String |
Parent page's title. |
style | Custom style. | String |
void |
wrapClass | Print element's className. | String |
void |
processor | Process the DOM before print. | (el: HTMLElement) => HTMLElement |
void |
onPrintDialogClose | Run when the browser print dialog is closed. | () => void |
void |
Build
yarn build
Todo
- Add test files.
License
MIT © zh-rocco