Skip to content

sturtevant/pdfkit-react-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdfkit-react-example

This is a simple example of using PdfKit with React (bootstrapped with Create React App).

It is based on pdfkit-webpack-example.

Live preview here.

Notes

  • react-ace is used for the in-browser code editting.
  • customize-cra is used to modify the webpack configuration so that assets like fonts and images can be imported in all the ways found in pdfkit-webpack-example. These customizations can be found in config-overrides.js.
  • The initial PDF content code (makePDF function) has been moved into its own file (src/makePDF.js) so that it can be loaded separately and avoid having its formatting disrupted by Webpack/Babel.

To Use

The first time: in the project directory, run npm install.

Then run npm start to start the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.