Some test text!
Welcome to PDFTron. PDFTron SDK can be integrated with React Native for both Android and iOS.
This guide will help you integrate a free trial of the PDFTron SDK into your iOS applications using React Native. Your free trial includes unlimited trial usage and support from solution engineers.
For simplicity the following guide is based on a boilerplate react native app for
react-native init MyApp with git diff syntax for adding and removing lines from the boilerplate app.
If using yarn, do:
yarn global add react-native-cli
First, follow the official getting started guide on setting up the React Native environment, setting up the iOS and Android environment, and creating a React Native project. The following steps will assume your app is created through
react-native init MyApp. This guide also applies if you are using the TypeScript template.
MyApp folder, install
react-native-pdftron by calling:
yarn add github:PDFTron/pdftron-react-native yarn add @react-native-community/cli --dev yarn add @react-native-community/cli-platform-android --dev yarn add @react-native-community/cli-platform-ios --dev yarn install
npm install github:PDFTron/pdftron-react-native --save npm install @react-native-community/cli --save-dev npm install @react-native-community/cli-platform-android --save-dev npm install @react-native-community/cli-platform-ios --save-dev
Podfile in the
ios folder, add:
target 'MyApp' do # ... pod 'PDFNet', podspec: 'https://www.pdftron.com/downloads/ios/cocoapods/pdfnet/latest.podspec' # ... end
ios folder, run:
(Optional) If you need a close button icon, you will need to add the PNG resources to
MyApp as well, i.e.
To get access to TypeScript support, simply update your PDFTron React Native dependency to version 3.0.0 or higher.
For non-TypeScript users, updating your PDFTron React Native dependency to version 3.0.0 or higher will not automatically install TypeScript itself, and you can continue to use the library as before (without TypeScript support). If you currently do not use TypeScript itself in your project and would like to, see Adding TypeScript to an Existing Project.
Regardless of whether you use TypeScript, the following benefits are available:
devbranch (see Contributing).
If you have questions, head to the FAQ's React Native section .
If you are an existing TypeScript user, then the custom typings will be available to you simply by updating your PDFTron React Native dependency to version 3.0.0 or higher.
Get the answers you need: Support