San Pyae Lin/React Html to Pdf

Created Thu, 21 Feb 2019 00:00:00 +0000 Modified Mon, 11 Jan 2021 03:58:33 +0000
54 Words

React Html to Pdf

Covert html to pdf & print

Live demo: react-html2pdf

Install package

$ npm i react-html2pdf

Usage

//import
import { Preview, print } from 'react-html2pdf';

//render
<Preview id={'jsx-template'} >
    <p>adsf</p>
</Preview>
<button onClick={()=>print('a', 'jsx-template')}> print</button>

Example

Check full example in the example folder.

License

MIT License. © 2018 San Pyae Lin

comments powered by Disqus