🌐
npm
npmjs.com › package › react-pdf
react-pdf - npm
This package is used to display existing PDFs. If you wish to create PDFs using React, you may be looking for @react-pdf/renderer. Install by executing npm install react-pdf or yarn add react-pdf.
      » npm install react-pdf
    
Published   Oct 09, 2025
Version   10.2.0
Author   Wojciech Maj
🌐
npm
npmjs.com › package › @react-pdf › renderer
@react-pdf/renderer - npm
Latest version: 4.3.1, last published: 3 months ago. Start using @react-pdf/renderer in your project by running `npm i @react-pdf/renderer`. There are 446 other projects in the npm registry using @react-pdf/renderer.
      » npm install @react-pdf/renderer
    
Published   Sep 23, 2025
Version   4.3.1
Author   Diego Muracciole
🌐
npm
npmjs.com › package › react-to-pdf
react-to-pdf - npm
import { useRef } from 'react'; import generatePDF from 'react-to-pdf'; const Component = () => { const targetRef = useRef(); return ( <div> <button onClick={() => generatePDF(targetRef, {filename: 'page.pdf'})}>Download PDF</button> <div ...
      » npm install react-to-pdf
    
Published   Nov 25, 2025
Version   2.0.3
Author   Marcos Andrei Ivanechtchuk
🌐
React-pdf
react-pdf.org
React-pdf
React renderer for creating PDF files on the browser and server
🌐
GitHub
github.com › wojtekmaj › react-pdf
GitHub - wojtekmaj/react-pdf: Display PDFs in your React app as easily as if they were images.
This package is used to display existing PDFs. If you wish to create PDFs using React, you may be looking for @react-pdf/renderer. Install by executing npm install react-pdf or yarn add react-pdf.
Starred by 10.7K users
Forked by 981 users
Languages   TypeScript 94.3% | CSS 5.6% | HTML 0.1%
🌐
npm
npmjs.com › package › react-pdf-js
react-pdf-js - npm
npm · Sign UpSign In · This package has been deprecated · Author message:Please move to our namespaced package at @mikecousins/react-pdf · 5.1.0 • Public • Published 6 years ago · Readme · Code Beta · 1 Dependency · 31 Dependents · 74 Versions ·
      » npm install react-pdf-js
    
Published   Jun 19, 2019
Version   5.1.0
Author   mikecousins
🌐
npm
npmjs.com › package › react-native-pdf
react-native-pdf - npm
Learn how you can use this package in Custom Dev Clients via the out-of-tree Expo Config Plugin. Example: with-pdf. # Using npm npm install react-native-pdf react-native-blob-util --save # or using yarn: yarn add react-native-pdf react-nati...
      » npm install react-native-pdf
    
Published   Oct 16, 2025
Version   7.0.3
Author   Wonday
🌐
npm
npmjs.com › package › react-pdf-html
react-pdf-html - npm
Html component for react-pdf with CSS support. Latest version: 2.1.3, last published: 9 months ago. Start using react-pdf-html in your project by running `npm i react-pdf-html`. There are 22 other projects in the npm registry using react-pdf-html.
      » npm install react-pdf-html
    
Published   Jan 15, 2025
Version   2.1.3
Author   Dan Blaisdell [email protected]
🌐
GitHub
github.com › diegomura › react-pdf
GitHub - diegomura/react-pdf: 📄 Create PDF files using React
This package is used to create PDFs using React.
Starred by 16.2K users
Forked by 1.3K users
Languages   TypeScript 83.1% | JavaScript 16.8%
Find elsewhere
🌐
npm
npmjs.com › package › react-read-pdf
react-read-pdf - npm
a mobile-friendly PDF Reader in browser for React. Latest version: 2.0.9, last published: 7 years ago. Start using react-read-pdf in your project by running `npm i react-read-pdf`. There are no other projects in the npm registry using react-read-pdf.
      » npm install react-read-pdf
    
Published   Dec 11, 2018
Version   2.0.9
Author   yuxl
🌐
npm
npmjs.com › package › pdf-viewer-reactjs
pdf-viewer-reactjs - npm
Initially it was forked from mgr-pdf-viewer-react · npm install pdf-viewer-reactjs ·
      » npm install pdf-viewer-reactjs
    
Published   Feb 15, 2021
Version   2.2.3
Author   ansu5555
🌐
npm
npmjs.com › package › @pdf-viewer › react
@pdf-viewer/react - npm
There are a few ways you can install React PDF, namely bun, npm, pnpm or yarn.
      » npm install @pdf-viewer/react
    
Published   Dec 04, 2025
Version   1.13.1
Author   React PDF Viewer
🌐
npm
npmjs.com › package › @react-pdf › pdfkit
@react-pdf/pdfkit - npm
A PDF generation library for Node.js. Latest version: 4.0.4, last published: 3 months ago. Start using @react-pdf/pdfkit in your project by running `npm i @react-pdf/pdfkit`. There are 66 other projects in the npm registry using @react-pdf/pdfkit.
      » npm install @react-pdf/pdfkit
    
Published   Sep 23, 2025
Version   4.0.4
Author   Devon Govett
🌐
Nutrient
nutrient.io › blog › sdk › how to build a reactjs pdf viewer with react pdf
React PDF viewer: Complete guide to building with react-pdf in 2025
August 12, 2025 - To create a React PDF viewer with react-pdf: 1) Install the library (npm install react-pdf), 2) Import Document and Page components, 3) Configure the PDF.js worker, and 4) Build your own UI controls.
🌐
npm
npmjs.com › package › @react-pdf-viewer › core
@react-pdf-viewer/core - npm
pdf viewer · npm i @react-pdf-viewer/core · github.com/react-pdf-viewer/react-pdf-viewer · react-pdf-viewer.dev · 225,151 · 3.12.0 · https://react-pdf-viewer.dev/license · 345 kB · 7 · 3 years ago · phuoc-ng · Try on RunKit ·
      » npm install @react-pdf-viewer/core
    
