Tech

Foxit PDF SDK React Native Support

by Conor Smith | August 30, 2018

Our React Native component for Foxit PDF SDK for Android and iOS is a long awaited binary for many developers. Firstly, because it is a great addition to Foxit’s bundle of new frameworks for cross-platform mobile development, along with our Cordova, Xamarin and Kotlin support. Secondly, because the efficiency on data retrieval and improvement in performance React Native can provide to applications running in APIs, like Foxit PDF SDK for Android/iOS, has been shared and praised by developers everywhere. We are very interested to see how it will perform in production and the feedback we will receive from our users.

What is React Native?

React Native is the mobile development “branch” of the fully JavaScript-based React framework. React Native allows you to write your entire app with it or create components in an Android/iOS app using a JavaScript code with native mobile development design and make it easily transferable for both Android and iOS platforms. Because it is JavaScript only, it can compile and run faster than native apps, however, although a 100% React Native app can make life easier for an application that doesn’t require extensive media processing, apps with robust processing running in the main thread and JS thread like React Native may lead to performance issues. So it’s important to analyze your requirements carefully before starting development in React Native.

We do believe PDF operations using our React Native Component can be truly cost and time effective by offering a component that a wide range of developers can understand and implement functionality into, added to an active community support that can come to the rescue for any question you may have. Our React Native component is the ideal framework for developers who need a PDF mobile app but don’t have time to study native code for months. Performance doesn’t have to suffer using React Native alongside our PDF SDK. Join the many successful multinational companies like Facebook, Instagram, Skype and Uber who use React Native in their mobile apps.

How to Setup React Native with Foxit PDF SDK

The first step of a basic set up for our React Native component for Foxit PDF SDK for Android and iOS, is to show how easy it is to create the React Native project. We have prepared technical documents to help you complete your set up and run the component.

You will need node.js and react-native-cli to run the commands and install the component. If you don’t have those yet, please download before starting the setup.

path\node_modules>react-native init FoxitRNReader
path\node_modules>cd FoxitRNReader
path\node_modulesFoxitRNReader> npm install @foxitsoftware/react-native-foxitpdf --save
path\node_modulesFoxitRNReader> react-native link @foxitsoftware/react-native-foxitpdf

This is a standard code you will use for both Android and iOS. In your project, you will see separate android and iOS folders inside your project so that you can set up both and make your app instantly easy to work on both platforms for your development team.

The next steps are a bit different depending on your platform. You will need to copy Foxit PDF SDK for Android or iOS ‘libs’ folder to your React Native respective platform project folder and make changes to import the framework and native modules, add license keys and permissions. Go to our Knowledge Base article to complete the setup to the component’s github repository for the complete tutorial.

[button link=”/solutions/react-native-support/” type=”big” color=”orange”]Discover More About Our React Native Support[/button]