React Native Pdf

screenshot of React Native Pdf
react-native

A <Pdf /> component for react-native

Overview

The react-native-pdf is a react native PDF view component that supports cross-platform compatibility. It allows users to read a PDF from various sources such as URL, blob, local file, or asset, with features like horizontal or vertical display, drag and zoom, double tap for zoom, support for password-protected PDFs, and jumping to specific pages within the PDF.

Features

  • Read PDFs from URL, blob, local file, or asset
  • Display PDFs horizontally or vertically
  • Drag and zoom functionality
  • Double tap for zooming
  • Support for password-protected PDFs
  • Ability to jump to a specific page in the PDF
  • Cross-platform support for React Native

iOS Installation

For React Native 0.60 and above:

  1. Run pod install in the ios directory.

For React Native 0.59 and below:

  • Additional instructions need to be followed for Android and Windows installations.

Android Installation

For React Native 0.59.0 and above:

  1. Add specific configurations to your android/app/build.gradle file.

Windows Installation

  1. Open your solution in Visual Studio 2019.
  2. Add existing projects for RCTPdf.vcxproj and ReactNativeBlobUtil.vcxproj.
  3. Configure references and include necessary headers and packages.
  4. Bundling PDFs with the app requires specific steps detailed in the documentation.

Summary

The react-native-pdf component provides a convenient way to display and interact with PDF documents in a React Native application. With its cross-platform support, various features for PDF handling, and guidance for installation on different platforms, it offers a comprehensive solution for integrating PDF viewing capabilities into mobile applications effortlessly.

react-native
React Native

React Native is a framework for building mobile applications using React and JavaScript. It enables developers to write once and deploy to multiple platforms, including iOS, Android, and the web, while providing a native app-like experience to users.