1.0.1 • Published 5 months ago

pdf-viewer-core v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

React PDF Viewer

A modern, flexible and customizable PDF viewer package for React applications.

Features

  • 🚀 Fast and responsive PDF rendering
  • 📱 Mobile-friendly with touch support
  • 🎨 Customizable UI and styling
  • 📄 Multiple page navigation
  • 🎯 Page scrolling with smooth transitions
  • 📦 Support for both file uploads and URL sources
  • 🎮 Comprehensive toolbar controls
  • 🎨 Flexible styling options

Installation

npm install pdf-viewer-core

Usage

import { PDFViewer } from 'pdf-viewer-core';
import 'pdf-viewer-core/style.css';

<PDFViewer pdfFile={pdfFile} />

Props

PropTypeDefaultDescription
pdfFileFile/url/ArrayBufferundefinedThe PDF file to display.
onLoadSuccess() => voidundefinedCallback function called when the PDF is loaded successfully.
onLoadError(error: Error) => voidundefinedCallback function called when the PDF fails to load.
onPageChange(page: number) => voidundefinedCallback function called when the page changes.
getPdfName(name: string) => voidundefinedCallback function called to get the name of the PDF file.
showToolbarbooleantrueWhether to show the toolbar.
toolbarConfig{ showPageNavigation: boolean }{ showPageNavigation: true }The configuration for the toolbar.
toolbarStylesReact.CSSProperties{className: 'toolbar-style'}The styles for the toolbar.
containerStylesReact.CSSProperties{className: 'container-style', maxHeight: '80vh', width: '100%'}The styles for the container.
fullScreenbooleanfalseWhether to show the full screen.

Support

Buy me a coffee

1.0.1

5 months ago

1.0.0

5 months ago