{"id":27949095,"url":"https://github.com/recs182/react-native-datecs-printer","last_synced_at":"2025-10-20T09:08:30.761Z","repository":{"id":19286085,"uuid":"84979634","full_name":"recs182/react-native-datecs-printer","owner":"recs182","description":"A port of https://github.com/giorgiofellipe/cordova-plugin-datecs-printer/ for React Native.","archived":false,"fork":false,"pushed_at":"2022-12-04T12:36:14.000Z","size":576,"stargazers_count":10,"open_issues_count":8,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T15:19:48.864Z","etag":null,"topics":["bluetooth","datecs","printer","react-native","thermal-printer"],"latest_commit_sha":null,"homepage":"","language":"Java","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/recs182.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-14T17:45:11.000Z","updated_at":"2022-02-28T16:00:40.000Z","dependencies_parsed_at":"2023-01-14T07:00:17.136Z","dependency_job_id":null,"html_url":"https://github.com/recs182/react-native-datecs-printer","commit_stats":null,"previous_names":["renancsoares/react-native-datecs-printer"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recs182%2Freact-native-datecs-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recs182%2Freact-native-datecs-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recs182%2Freact-native-datecs-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recs182%2Freact-native-datecs-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recs182","download_url":"https://codeload.github.com/recs182/react-native-datecs-printer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902620,"owners_count":21822263,"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":["bluetooth","datecs","printer","react-native","thermal-printer"],"created_at":"2025-05-07T15:19:54.627Z","updated_at":"2025-10-20T09:08:25.726Z","avatar_url":"https://github.com/recs182.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-datecs-printer\n\nIt only **works on Android**.\n\n## As I made this project with a very short deadline, it's specific for the app that I was working on and it might not be suitable for you, although fell free to fork and modify it.\n\n#### Breaking Changes [RN v0.47.2](https://github.com/facebook/react-native/releases/tag/v0.47.2)\nRemove unused createJSModules calls.\n\n- if on RN \u003c 0.47.2 `npm i react-native-datecs-printer@0.1.1`\n- if on RN \u003e 0.47.2 `npm i react-native-datecs-printer`\n\n### Printer used for tests\nDPP 250\n\n---\n\n## Getting started (latest version)\n\n`$ npm install react-native-datecs-printer --save`\n\n### Mostly automatic installation\n\n`$ react-native link react-native-datecs-printer`\n\n### Add permissions in your AndroidManifest.xml\n```\n\u003cuses-permission android:name=\"android.permission.BLUETOOTH\"/\u003e\n\u003cuses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/\u003e\n```\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.renancsoares.datecsprinter.RNDatecsPrinterPackage;` to the imports at the top of the file\n  - Add `new RNDatecsPrinterPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-datecs-printer'\n  \tproject(':react-native-datecs-printer').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-datecs-printer/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-datecs-printer')\n  \t```\n\n### Examples of methods in your application.\n**It's also provided in the application example**\n```\nconnect(){\n\tDatecsPrinter.connect()\n\t.then( res =\u003e {\n\t\t// return CONNECTED\n\t\tconsole.log(res);\n\t})\n\t.catch( err =\u003e {\n\t\tconsole.log(err)\n\t})\n}\n\nprint(text){\n\tDatecsPrinter.printText(text)\n\t.then( res =\u003e {\n\t\t// return PRINTED\n\t\tconsole.log(res);\n\t})\n\t.catch( err =\u003e {\n\t\tconsole.log(err);\n\t})\n}\n\nprintSelfTest(){\n\tDatecsPrinter.printSelfTest()\n\t.then( res =\u003e {\n\t\t// return SELF_TEST_PRINTED\n\t\tconsole.log(res)\n\t})\n\t.catch( err =\u003e {\n\t\tconsole.log(err);\n\t});\n}\n\ngetStatus(){\n\tDatecsPrinter.getStatus()\n\t.then( res =\u003e {\n\t\t// If everything is OK, it'll return 0\n\t\t// you can use this before printing to make sure that nothing wrong happens\n\t\tconsole.log(res);\n\t})\n\t.catch( err =\u003e {\n\t\tconsole.log(err)\n\t})\n}\n\ndisconnect(){\n\tDatecsPrinter.disconnect()\n\t.then( res =\u003e {\n\t\t// return DISCONNECTED\n\t\tconsole.log(res);\n\t})\n\t.catch( err =\u003e {\n\t\tconsole.log(err);\n\t})\n}\n```\n\n### Tags definition\n- `{reset}`\t    Reset to default settings.\n- `{br}`\t    Line break. Equivalent of new line.\n- `{b}, {/b}`\tSet or clear bold font style.\n- `{u}, {/u}`\tSet or clear underline font style.\n- `{i}, {/i}`\tSet or clear italic font style.\n- `{s}, {/s}`\tSet or clear small font style.\n- `{h}, {/h}`\tSet or clear high font style.\n- `{w}, {/w}`\tSet or clear wide font style.\n- `{left}`\t    Aligns text to the left paper edge.\n- `{center}`\tAligns text to the center of paper.\n- `{right}`\t    Aligns text to the right paper edge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecs182%2Freact-native-datecs-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecs182%2Freact-native-datecs-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecs182%2Freact-native-datecs-printer/lists"}