Skip to content

rspack setup to generate PDFs in the Browser with @react-pdf/renderer

Notifications You must be signed in to change notification settings

tobua/rspack-react-pdf

Repository files navigation

rspack-react-pdf

rspack-react-pdf

rspack setup using @react-pdf/renderer (^3.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.

Note

This setup still uses the Rspack CLI. Rspack recently released a wrapper called Rsbuild which might be easier to use.

Installation & Usage

After cloning this repository run the following commands

npm install
npm start

Browser Support

Tested with recent versions of Chrome, Safari, Firefox and their mobile counterparts.

About

rspack setup to generate PDFs in the Browser with @react-pdf/renderer

Resources

Stars

Watchers

Forks