{"id":24340931,"url":"https://github.com/asutosh11/documentreader","last_synced_at":"2025-09-28T02:30:45.038Z","repository":{"id":43037383,"uuid":"282697777","full_name":"Asutosh11/DocumentReader","owner":"Asutosh11","description":"This library reads word documents (.doc and .docx), txt and PDF files, and gives the output content of the document as a String.","archived":false,"fork":false,"pushed_at":"2023-01-27T18:07:33.000Z","size":175,"stargazers_count":97,"open_issues_count":0,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-08T22:22:25.451Z","etag":null,"topics":["android-library","docparser","docx","filereader","kotlin","kotlin-android","pdf","pdf-document","pdfreader","txtreader"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Asutosh11.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":"2020-07-26T17:18:18.000Z","updated_at":"2025-01-07T03:17:17.000Z","dependencies_parsed_at":"2023-02-15T11:46:50.107Z","dependency_job_id":null,"html_url":"https://github.com/Asutosh11/DocumentReader","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/Asutosh11%2FDocumentReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asutosh11%2FDocumentReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asutosh11%2FDocumentReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asutosh11%2FDocumentReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asutosh11","download_url":"https://codeload.github.com/Asutosh11/DocumentReader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234475378,"owners_count":18839363,"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-library","docparser","docx","filereader","kotlin","kotlin-android","pdf","pdf-document","pdfreader","txtreader"],"created_at":"2025-01-18T07:13:00.802Z","updated_at":"2025-09-28T02:30:39.737Z","avatar_url":"https://github.com/Asutosh11.png","language":"Kotlin","readme":"[![](https://jitpack.io/v/Asutosh11/DocumentReader.svg)](https://jitpack.io/#Asutosh11/DocumentReader)\n[![API](https://img.shields.io/badge/API-5%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=5)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DocumentReader-blue.svg?style=flat)](https://android-arsenal.com/details/1/8136)\n\n\n# DocumentReader\n \nThis library reads word documents (.doc and .docx), txt and PDF files, and gives the output content of the document as a String.\n\n\u003ci\u003eIf you have ever tried to read contents of a PDF or MS word document on Android, you know how painful it is. \nThis library makes your work easy.\u003c/i\u003e\n\n\u003cbr\u003e\u003ch3\u003e\u003cb\u003eDependency for build.gradle (Project level)\u003c/b\u003e\u003c/h3\u003e\n```\nrepositories {\n  ...\n  maven { url 'https://jitpack.io' }\n}\n```\n\u003cbr\u003e\u003ch3\u003e\u003cb\u003eDependency for build.gradle (Module: app)\u003c/b\u003e\u003c/h3\u003e\n```\ndependencies {\n  ....\n  implementation 'com.github.Asutosh11:DocumentReader:0.12'\n  \n  // NOTE: use this only if you get a multidex exception\n  implementation \"androidx.multidex:multidex:2.0.1\"\n}\n```\n\n```\n// NOTE: use this only if you get an error like - More than one file was found with OS independent path\npackagingOptions {\n   exclude 'META-INF/DEPENDENCIES'\n   exclude 'META-INF/INDEX.LIST'\n   exclude 'META-INF/spring.handlers'\n   exclude 'META-INF/spring.schemas'\n   exclude 'META-INF/cxf/bus-extensions.txt'\n}\n```\n\n```\n// NOTE: use this only if you get a multidex exception\ndefaultConfig {\n   ...\n   multiDexEnabled true\n}\n```\n\n\u003cbr\u003e\u003ch3\u003e\u003cb\u003eHow to use it?\u003c/b\u003e\u003c/h3\u003e\n\n```\n// Read a pdf file from Uri\nval docString : String = DocumentReaderUtil.readPdfFromUri(fileUri, applicationContext)\n// Read a pdf file from File\nval docString : String = DocumentReaderUtil.readPdfFromFile(file, applicationContext)\n```\n\n```\n// read a doc file from Uri\nval docString : String = DocumentReaderUtil.readWordDocFromUri(fileUri, applicationContext)\n// read a doc file from File\nval docString : String = DocumentReaderUtil.readWordDocFromFile(file, applicationContext)\n```\n\n```\n// read a docx file from Uri\nval docString : String = DocumentReaderUtil.readWordDocFromUri(fileUri, applicationContext)\n// read a docx file from File\nval docString : String = DocumentReaderUtil.readWordDocFromFile(file, applicationContext)\n```\n\n```\n// read a txt file from Uri\nval docString : String = DocumentReaderUtil.readTxtFromUri(fileUri, applicationContext)\n```\n\n```    \n/*\n Even if you don't know your file type, \n this library detects the file mime type and gives you the content of the file as a String\n*/\nval docString : String = when (DocumentReaderUtil.getMimeType(fileUri, applicationContext)) {\n        \"text/plain\" -\u003e DocumentReaderUtil.readTxtFromUri(fileUri, applicationContext)\n        \"application/pdf\" -\u003e DocumentReaderUtil.readPdfFromUri(fileUri, applicationContext)\n        \"application/msword\" -\u003e DocumentReaderUtil.readWordDocFromUri(fileUri, applicationContext)\n        \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" -\u003e \n                                        DocumentReaderUtil.readWordDocFromUri(fileUri, applicationContext)\n         else -\u003e \"\"\n\t }\n```\n\u003cbr\u003e\n\u003ch2\u003e\u003cb\u003eThanks\u003c/b\u003e\u003c/h2\u003e\n\u003ca href = \"https://tika.apache.org/\"\u003eThe Apache Tika project\u003c/a\u003e\u003cbr\u003e\n\u003ca href = \"https://github.com/TomRoush/PdfBox-Android\"\u003eApache's PdfBox port by TomRoush\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasutosh11%2Fdocumentreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasutosh11%2Fdocumentreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasutosh11%2Fdocumentreader/lists"}