All Projects → Diastorm → rn-doc-scanner-android

Diastorm / rn-doc-scanner-android

Licence: other
React-Native Document Scanner for Android

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rn-doc-scanner-android

Document-Scanner-and-OCR
A simple document scanner with OCR implemented using Python and OpenCV
Stars: ✭ 31 (+63.16%)
Mutual labels:  document-scanner
doc-skanner
An Android application that makes it possible to automatically scan and digitize documents from photos.
Stars: ✭ 92 (+384.21%)
Mutual labels:  document-scanner
DocumentScanner
Simple document scanner built with the Apple's Vision framework
Stars: ✭ 53 (+178.95%)
Mutual labels:  document-scanner
MRZScanner
Library for scanning documents via MRZ (Machine Readable Zones) using  Vision API
Stars: ✭ 40 (+110.53%)
Mutual labels:  document-scanner
docscan
Docscan is a document scanner. Take a photo of your documents and frame it.
Stars: ✭ 40 (+110.53%)
Mutual labels:  document-scanner

rn-doc-scanner-android

Installation 🚀

Optional

react-native-git-upgrade

or delete node_modules folder

react-native upgrade

create-react-native-app rndocscannerExample
cd rndocscannerExample
yarn add https://github.com/Diastorm/rn-doc-scanner-android.git
yarn eject

select React Native: first option

react-native link

open android/build.gradle

inside allprojects->repositories

allprojects {
    repositories {
        ...
        mavenCentral()
        maven {
            url 'https://maven.google.com'
        }
        maven {
            url "http://dl.bintray.com/steveliles/maven"
        }
        maven {
            url "https://jitpack.io"
        }
    }
}

open android/app/src/main/AndroidManifest.xml

inside manifest tag

<manifest ...
    xmlns:tools="http://schemas.android.com/tools"
>

inside application tag

<application
    ...
    tools:replace="android:allowBackup"
>

open android/app/build.gradle

change compileSdkVersion xx to

compileSdkVersion 26

run react-native run-android --deviceId xxxx

where xxxx is from adb devices

Usage 💃

RNDocScanner

Property Type Parameters Description
getDocumentCrop Function (disableAutoFocus: Bool) If disableAutoFocus equal true, then it will launch cam and you take the picture, otherwise it will autoFocus and take the picture automatically. After that it will lead to the view which enable you to crop the picture.

Example

import { RNDocScanner } from 'rn-doc-scanner'
import { Text, TouchableOpacity, Platform } from 'react-native'

const ScanButton = (props) => {
   const onPressScan = async () => {
    if (Platform.OS === 'android') {
        try {
            const image = await RNDocScanner.getDocumentCrop(true)
            console.log(image)
            } catch (err) {
            console.log(err)
            }
        }
    }

  return (
        <TouchableOpacity onPress={onPressScan}>
          <Text>Scan</Text>
        </TouchableOpacity>
    )
}

export default ScanButton
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].