webpack
setup using @react-pdf/renderer
(^2.0.0
) to generate and display PDF
documents in the browser.
- Images
- Fonts
- Async Loaded Fonts
- Table
- Download Link
- Chart
Check out the Demo
Includes an example of how Charts rendered with
React (recharts
) can be "screenshotted" and inserted into the PDF as images.
After cloning this repository run the following commands
npm install
npm start
Since PDF rendering usually happens on the server side with node. The following node built in dependencies have to be polyfilled.
stream
withstream-browserify
zlib
withbrowserify-zlib
crypto
withcrypto-browserify
Optional
Tested with recent versions of Chrome, Safari, Firefox and their mobile counterparts.