Prints web pages into multipage pdf file
npm install react-pdf-printreact-pdf-print
----
This component prints web page into multipage pdf file
Install the component with Npm
``sh`
$ npm i react-pdf-print`
or Yarnsh`
$ yarn add react-pdf-print
sh
$ npx create-react-app example
`
then include your divs into the Printer component. To print the page you must to call the print() method that expects an array of ids as param. In this first beta release you must to specify the div dimension in order to print A4 document.
`
import React, { Component } from 'react';
import Printer, { print } from 'react-pdf-print'const ids = ['1']
class App extends Component{
render() {
return (
Hello World!
onClick={() => print(ids)} value='Stampa' />
)
}
}export default App
``- Multiple pages dimensions (A0, A1, A2, A3, ...)
License
----
MIT
Authors
----