hey @geeky01adarsh, I believe you just don't want to display it right? In that case, you could use the @react-pdf/renderers pdf method and the file-saver package to achieve this.

import React from 'react';
import { saveAs } from 'file-saver';
import { pdf } from '@react-pdf/renderer';
import YourDocument from './YourDocument';

const DownloadButton = () => {
  const downloadPdf = async () => {
    const fileName = 'test.pdf';
    const blob = await pdf(<YourDocument />).toBlob();
    saveAs(blob, fileName);
  };

  return <button onClick={downloadPdf}>Download PDFbutton>;
};

export default DownloadButton;

this will convert your pdf component into a Blob and then saves it using saveAs method from file-saver

🌐
npm
npmjs.com › package › @react-pdf › renderer
@react-pdf/renderer - npm
September 23, 2025 - import ReactPDF from '@react-pdf/renderer'; ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
      » npm install @react-pdf/renderer
    
Published   Sep 23, 2025
Version   4.3.1
Author   Diego Muracciole
🌐
React-pdf
react-pdf.org
React-pdf
React renderer for creating PDF files on the browser and server
🌐
GitHub
github.com › diegomura › react-pdf
GitHub - diegomura/react-pdf: 📄 Create PDF files using React
import React from 'react'; import ReactDOM from 'react-dom'; import { PDFViewer } from '@react-pdf/renderer'; const App = () => ( <PDFViewer> <MyDocument /> </PDFViewer> ); ReactDOM.render(<App />, document.getElementById('root'));
Starred by 16.2K users
Forked by 1.3K users
Languages   TypeScript 83.1% | JavaScript 16.8%
🌐
CodeSandbox
codesandbox.io › examples › package › @react-pdf › renderer
@react-pdf/renderer examples - CodeSandbox
unified-react-pdfA React component library for rendering & building fully parseable PDF files from HTML/CSS
Find elsewhere
🌐
npm
npmjs.com › package › @react-pdf › render
@react-pdf/render - npm
September 23, 2025 - A render engine for Node and the browser. Latest version: 4.3.1, last published: 3 months ago. Start using @react-pdf/render in your project by running `npm i @react-pdf/render`. There are 30 other projects in the npm registry using ...
      » npm install @react-pdf/render
    
Published   Sep 23, 2025
Version   4.3.1
Author   Diego Muracciole
🌐
PureCode AI
blogs.purecode.ai › home › react pdf: a step-by-step guide on how to generate pdfs
React PDF: A Step-by-Step Guide on How to Generate PDFs - Blogs
September 30, 2025 - Creating a PDF file in React can be accomplished by leveraging a variety of libraries that have been specifically designed to handle file generation and manipulation within the framework. Two popular options among these libraries are React PDF (Renderer) and PDFme, which we’ll discuss in the next sections.
🌐
LogRocket
blog.logrocket.com › home › generating pdfs in react with react-pdf
Generating PDFs in React with react-pdf - LogRocket Blog
January 24, 2025 - As a result, this will tell react-pdf that we want the browser’s PDF viewer to take up all of the space on the page · As the name suggests, the PDFViewer component will render a PDF viewer on the browser
🌐
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.
Starred by 10.7K users
Forked by 981 users
Languages   TypeScript 94.3% | CSS 5.6% | HTML 0.1%
🌐
Medium
medium.com › codingmountain-blog › how-to-create-pdf-on-the-react-app-7d6b20d5c6e1
How to create PDF on the React App | by Laleet | codingmountain | Medium
October 20, 2023 - import React from 'react'; import { Page, Text, View, Document, StyleSheet } from '@react-pdf/renderer';
🌐
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 - Implementation considerations: ... project with vite(opens in a new tab): ... Place the file you want to render inside the public directory of the react-pdf-example project....
🌐
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 - React-PDF is a popular open-source library that enables developers to render PDF documents in React applications.
🌐
Reddit
reddit.com › r/reactjs › how can i generate a pdf?
r/reactjs on Reddit: How can I generate a pdf?
January 18, 2024 -

Hello everyone!

I'm currently engaged in a project that involves generating invoices and creating PDFs for them. The backend is built on Django, and the frontend is powered by Next.js. I'm contemplating the best approach for generating PDFs—whether to do it in React on the frontend or in Python on the backend. I came across a package on npm called `@react-pdf/renderer` for frontend PDF generation, is this good?

Any guidance would be highly appreciated!

P.S.: This is my first post!

🌐
Bundlephobia
bundlephobia.com › package › @react-pdf › renderer
@react-pdf/renderer ❘ Bundlephobia
Find the size of javascript package @react-pdf/renderer. Bundlephobia helps you find the performance impact of npm packages.
🌐
React-pdf
docs.react-pdf.dev
React PDF Documentation - Official Guide
React PDF (RP) is a PDF Viewer component based on React. To render PDF document on the client-side within React or Next project.