Epub PDF Viewer Tester
A complete guide and reference for the epub-pdf-viewer package. This tester project includes standalone implementations of each feature and full documentation to help you integrate it into your own applications.
PDF Reader →
Standalone PDF Viewer with highlights, zoom controls, and theme customization.
EPUB Reader →
Standalone EPUB Viewer with chapter navigation, highlights, and annotations.
Audio Book →
Audio player for Audio Books featuring track switching and playback controls.
All-In-One Tester →
Combined interface for all readers with dynamic controls and the ShareBox testing.
Documentation & Usage
Installation
npm install epub-pdf-viewerBasic Implementation Guide
The package provides standalone components for each reading experience. Click on the features above to see full code examples and interactive demos. You must load the components dynamically to prevent server-side rendering issues.
Platform Usage Guidelines
1. Next.js (App & Pages Router)
Next.js runs Server-Side Rendering (SSR) by default. The viewers require browser APIs (like `window`), so they must be imported dynamically with `ssr: false`.
import dynamic from "next/dynamic";
const PdfReader = dynamic(
() => import("epub-pdf-viewer").then((mod) => mod.PdfReader),
{ ssr: false }
);
// Use <PdfReader /> in your component...2. React.js (Vite / Create React App)
In standard React apps without SSR, you can import the components directly.
import { PdfReader, EpubReader, AudioReader, ShareBox } from "epub-pdf-viewer";
export default function App() {
return <EpubReader url="/book.epub" />;
}3. React Native (Expo / CLI)
For React Native, import from the native entry point.
import { PdfReader } from "epub-pdf-viewer/react-native";
// Use inside your React Native View...