🌐
React-pdf
react-pdf.org
React-pdf
React renderer for creating PDF files on the browser and server
Styling
React renderer for creating PDF files on the browser and server
Advanced
React renderer for creating PDF files on the browser and server
Components
React renderer for creating PDF files on the browser and server
Rendering process
React renderer for creating PDF files on the browser and server
🌐
npm
npmjs.com › package › react-pdf
react-pdf - npm
October 9, 2025 - Display PDFs in your React app as easily as if they were images.. Latest version: 10.2.0, last published: 2 months ago. Start using react-pdf in your project by running `npm i react-pdf`. There are 986 other projects in the npm registry using ...
      » npm install react-pdf
    
Published   Oct 09, 2025
Version   10.2.0
Author   Wojciech Maj
Discussions

How to generate PDFs with React? PDF Report Generation
This solves a real pain point in React. Handling pagination, headers, and layout without hacks is a huge win. For anyone needing deeper PDF features like form filling or annotations, I have worked with the Apryse SDK in the past and it is quite handy. More on reddit.com
🌐 r/reactjs
10
6
February 19, 2025
reactjs - How do I download a pdf file onClick with react-pdf? - Stack Overflow
I want to generate a pdf from the UI and download it. Been looking to the documentation but couldn't find how to implement I.e. onClick={this.downloadPdf} here's the module reference: https://github.com/diegomura/react-pdf More on stackoverflow.com
🌐 stackoverflow.com
reactjs - Generating a PDF file from React Components - Stack Overflow
I have been building a polling application. People are able to create their polls and get data regarding the question(s) they ask. I would like to add the functionality to let the users download the More on stackoverflow.com
🌐 stackoverflow.com
How to create a PDF from React Component

I've always used puppeteer

https://developers.google.com/web/tools/puppeteer

More on reddit.com
🌐 r/reactjs
11
35
April 15, 2020
🌐
GitHub
github.com › diegomura › react-pdf
GitHub - diegomura/react-pdf: 📄 Create PDF files using React
React renderer for creating PDF files on the browser and server
Starred by 16.2K users
Forked by 1.3K users
Languages   TypeScript 83.1% | JavaScript 16.8%
🌐
Wojtekmaj
projekty.wojtekmaj.pl › react-pdf
React-PDF
Easily display PDFs in your React app.
🌐
CodeSandbox
codesandbox.io › examples › package › react-pdf
react-pdf examples - CodeSandbox
Use this online react-pdf playground to view and fork react-pdf example apps and templates on CodeSandbox.
🌐
Telerik
telerik.com › components › overview
React PDF Processing Overview - KendoReact
Try our React PDF Generator Component by KendoReact that allows you to export a selection of or the entire content of a web page to a PDF file
Find elsewhere
🌐
React PDF
react-pdf.dev
React PDF Viewer – Fast & Customisable for React/Next.js
React PDF Viewer gives you a fast, customisable, and web‑responsive PDF component for React & Next.js — full search, print, zoom & Context API control.
🌐
ThemeSelection
themeselection.com › home › blog › collections › 7 useful react pdf library and viewers 2025
7 Useful React PDF Library and Viewers 2025 - ThemeSelection
August 29, 2025 - In addition, it saves you time ... than building it from scratch. React-PDF is a popular open-source library that enables developers to render PDF documents in React applications....
🌐
npm
npmjs.com › package › @react-pdf › renderer
@react-pdf/renderer - npm
September 23, 2025 - Create PDF files on the browser and server. 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 ...
      » npm install @react-pdf/renderer
    
Published   Sep 23, 2025
Version   4.3.1
Author   Diego Muracciole
🌐
Reddit
reddit.com › r/reactjs › how to generate pdfs with react? pdf report generation
r/reactjs on Reddit: How to generate PDFs with React? PDF Report Generation
February 19, 2025 -

Hey everyone!

During my few years working as a web developer focused on React, I ran into a recurring issue: Generating multi-page PDFs or PDF reports with React. No React-based solution offers an easy and quick way to customize headers, footers, covers, or handle automatic pagination.

To solve this, I created React Smart Print (react-smart-print), a library that allows you to generate PDF reports directly from React components. The biggest advantage is that you don’t have to worry about pagination, element overflow, or layout adjustments. It works like writing a .doc document: content that fits on a page stays there, and anything that doesn’t automatically moves to the next one—without abrupt cuts, overflow issues, or misaligned elements. It also maintains headers, footers, and margins properly. Most aspects are customizable, making the development process much simpler.

The library is already available on npm under the name react-smart-print. The project is also public on GitHub, and I’d love for you to check out the code and contribute if you see potential. If this tool had existed earlier, it would have saved me weeks of development, so I hope it proves useful to you!

