If you goal is just to view the pdf in your application, the easiest way is using the object tag in HTML. You don't need to import any libraries and works most of the browsers. But this is lack of customization and styles.

  <object data="http://africau.edu/images/default/sample.pdf" type="application/pdf" width="100%" height="100%">
      <p>Alternative text - include a link <a href="http://africau.edu/images/default/sample.pdf">to the PDF!</a></p>
  </object>
Answer from Dhanuka Perera on Stack Overflow
🌐
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
react-pdf - npm
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 985 other projects in the npm registry using react-pdf.
      » npm install react-pdf
    
Published   Oct 09, 2025
Version   10.2.0
Author   Wojciech Maj
🌐
React-pdf
react-pdf.org
React-pdf
React renderer for creating PDF files on the browser and server
🌐
Nutrient
nutrient.io › blog › sdk › how to display a pdf in react
How to display a PDF in React
April 21, 2025 - This tutorial demonstrates how to display PDFs in React applications using Vite and Nutrient’s Web PDF SDK. It provides step-by-step instructions for project setup, configuration, and implementation.
🌐
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 - If you don’t need advanced features like annotations or custom UI controls, the easiest way to embed PDFs in your React app is by using native HTML tags such as <iframe>, <embed>, and <object>. These methods require no additional libraries ...
Find elsewhere
🌐
GitHub
github.com › react-pdf-viewer › react-pdf-viewer
GitHub - react-pdf-viewer/react-pdf-viewer: A React component to view a PDF document
// Core viewer import { Viewer } from '@react-pdf-viewer/core'; // Plugins import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout'; // Import styles import '@react-pdf-viewer/core/lib/styles/index.css'; import '@react-pdf-viewer/default-layout/lib/styles/index.css'; // Create new plugin instance const defaultLayoutPluginInstance = defaultLayoutPlugin(); <Viewer fileUrl='/assets/pdf-open-parameters.pdf' plugins={[ // Register plugins defaultLayoutPluginInstance, ...
Starred by 2.6K users
Forked by 295 users
Languages   TypeScript 97.5% | CSS 2.5%
🌐
CodeSandbox
codesandbox.io › s › displaying-pdf-using-react-5d003
Displaying PDF using React - CodeSandbox
September 30, 2020 - Displaying PDF using React by Sahero using react, react-dom, react-pdf, react-scripts
Published   May 31, 2020
Author   Sahero
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-display-a-pdf-as-an-image-in-react-app-using-url
How to display a PDF as an image in React app using URL? - GeeksforGeeks
July 23, 2025 - But if you don't want that then there is a way to do so. You can use the package called react-pdf, by using this package you can render the PDF in your React app by using the PDF URL.
🌐
Apryse
apryse.com › blog › how-to-embed-pdf-in-react
Embed React PDF Viewer | Apryse
June 5, 2023 - Step-by-step guide on how to embed pdf viewer in react app supporting various capabilities, size and types of files.
🌐
GemBox
gemboxsoftware.com › pdfviewer › examples › react-pdf-viewer › 204
React PDF Viewer - Display PDF files in React applications
import React, { useEffect, useRef } from 'react'; import { GemBoxPdfViewer } from '@gembox/pdfviewer'; import '@gembox/pdfviewer/dist/es/pdfviewer.css'; GemBoxPdfViewer.setLicense("FREE-LIMITED-KEY"); const PdfViewer = ({ initialDocument = null }) => { const viewerElement = useRef(null); useEffect(() => { GemBoxPdfViewer.create({ container: viewerElement.current, initialDocument: initialDocument }); }, []); return ( <div ref={viewerElement} style={{ width: "600px", height: "350px" }}></div> ); }; export default PdfViewer; You can save this component as PdfViewer.jsx and use it throughout your React application as needed. To display existing PDF documents you can use the React component created in the previous step:
🌐
GitConnected
levelup.gitconnected.com › displaying-pdf-in-react-app-6e9d1fffa1a9
Displaying PDF in React app. I want to show you an easy and simple… | by Sagar Shrestha | Level Up Coding
January 11, 2023 - To render the PDF file, react-pdf has a Document component where you need to pass a file prop. Then inside the Document component, you need to create a Page component. Simple isn’t it?
🌐
StackBlitz
stackblitz.com › edit › react-9wseew
React pdf display pdf - StackBlitz
A React project based on react, react-dom, react-pdf and @babel/runtime
🌐
Medium
devjoe.medium.com › displaying-a-pdf-on-react-29dd69d22bc
Displaying a PDF On React. Sometimes you have to display a PDF… | by Joe C Gomez | Medium
March 5, 2021 - Then we have to import it into our component that we are rendering the PDF file. For my example I have a Resume component that I would like to render the PDF file. import React from 'react'import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';const Resume = () => { return ( <div className='main-container'> </div> ) }
🌐
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.