munna-pdfviewer
v1.0.0
Published
A React component to view PDF files using pdfjs-dist.
Readme
pdfviewer
A simple React component to view PDF files using pdfjs-dist.
Features
- View PDF from a URL or base64 string
- Multi-page navigation (Prev/Next buttons)
- Displays current page and total pages
Installation
npm install pdfviewer pdfjs-distUsage
import PdfViewer from 'pdfviewer';
function App() {
return <PdfViewer file="/path/to/file.pdf" initialPage={1} />;
}file: URL or base64 string of the PDF file.initialPage: (optional) Initial page number to display (default: 1).
Multi-page Navigation
Use the built-in Prev/Next buttons to navigate between pages. The viewer displays the current page and total number of pages.
Build
npm run buildLicense
ISC
