react-native-image-scanner
v0.0.2
Published
A package which provides a feature to capture or upload image and edit the picture
Downloads
2
Readme
GoApptiv Document Scanner
The GoApptiv Document Scanner is a React Native library provides functionality for scanning documents in a React Native application. It supports both Android and iOS platforms.
Installation
To use the GoApptiv Document Scanner, follow these steps:
Install the package using npm or yarn:
npm install react-native-image-scanner
Import the component in your project:
import {GaDocumentScannerAndroid} from 'react-native-image-scanner'; import {GaDocumentScannerIos} from 'react-native-image-scanner';
Use the component in your React Native application:
For Android:
<GaDocumentScannerAndroid
setImageUri={setImageUri}
source={ImageSource.CAMERA}
onError={handleError}
onCancel={handleCancel}
/>
For iOS:
<GaDocumentScannerIos
setImageUri={setImageUri}
source={ImageSource.CAMERA}
onError={handleError}
/>
Props
The Document Scanner component accepts the following props:
| Prop | Type | Description |
| ----------- | ----------------------- | --------------------------------------------------------------------------------------------- |
| setImageUri | (uri: string) => void
| A function to set the URI of the scanned image. |
| source | ImageSource enum value | The source of the image (either ImageSource.CAMERA
or ImageSource.GALLERY
). |
| onError | Function (optional) | An optional callback function to handle errors that occur during the scanning process. |
| onCancel | Function (optional) | An optional callback function to handle the cancellation of the scanning process (Android only).
An optional callback function to handle the cancellation of the scanning process (only available for Android, for ios it's handled by onError itself).