A demonstration project to show how to make a custom PDF viewer application with React and Mozilla's PDF.js project.
Extra features include a customized search representation with snippet display of matches.
- Clone the repo
yarn install
to install the dependenciesyarn start
to start in dev mode
Use a query parameter &file=https://path/to/document.pdf
if you want a specific file to load.
Missing parameter will use the default Mozilla Tracemonkey PDF.
- Application is not very performant because of unnecessary re-rendering occuring with PDF document and search panel. Fix implementation would require adding
shouldComponentUpdate
and listening for state - PDF search is based on the actual non-rendered text from the document. Sometimes words in match snippets will be missing spaces
- Cannot jump to a specific match and highlight just that match