https://github.com/JoaquinBenegas2/react-smart-print

🌐
GitHub
github.com › wojtekmaj › react-pdf
GitHub - wojtekmaj/react-pdf: Display PDFs in your React app as easily as if they were images.
Display PDFs in your React app as easily as if they were images. - wojtekmaj/react-pdf
Starred by 10.7K users
Forked by 981 users
Languages   TypeScript 94.3% | CSS 5.6% | HTML 0.1%
🌐
Medium
medium.com › @ryanmambou › how-to-generate-a-pdf-file-from-a-react-component-87707e869296
How to Generate a PDF file from a React Component | by Ryan Mambou | Medium
August 29, 2024 - Hello my brothers and sisters from the internet, I encountered a problem a few months ago where I had to print a card component I created in react to a pdf file. Didn’t have the slightest clue on how to do it but after some searching, I found a solution. The task may sound scary at first but with a little bit of searching and thinking, you’ll always figure it out.
Top answer
1 of 13
168

Rendering react as pdf is generally a pain, but there is a way around it using canvas.

The idea is to convert : HTML -> Canvas -> PNG (or JPEG) -> PDF

To achieve the above, you'll need :

  1. html2canvas &
  2. jsPDF

import React, {Component, PropTypes} from 'react';

// download html2canvas and jsPDF and save the files in app/ext, or somewhere else
// the built versions are directly consumable
// import {html2canvas, jsPDF} from 'app/ext';


export default class Export extends Component {
  constructor(props) {
    super(props);
  }

  printDocument() {
    const input = document.getElementById('divToPrint');
    html2canvas(input)
      .then((canvas) => {
        const imgData = canvas.toDataURL('image/png');
        const pdf = new jsPDF();
        pdf.addImage(imgData, 'JPEG', 0, 0);
        // pdf.output('dataurlnewwindow');
        pdf.save("download.pdf");
      })
    ;
  }

  render() {
    return (<div>
      <div className="mb5">
        <button onClick={this.printDocument}>Print</button>
      </div>
      <div id="divToPrint" className="mt4" {...css({
        backgroundColor: '#f5f5f5',
        width: '210mm',
        minHeight: '297mm',
        marginLeft: 'auto',
        marginRight: 'auto'
      })}>
        <div>Note: Here the dimensions of div are same as A4</div> 
        <div>You Can add any component here</div>
      </div>
    </div>);
  }
}

The snippet will not work here because the required files are not imported.

An alternate approach is being used in this answer, where the middle steps are dropped and you can simply convert from HTML to PDF. There is an option to do this in the jsPDF documentation as well, but from personal observation, I feel that better accuracy is achieved when dom is converted into png first.

Update 0: September 14, 2018

The text on the pdfs created by this approach will not be selectable. If that's a requirement, you might find this article helpful.

2 of 13
19

@react-pdf/renderer is a great resource for this.

It is a bit time consuming converting your markup and CSS to React-PDF's format, but it is easy to understand. Exporting a PDF and from it is fairly straightforward.

To allow a user to download a PDF generated by react-PDF, use their on the fly rendering, which provides a customizable download link. When clicked, the site renders and downloads the PDF for the user.

Here's their REPL which will familiarize you with the markup and styling required. They have a download link for the PDF too, but they don't show the code for that here.

🌐
React
react.dev › learn
Quick Start – React
This page will give you an introduction to 80% of the React concepts that you will use on a daily basis.
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-integrate-react-pdf-in-reactjs
How to integrate React-PDF in ReactJS ? - GeeksforGeeks
July 23, 2025 - React-PDF is a package that helps users to display PDF files in their React app. By using the react-pdf package we can add PDF files in our React app as if they were images. To use the latest version of react-pdf package, our project should ...
🌐
Nutrient
nutrient.io › blog › sdk › create pdfs with react
How to Create a PDF with React
November 17, 2024 - We explore react-pdf, a custom React renderer that can generate PDFs in the browser, on the server, and on mobile devices.
🌐
GitHub
github.com › OnedocLabs › react-print-pdf
GitHub - OnedocLabs/react-print-pdf: Build and generate PDF using React 📄 UI kit for PDFs and print documents. Simple, reusable components and templates to create great invoices, docs, brochures. Use your favorite front-end framework React to build your next PDF.
Build and generate PDF using React 📄 UI kit for PDFs and print documents. Simple, reusable components and templates to create great invoices, docs, brochures. Use your favorite front-end framework React to build your next PDF. - OnedocLabs/react-print-pdf
Starred by 2.5K users
Forked by 97 users
Languages   TypeScript 54.6% | MDX 43.7% | CSS 1.7%