How it works
react-pdf wraps Mozilla's PDF.js, the engine behind Firefox's built-in PDF viewer. A Document component loads a file from a URL or from data, and Page components render each page to a canvas, with optional text and annotation layers so text can be selected and links clicked. The PDF.js worker has to be configured so that parsing runs off the main thread.
It displays PDFs; it does not create them, and its similar name often causes confusion with @react-pdf/renderer, which generates PDFs from React components. Toolbars, search, zoom and thumbnails are yours to build, or you can use PDF.js's own viewer or a commercial viewer SDK. For long files, rendering only the pages on screen keeps memory use down.
react-pdf pricing
Related terms
More in Media and documents
PDFs