
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-document-scanner-solarity
Advanced tools
Custom scanner build off RNPDFS, for use by Solarity Credit Union

Live document detection library. Returns either a URI or a base64 encoded string of the captured image, allowing you to easily store it or use it as you wish !
Features :
Use version >=1.4.1 if you are using react-native 0.48+
$ npm install react-native-document-scanner --save
$ react-native link react-native-document-scanner
Edit the info.plist file in XCode and add the following permission : NSCameraUsageDescription
Remember, this library uses your device camera, you can't run it on a simulator.
If you want to use Cocoapods insteads of react-native link, add the following to your Podfile
pod 'RNPdfScanner', :path => '../node_modules/react-native-document-scanner/ios'
import React,{ Component } from 'react';
import { View, Image } from 'react-native';
import DocumentScanner from 'react-native-document-scanner';
class YourComponent extends Component {
render() {
return (
<View>
<DocumentScanner
useBase64
onPictureTaken={data => this.setState({
image: data.croppedImage,
initialImage: data.initialImage,
rectangleCoordinates: data.rectangleCoordinates,
})}
overlayColor="rgba(255,130,0, 0.7)"
enableTorch={false}
brightness={0.3}
saturation={1}
contrast={1.1}
quality={0.5}
onRectangleDetect={({ stableCounter, lastDetectionType }) => this.setState({ stableCounter, lastDetectionType })}
detectionCountBeforeCapture={5}
detectionRefreshRateInMS={50}
/>
<Image source={{ uri: `data:image/jpeg;base64,${this.state.image}`}} resizeMode="contain" />
</View>
);
}
}
| Prop | Default | Type | Description |
|---|---|---|---|
| overlayColor | none | string | Color of the detected rectangle : rgba recommended |
| detectionCountBeforeCapture | 5 | integer | Number of correct rectangle to detect before capture |
| detectionRefreshRateInMS | 50 | integer | Time between two rectangle detection attempt |
| enableTorch | false | bool | Allows to active or deactivate flash during document detection |
| useFrontCam | false | bool | Allows you to switch between front and back camera |
| brightness | 0 | float | Increase or decrease camera brightness. Normal as default. |
| saturation | 1 | float | Increase or decrease camera saturation. Set 0 for black & white |
| contrast | 1 | float | Increase or decrease camera contrast. Normal as default |
| quality | 0.8 | float | Image compression. Reduces both image size and quality |
| useBase64 | false | bool | If base64 representation should be passed instead of image uri's |
| captureMultiple | false | bool | Keeps the scanner on after a successful capture |
<DocumentScanner ref={(ref) => this.scanner = ref} />
this.scanner.capture();
| Props | Params | Type | Description |
|---|---|---|---|
| onRectangleDetect | { stableCounter, lastDetectionType } | object | See below |
The returned object includes the following keys :
stableCounterNumber of correctly formated rectangle found (this number triggers capture once it goes above detectionCountBeforeCapture)
lastDetectionTypeEnum (0, 1 or 2) corresponding to the type of rectangle found 0. Correctly formated rectangle
| Prop | Params | Type | Description |
|---|---|---|---|
| onPictureTaken | data | object | Returns the captured image in an object { croppedImage: ('URI or BASE64 string'), initialImage: 'URI or BASE64 string', rectangleCoordinates: 'object of coordinates' } |
Libraries ➜ Add Files to [your project's name]node_modules ➜ react-native-pdf-scanner and add RNPdfScanner.xcodeprojlibRNPdfScanner.a to your project's Build Phases ➜ Link Binary With LibrariesCmd+R)<This repo is a React Native implementation of the following native library : https://github.com/mmackh/IPDFCameraViewController Special thank to Mark Peysale :)
FAQs
Custom scanner build off RNPDFS, for use by Solarity Credit Union
The npm package react-native-document-scanner-solarity receives a total of 0 weekly downloads. As such, react-native-document-scanner-solarity popularity was classified as not popular.
We found that react-native-document-scanner-solarity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.