{"id":21903858,"url":"https://github.com/hansemannn/titanium-scanner","last_synced_at":"2025-04-15T20:44:16.947Z","repository":{"id":44392581,"uuid":"207165463","full_name":"hansemannn/titanium-scanner","owner":"hansemannn","description":"Use the iOS 13+ \"VisionKit\" document scanner API in Appcelerator Titanium.","archived":false,"fork":false,"pushed_at":"2023-06-12T08:40:48.000Z","size":15676,"stargazers_count":18,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T01:12:02.760Z","etag":null,"topics":["appcelerator","axway","document-scanner","ios13","titanium","visionkit"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"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/hansemannn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-08T19:52:08.000Z","updated_at":"2023-07-09T18:42:22.000Z","dependencies_parsed_at":"2024-11-28T15:32:46.682Z","dependency_job_id":"57db99dc-7435-46f5-b81f-7fce008c6fb8","html_url":"https://github.com/hansemannn/titanium-scanner","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansemannn","download_url":"https://codeload.github.com/hansemannn/titanium-scanner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249151985,"owners_count":21221160,"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":["appcelerator","axway","document-scanner","ios13","titanium","visionkit"],"created_at":"2024-11-28T15:29:49.414Z","updated_at":"2025-04-15T20:44:16.925Z","avatar_url":"https://github.com/hansemannn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Titanium iOS 13+ Document Scanner\n\nUse the iOS 13+ `VisionKit` document scanner API in Appcelerator Titanium. Pro tip: Combine with\n[Ti.Vision](https://github.com/hansemannn/titanium-vision) to apply machine learning to the detected\ndocument.\n\n\u003cimg src=\"./example.gif\" width=\"400\" /\u003e\n\n## Requirements\n\n- [x] iOS 13+\n- [x] Titanium SDK 8.2.0+\n- [x] Granted camera permissions\n\n## APIs\n\n### Methods\n\n- [x] `showScanner`\n- [x] `imageOfPageAtIndex(index)` (after the `success` event)\n- [x] `pdfOfPageAtIndex(index)` (after the `success` event)\n- [x] `pdfOfAllPages(params)` (after the `success` event - the params include `resizeImages` and `padding` to be used to generate resized A4 PDF's)\n\n### Events\n\n- [x] `success`\n- [x] `error`\n- [x] `cancel`\n\n## Example\n\n```js\nimport Scanner from 'ti.scanner';\n\nconst win = Ti.UI.createWindow({\n    backgroundColor: '#fff'\n});\n\nconst btn = Ti.UI.createButton({\n    title: 'Scan Document'\n});\n\nbtn.addEventListener('click', () =\u003e {\n    Ti.Media.requestCameraPermissions(event =\u003e {\n        if (!event.success) {\n            alert('No camera permissions');\n            return;\n        }\n        Scanner.showScanner();\n    });\n});\n\nScanner.addEventListener('cancel', () =\u003e {\n    Ti.API.warn('Cancelled …');\n});\n\nScanner.addEventListener('error', event =\u003e {\n    Ti.API.error('Errored …');\n    Ti.API.error(event.error);\n});\n\nScanner.addEventListener('success', event =\u003e {\n    Ti.API.warn('Succeeded …');\n    Ti.API.warn(event);\n\n    const win2 = Ti.UI.createWindow({\n        backgroundColor: '#333'\n    });\n\n    const image = Ti.UI.createImageView({\n        height: '70%',\n        image: Scanner.imageOfPageAtIndex(0) /* Or pdfOfPageAtIndex(0) if you need the PDF of it, or many images via \"event.count\" */\n    });\n\n    win2.add(image);\n    win2.open();\n});\n\nwin.add(btn);\nwin.open();\n```\n\n## License\n\nMIT\n\n## Author\n\nHans Knöchel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansemannn%2Ftitanium-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-scanner/lists"}