{"id":15305124,"url":"https://github.com/eddyverbruggen/nativescript-ocr","last_synced_at":"2025-10-08T10:31:32.245Z","repository":{"id":57308671,"uuid":"58479019","full_name":"EddyVerbruggen/nativescript-ocr","owner":"EddyVerbruggen","description":":newspaper: :mag: Tesseract-powered OCR plugin for NativeScript","archived":true,"fork":false,"pushed_at":"2018-09-25T07:37:26.000Z","size":14909,"stargazers_count":39,"open_issues_count":7,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-10T15:46:00.700Z","etag":null,"topics":["nativescript","nativescript-plugin","ocr","optical-character-recognition","tesseract","tesseract-ocr"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-10T17:01:53.000Z","updated_at":"2024-05-30T15:54:12.000Z","dependencies_parsed_at":"2022-08-29T05:00:37.011Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-ocr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-ocr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235706033,"owners_count":19032595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nativescript","nativescript-plugin","ocr","optical-character-recognition","tesseract","tesseract-ocr"],"created_at":"2024-10-01T07:59:19.033Z","updated_at":"2025-10-08T10:31:22.230Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"TypeScript","readme":"# NativeScript OCR\n\n[![Build Status][build-status]][build-url]\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[build-status]:https://travis-ci.org/EddyVerbruggen/nativescript-ocr.svg?branch=master\n[build-url]:https://travis-ci.org/EddyVerbruggen/nativescript-ocr\n[npm-image]:http://img.shields.io/npm/v/nativescript-ocr.svg\n[npm-url]:https://npmjs.org/package/nativescript-ocr\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-ocr.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\n\u003e ⚠️ This repo is hardly maintained - if you want an OCR solution in NativeScript, please consider using [Firebase MLKit](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/ML_KIT.md#text-recognition).\n\n\u003cimg src=\"https://github.com/EddyVerbruggen/nativescript-ocr/raw/master/demo/app/samples/scanned.png\" height=\"440px\"/\u003e \u003cimg src=\"https://github.com/EddyVerbruggen/nativescript-ocr/raw/master/screenshots/ios-scanning.png\" height=\"440px\"/\u003e \u003cimg src=\"https://github.com/EddyVerbruggen/nativescript-ocr/raw/master/screenshots/ios-scanned.png\" height=\"440px\"/\u003e\n\nOptical Character Recognition - powered by Tesseract\n\n## Installation\n```bash\ntns plugin add nativescript-ocr\n```\n\n## Setup\nYou'll need to add language files to help Tesseract recognizing text in the images you feed it.\n\nDownload version 3.04.00 of the tessdata files [here](https://github.com/tesseract-ocr/tessdata/releases/tag/3.04.00) and\nadd your required language to the `app/tesseract/tessdata/` folder of your app.\n\nNote that if your language(s) has multiple files (like English: there's 9 files matching `eng.*`), copy _all_ those files to the folder.\n\n### iOS\niOS searches for the tessdata folder in `app/App_Resources/iOS`, but instead of dulicating the folder\nyou can create a symbolic link:\n\n```bash\ncd app/App_Resources/iOS\nln -s ../../tesseract/tessdata\n```\n\n## API\n\n### `retrieveText`\n\n#### JavaScript\nThis is just a basic example using the default settings, look at the TypeScript code below\nfor a more elaborate example.\n\n```js\nvar OCRPlugin = require(\"nativescript-ocr\");\nvar ocr = new OCRPlugin.OCR();\n\nocr.retrieveText({\n  image: myImage\n}).then(\n    function (result) {\n      console.log(\"Result: \" + result.text);\n    },\n    function (error) {\n      console.log(\"Error: \" + error);\n    }\n);\n```\n\n#### TypeScript\nThis example shows how to use all possible (but optional) options you can pass into `retrieveText`:\n\n```js\nimport { OCR, RetrieveTextResult } from \"nativescript-ocr\";\nimport { ImageSource } from \"image-source\";\n\nexport Class MyOCRClass {\n  private ocr: OCR;\n  \n  constructor() {\n    this.ocr = new OCR();\n  }\n\n  doRecognize(): void {\n    let img: ImageSource = new ImageSource();\n\n    img.fromFile(\"~/samples/scanned.png\").then((success: boolean) =\u003e {\n      if (success) {\n        this.ocr.retrieveText({\n          image: img,\n          whitelist: \"ABCDEF\",     // you can include only certain characters in the result\n          blacklist: \"0123456789\", // .. or you can exclude certain characters from the result\n          onProgress: (percentage: number ) =\u003e {\n            console.log(`Decoding progress: ${percentage}%`);\n          }\n        }).then(\n            (result: RetrieveTextResult) =\u003e {\n              this.set(HelloWorldModel.BUSY_KEY, false);\n              console.log(`Result: ${result.text}`);\n            }, (error: string) =\u003e {\n              console.log(`Error: ${err}`);\n            })\n      }\n    });\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-ocr/lists"}