Published   Mar 21, 2023
Version   3.12.0
Author   Nguyen Huu Phuoc
🌐
npm
npmjs.com › package › @mikecousins › react-pdf
@mikecousins/react-pdf - npm
Latest version: 8.0.1, last published: 6 months ago. Start using @mikecousins/react-pdf in your project by running `npm i @mikecousins/react-pdf`. There are 11 other projects in the npm registry using ...
      » npm install @mikecousins/react-pdf
    
Published   Mar 28, 2025
Version   8.0.1
Author   mikecousins
🌐
React-pdf
v1.react-pdf.org
React-pdf
npm install @react-pdf/renderer --save · Since a renderer simply implements how elements render into something, you still need to have React to make it work (and react-dom for client-side document generation).
🌐
npm
npmjs.com › search
react pdf - npm search
npm · Sign UpSign In · Sort by: Default · Default · Most downloaded this week · Most downloaded this month · Most dependents · Recently published · React-pdf helper functions · diegomura• 3.1.2 • 9 months ago • 21 dependents • MITpublished version 3.1.2, 9 months ago21 dependents licensed under $MIT ·
Top answer
1 of 2
1

The problem here is that the version of React your project is using (^18.2.0) is not compatible with the react-to-pdf package's definition, which requires react version ^16.5.2 to be installed. At first glance, this may seem like an invalid error: the package expects a version higher than 16.5.2, and you've installed something above 18.2.0. However, any major version bump will create an incompatible state. We can understand this explicitly by reading npm's documentation on this topic, which states the following:

Assuming the host complies with semver, only changes in the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use "^1.0" or "1.x" to express this. If you depend on features introduced in 1.5.2, use "^1.5.2".

Armed with all of that knowledge, we now have handful of options for resolving this issue:

  1. Force install the plugin or use the legacy peer dependencies option, either of which provides no guarantee that this package works with your version of react.
  2. Downgrade react (this is technically an option, but don't do it).
  3. Find a more up-to-date alternative that accomplishes the same goal and is compatible with your version of react.

Additionally, if you really like this package, I would recommend opening up an issue on the maintainer's repository to ask for an update that tests compatibility with newer versions and publishes a new version of their own package.

Finally, I would recommend becoming familiar with this kind of error message and read through some of the official documentation on npm's website because this kind of thing is fairly common and understanding the basics will save you many future headaches.

2 of 2
0

Try :

  • npm install react-to-pdf --force
  • Choose a previous stable version, for example npm install [email protected]
🌐
Npm
npm.io › package › react-pdf
React-pdf NPM | npm.io
Weekly downloads · 292,489 · ... package is used to display existing PDFs. If you wish to create PDFs using React, you may be looking for @react-pdf/renderer....