{"id":20881459,"url":"https://github.com/js-bhavyansh/document_scanner","last_synced_at":"2026-04-12T16:02:54.625Z","repository":{"id":252663072,"uuid":"841049788","full_name":"js-bhavyansh/Document_scanner","owner":"js-bhavyansh","description":"Document scanner app using Google ML Kit and Jetpack Compose for seamless document scanning and image handling.","archived":false,"fork":false,"pushed_at":"2024-08-11T15:25:15.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T10:08:02.441Z","etag":null,"topics":["android","jetpack-compose","kotlin","mlkit-android","mlkit-document-scanner"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-bhavyansh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-11T13:47:06.000Z","updated_at":"2024-08-13T09:09:39.000Z","dependencies_parsed_at":"2024-08-11T16:43:07.607Z","dependency_job_id":"9b5135b5-bd92-4fa1-a94b-0559d7bec8ea","html_url":"https://github.com/js-bhavyansh/Document_scanner","commit_stats":null,"previous_names":["bhavyansh03-tech/document_scanner","js-bhavyansh/document_scanner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FDocument_scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FDocument_scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FDocument_scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FDocument_scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bhavyansh","download_url":"https://codeload.github.com/js-bhavyansh/Document_scanner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258498,"owners_count":20262300,"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":["android","jetpack-compose","kotlin","mlkit-android","mlkit-document-scanner"],"created_at":"2024-11-18T07:24:56.833Z","updated_at":"2025-10-16T13:33:15.764Z","avatar_url":"https://github.com/js-bhavyansh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document Scanner with Google ML Kit and Jetpack Compose\nIntegrate document scanning functionality into your Android app using Google ML Kit and Jetpack Compose.\n\n## Features\n- Scans documents using Google ML Kit's Document Scanner.\n- Supports JPEG and PDF formats.\n- Customizable scanner options (page limit, scanner mode, etc.).\n- Simple and user-friendly UI with Jetpack Compose.\n\n## Screenshot\n\u003cimg src=\"https://github.com/user-attachments/assets/ad4eaa67-ced9-4031-9336-bf5674829469\" alt=\"First Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/c13d8917-60c0-4e4c-8f2c-c54da33a9051\" alt=\"Second Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/230b31f9-ee2d-435a-bbaf-ecca58c34fee\" alt=\"Third Screenshot\" style=\"width: 200px; height: auto;\"\u003e\n  \n## Getting Started\n### Installation\n\n1. Clone the repository:\n\n   ```sh\n     git clone https://github.com/Bhavyansh03-tech/Document_scanner.git\n   ```\n   \n2. Open the project in Android Studio.\n3. Build the project and run it on an emulator or a physical device.\n\n### Setup\n1. **Dependencies**\nAdd the following dependencies to your `build.gradle` file:\n  ```kotlin\n    implementation 'com.google.mlkit:document-scanner:16.0.0-beta1'\n    implementation 'io.coil-kt:coil-compose:2.7.0'\n  ```\n\n2. **Usage**\nHere's the code to implement the document scanner:\n```kotlin\nval options = GmsDocumentScannerOptions.Builder()\n    .setGalleryImportAllowed(false)\n    .setResultFormats(\n        GmsDocumentScannerOptions.RESULT_FORMAT_JPEG,\n        GmsDocumentScannerOptions.RESULT_FORMAT_PDF\n    )\n    .setPageLimit(2)\n    .setScannerMode(SCANNER_MODE_FULL)\n    .build()\n\nvar selectedImageUri by remember {\n    mutableStateOf(Uri.EMPTY)\n}\n\nval scanner = GmsDocumentScanning.getClient(options)\n\nval scannerLauncher = rememberLauncherForActivityResult(\n    contract = ActivityResultContracts.StartIntentSenderForResult()\n) { result -\u003e\n    if (result.resultCode == RESULT_OK) {\n        val scannerResult =\n            GmsDocumentScanningResult.fromActivityResultIntent(result.data)\n\n        scannerResult?.pages?.let { pages -\u003e\n            for (page in pages) {\n                selectedImageUri = pages[0].imageUri\n            }\n        }\n    }\n}\n\n// Context\nval context = LocalContext.current as Activity\n\nColumn(\n    modifier = Modifier.fillMaxSize(),\n    verticalArrangement = Arrangement.Center,\n    horizontalAlignment = Alignment.CenterHorizontally\n) {\n    AsyncImage(\n        model = selectedImageUri,\n        contentDescription = null,\n        contentScale = ContentScale.Crop, modifier = Modifier.size(200.dp)\n    )\n\n    Spacer(modifier = Modifier.height(10.dp))\n\n     Button(onClick = {\n         scanner.getStartScanIntent(context)\n             .addOnSuccessListener { intentSender -\u003e\n                 scannerLauncher.launch(\n                     IntentSenderRequest\n                         .Builder(intentSender)\n                         .build()\n                 )\n             }\n     }) {\n         Text(text = \"Start Scanning\")\n     }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n## Contact\n\nFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fdocument_scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bhavyansh%2Fdocument_scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fdocument_scanner/lists"}