douglasjunior /react-native-pdf-renderer

⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.

★ 301⑂ 20👁 3⑃ 31● 49▤ 26
下载:3.1.03.1.0 ↓3.1.02026-11-26
+1
日增长
301
stars
20
forks
3
watchers
31
prs
49
issues
26
releases

README

A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.



  React Native PDF Renderer provides high-performance, dependency-free native PDF rendering for React Native by directly utilizing Android's PdfRenderer and Apple's PDFKit. Enjoy smooth multi-page scrolling, fluid pinch-to-zoom, thumbnail previews, and comprehensive scale events without the maintenance burden of third-party native binaries.



  
  
  
  
  =0.80.0-61DAFB?style=flat-square&logo=react&logoColor=black" alt="React Native = 0.80.0"
  
  



  Quick Start ·
  Why ·
  Previews ·
  Requirements ·
  Installation ·
  Usage ·
  API Reference ·
  Limitations ·
  Testing ·
  Contributing


---

 🚀 Quick Start

bash
 1. Install package
yarn add react-native-pdf-renderer
 or: npm i -S react-native-pdf-renderer

 2. Install CocoaPods dependencies for iOS
cd ios && pod install


tsx
import React from 'react';
import { SafeAreaView } from 'react-native-safe-area-context';
import PdfRendererView from 'react-native-pdf-renderer';

export default function App() {
  return (
    
       {
          console.log(Page: ${current + 1} of ${total});
        }}
      /
    
  );
}


---

 💡 Why Another PDF Renderer?

The main reason why this library was created is to avoid using third-party native dependencies, such as com.github.TalbotGooday:AndroidPdfViewer, com.github.mhiew:android-pdf-viewer, react-native-blob-util, or react-native-webview.

 But why?

Every React Native developer knows (or will discover soon) the pain of updating the React Native ecosystem whenever a new major Android or iOS version comes out. Third-party native wrappers often become abandoned, break during Gradle or Xcode updates, or introduce incompatible native architectures.

Here, we eliminate this friction entirely:

- ⚛️ Pure Platform Native: Relies exclusively on official platform SDK engines: PdfRenderer on Android and PDFKit on iOS.
- 🛡️ Zero Native Bloat: Zero third-party C++/Java/Obj-C dependencies to link, compile, or debug during React Native upgrades.
- 🔍 Pinch-to-Zoom & Pan: Smooth, continuous gesture-based scaling with configurable zoom ceilings and scale tracking.
- 📑 Single & Multi-Page Modes: Seamless vertical continuous scroll for multi-page documents, or single-page view for thumbnail covers.
- 🛡️ OOM & Canvas Crash Prevention: Built-in maxPageResolution safeguards on Android prevent out-of-memory bitmap allocations during deep zooms.
- 📘 TypeScript Included: Written in TypeScript with complete prop definitions and IntelliSense documentation.
- 🧪 Mock Ready: Pre-configured Jest mock included for painless snapshot and unit testing.

---

 📸 Previews

| Android | iOS |
|:---:|:---:|
|  |  |

---

 📋 Requirements

| Platform / Tool | Minimum Version | Notes |
|---|---|---|
| React Native | = 0.80.0 | Old & New Architecture support |
| iOS | = 12.0 | Uses native PDFKit |
| Android | API 21+ (Android 5.0+) | Uses native android.graphics.pdf.PdfRenderer |

---

 📦 Insta

Top issues

Latest release

3.1.0 3.1.0 2026-11-26
What's New
- iOS: Add onScaleChange support to report zoom scale changes continuously during pinch gestures and zoom animations (72 by @LuizAbudi).
- Android & iOS: Add imperative scrollToIndex(index) ref method (PdfRendererViewRefType) to programmatically jump to a page and reset zoom (81 by @LuizAbudi).
- Android & iOS: Add initialPageIndex prop to open a document directly on a specific zero-based page without a visual jump (81 by @LuizAbudi).

Full Changelog: https://github.com/douglasjunior/react-native-pdf-renderer/compare/3.0.1...3.1.0

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON