{"analyzedAt":"2022-12-12T12:08:18.035Z","collected":{"metadata":{"name":"@thegrizzlylabs/react-native-genius-scan","scope":"thegrizzlylabs","version":"4.7.4","description":"React Native Plugin for Genius Scan SDK","keywords":["document scanner","document scanning","sdk","scanning api","camera","scanner","mobile scanner","ocr","optical character recognition","text recognition","react-native","react-component","ios","android","opencv","document capture","document detection","edge detection","perspective correction","image cropping","image enhancement","image filter","black and white","image to pdf","pdf generator","genius scan","the grizzly labs"],"date":"2022-12-09T08:54:19.843Z","author":{"name":"TheGrizzlyLabs","email":"sdk@thegrizzlylabs.com","url":"https://www.thegrizzlylabs.com/"},"publisher":{"username":"guillaume-tgl","email":"guillaume@thegrizzlylabs.com"},"maintainers":[{"username":"guillaume-tgl","email":"guillaume@thegrizzlylabs.com"}],"links":{"npm":"https://www.npmjs.com/package/%40thegrizzlylabs%2Freact-native-genius-scan","homepage":"https://geniusscansdk.com"},"peerDependencies":{"react-native":">=0.41.2"},"releases":[{"from":"2022-11-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":3},{"from":"2022-09-13T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":7},{"from":"2022-06-15T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":9},{"from":"2021-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":17},{"from":"2020-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":44}],"readme":"# Genius Scan SDK for React Native\n\n## Description\n\nThis React Native component allows you to access the [Genius Scan SDK](https://geniusscansdk.com) core features from a React Native application. The component relies on the GSSDKScannerUI library which provides a all-in-one scanner module with simple configurable input.\n\n  - Automatic document detection\n  - Document perspective correction\n  - Image enhancement with 4 different modes (Black & white, Monochrome, Color, Photo)\n  - Batch scanning of several pages in row\n  - OCR to extract raw text from images and generate PDF with invisible text layer\n\n## Licence\n\nThis component is based on the Genius Scan SDK for which you need to [setup a licence](#api).\nYou can already try the \"demo\" version for free by not setting a licence key, the only limitation being that the app will exit after 60 seconds.\n\nTo buy a license:\n1. [Sign up](https://sdk.geniusscan.com/apps) to our developer console\n2. Submit a quote request for each application\n\nYou can learn more about [licensing](https://geniusscansdk.com/license/licensing) on our website and contact us at sdk@geniusscan.com for further questions.\n\n## Demo application\n\nAs an example, you can check our [demo application](https://github.com/thegrizzlylabs/geniusscan-sdk-demo/tree/master/react-native-genius-scan-demo)\n\n## Getting started\n\nFrom your React Native root folder:\n\n```\n$ npm install @thegrizzlylabs/react-native-genius-scan --save\n```\n\nIf you use ReactNative below 0.60, you will also need to link the plugin:\n\n```\n$ react-native link @thegrizzlylabs/react-native-genius-scan\n```\n\n### Additional steps on Android\n\n- To your app `android/app/build.gradle`, change minSdkVersion to `21`.\n\n### Additional steps for iOS\n\n- Add the required permission to your `Info.plist`\n```\nNSCameraUsageDescription - \"We use the camera for <provide a good reason why you are using the camera>\"\n```\n- In your `Podfile`, add the following line:\n```\nplatform :ios, '11.0'\n```\n\n#### With ReactNative 0.60 and above\n\nRun `pod install` from the ios folder\n\n#### With ReactNative below 0.60\n\nOpen your Xcode project file (ios/*****.xcodeproj), and:\n- Add GSSDK.framework and GSSDKScannerUI.framework, located in `node_modules/@thegrizzlylabs/react-native-genius-scan/ios`, to your project \"Embedded Libraries\"\n- Add the path `${PROJECT_DIR}/../node_modules/@thegrizzlylabs/react-native-genius-scan/ios/GSSDK` to your project \"Framework Search path\" (in the Build Settings)\n\n## Usage\n\n### Set the licence key\n\nInitialize the SDK with a valid licence key:\n\n```javascript\nRNGeniusScan.setLicenceKey('REPLACE_WITH_YOUR_LICENCE_KEY')\n```\n\n`setLicenseKey` returns a promise that is resolved if the licence key is valid and rejected if it is not. Note that, for testing purpose, you can also use the plugin without a licence key, but it will only work for 60 seconds.\n\n**It is recommended to show a message to users asking them to update the application in case the license has expired.**\n\n### Start the scanner module\n\n```javascript\nval result = await RNGeniusScan.scanWithConfiguration(configuration)\n```\n\nThe method `scanWithConfiguration` takes a `configuration` parameter which can take the following options:\n\n- `source`: `camera` or `image` (defaults to camera)\n- `sourceImageUrl`: an absolute image url, required if `source` is `image`. Example: `file:///var/…/image.png`\n- `multiPage`: boolean (defaults to true). If true, after a page is scanned, a prompt to scan another page will be displayed. If false, a single page will be scanned.\n- `multiPageFormat`: `pdf`, `tiff`, `none` (defaults to `pdf`)\n- `defaultFilter`: `none`, `blackAndWhite`, `monochrome`, `color`, `photo` (by default, the filter is chosen automatically)\n- `pdfPageSize`: `fit`, `a4`, `letter`, defaults to fit.\n- `pdfMaxScanDimension`: max dimension in pixels when images are scaled before PDF generation, for example 2000 to fit both height and width within 2000px. Defaults to 0, which means no scaling is performed.\n- `jpegQuality`: JPEG quality used to compress captured images. Between 0 and 100, 100 being the best quality. Default is 60.\n- `postProcessingActions`: an array with the desired actions to display during the post processing screen (defaults to all actions). Possible actions are `rotate`, `editFilter`.\n- `flashButtonHidden`: boolean (default to false)\n- `defaultFlashMode`: `auto`, `on`, `off` (default to `off`)\n- `foregroundColor`: string representing a color, must start with a `#`. The color of the icons, text (defaults to '#ffffff').\n- `backgroundColor`: string representing a color, must start with a `#`. The color of the toolbar, screen background (defaults to black)\n- `highlightColor`: string representing a color, must start with a `#`. The color of the image overlays (default to blue)\n- `menuColor`: string representing a color, must start with a `#`. The color of the menus (defaults to system defaults.)\n- `ocrConfiguration`: text recognition options. Text recognition will run on a background thread for every captured image. No text recognition will be applied if this parameter is not present.\n    - `languages`: list of language codes (eg `[\"eng\"]`) for which to run text recognition. They should match the provided language files. Note that text recognition will take longer if multiple languages are specified.\n    - `languagesDirectoryUrl`: folder containing the language files used for text recognition. Language files can be downloaded from https://github.com/tesseract-ocr/tessdata_fast.\n\nIt returns a promise with `result` object containing:\n\n- `multiPageDocumentUrl`: a document containing all the scanned pages (example: \"file://<filepath>.pdf\")\n- `scans`: an array of scan objects. Each scan object has:\n    - `originalUrl`: the original file as scanned from the camera. \"file://<filepath>.jpeg\"\n    - `enhancedUrl`: the cropped and enhanced file, as processed by the SDK. \"file://<filepath>.{jpeg|png}\"\n    - `ocrResult`: the result of text recognition for this scan\n        - `text`: the raw text that was recognized\n\n### (Optional) Generate a PDF document from multiple pages\n\nIf you'd like to rearrange the pages returned by the ScanFlow or add some more pages, you can do so and generate a PDF document from these pages:\n\n```javascript\nawait RNGeniusScan.generateDocument(document, configuration)\n```\n\nThe `document` parameter is a map containing the following values:\n\n- `pages`: an array of page objects. Each page object has:\n    - `imageUrl`: the URL of the image file for this page, e.g. `file://<filepath>.{jpeg|png}`\n\nThe `configuration` parameter provides the following options:\n\n- `outputFileUrl`: the URL where the document should be generated, e.g. `file://<filepath>.pdf`\n\n\n## Examples\n\n### Scanning a document from the camera\n\n```javascript\nimport RNGeniusScan from '@thegrizzlylabs/react-native-genius-scan';\n\nRNGeniusScan.setLicenceKey('REPLACE_WITH_YOUR_LICENCE_KEY')\n.then(() => {\n\treturn RNGeniusScan.scanWithConfiguration({ source: 'camera'})\n})\n.then((result) => {\n\t// Do something with the result\n})\n.catch((error) => {\n\t// Handle error\n})\n```\n\n### Cropping and filtering an existing scan\n\n```javascript\nimport RNGeniusScan from '@thegrizzlylabs/react-native-genius-scan';\n\nconst imageUri = 'file://xxxxx' // imageUri from an existing file\n\nRNGeniusScan.setLicenceKey('REPLACE_WITH_YOUR_LICENCE_KEY')\n.then(() => {\n\treturn RNGeniusScan.scanWithConfiguration({ source: 'image', sourceImageUrl: imageUri })\n})\n.then((result) => {\n\t// Do something with the enhanced image\n})\n.catch((error) => {\n\t// Handle error\n})\n```\n\n# FAQ\n\n## How do I get the UI translated to another language?\n\nThe device's locale determines the languages used by the plugin for all strings: user guidance, menus, dialogs…\n\nThe plugin supports a wide variety of languages: English (default), Arabic, Chinese (Simplified), Chinese (Traditional), Danish, Dutch, French, German, Hebrew, Indonesian, Italian, Japanese, Korean, Portuguese, Russian, Spanish, Swedish, Turkish, Vietnamese.\n\nNB: iOS applications must be [localized in XCode by adding each language to the project](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html#//apple_ref/doc/uid/10000171i-CH5-SW2).\n\n## What should I do if my license is invalid?\n\nMake sure that the license key is correct, that is has not expired, and that it is used with the App ID it was generated for. To learn more about the procurement and replacement of license keys, refer to the [Licensing FAQ](https://geniusscansdk.com/license/licensing).\n\n# Changelog\n\nSee [changelog](https://geniusscansdk.com/docs/changelog/)"},"npm":{"downloads":[{"from":"2022-12-11T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":23},{"from":"2022-12-05T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":711},{"from":"2022-11-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":3121},{"from":"2022-09-13T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":12145},{"from":"2022-06-15T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":38009},{"from":"2021-12-12T00:00:00.000Z","to":"2022-12-12T00:00:00.000Z","count":203887}],"starsCount":0},"source":{"files":{"readmeSize":8653,"testsSize":0}}},"evaluation":{"quality":{"carefulness":0.38,"tests":0,"health":1,"branding":0},"popularity":{"communityInterest":0,"downloadsCount":4048.3333333333335,"downloadsAcceleration":-200.49864916286148,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0,"openIssues":0,"issuesDistribution":0}},"score":{"final":0.2692260041930121,"detail":{"quality":0.42499369109833296,"popularity":0.07160351484813028,"maintenance":0.3333333333333333}}}