https://github.com/ajainvivek/tiny-print
🖨️ Tiny print is a tiny javascript library to help printing HTML element.
https://github.com/ajainvivek/tiny-print
html print-html print-js tiny-print
Last synced: 4 months ago
JSON representation
🖨️ Tiny print is a tiny javascript library to help printing HTML element.
- Host: GitHub
- URL: https://github.com/ajainvivek/tiny-print
- Owner: ajainvivek
- Created: 2019-11-14T05:35:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T00:52:08.000Z (over 3 years ago)
- Last Synced: 2025-10-08T19:19:38.379Z (8 months ago)
- Topics: html, print-html, print-js, tiny-print
- Language: JavaScript
- Homepage: https://tiny-print.netlify.com/
- Size: 2.16 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
A tiny javascript print library (less than 1kb) to help printing targeted HTML element.
## Installation
TinyPrint is available as an [npm package](https://www.npmjs.com/package/tiny-print).
```sh
npm install tiny-print --save
```
## Usage
```js
import tinyPrint from "tiny-print";
tinyPrint(element, {
scanStyles: BOOLEAN, // Default: true, scans computed styles from dom for that specific node, recommended for fixed height/width
scanHTML: BOOLEAN, // Default: false, scans styles and links from current html page, disable scanStyles if scanHTML is enabled
importStyles: ARRAY, // Default: [], imports external stylesheet eg: https://cdn.com/style.css
cssStyle: STRING, // Default: '', custom css styles eg; `.title { font-size: 14px; }`
hidePageRule: BOOLEAN // Default: false, hide print page rule i.e page title, footer etc
});
```
## Demo
Please refer the [DEMO](https://tiny-print.netlify.com).
## Contributing
We'd greatly appreciate any contribution you make. :D
## License
This project is licensed under the terms of the
[MIT license](https://github.com/ajainvivek/tiny-print/blob/v1-beta/LICENSE).