{"id":19250887,"url":"https://github.com/willpowell8/ktstarreceiptprinter","last_synced_at":"2025-02-23T16:37:56.944Z","repository":{"id":143951868,"uuid":"170623815","full_name":"willpowell8/KTStarReceiptPrinter","owner":"willpowell8","description":null,"archived":false,"fork":false,"pushed_at":"2019-02-14T03:57:28.000Z","size":17740,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T06:28:35.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/willpowell8.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-02-14T03:54:01.000Z","updated_at":"2019-02-14T03:56:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8170438-9a58-4b37-bbd8-fba1db8b2aae","html_url":"https://github.com/willpowell8/KTStarReceiptPrinter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willpowell8%2FKTStarReceiptPrinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willpowell8%2FKTStarReceiptPrinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willpowell8%2FKTStarReceiptPrinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willpowell8%2FKTStarReceiptPrinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willpowell8","download_url":"https://codeload.github.com/willpowell8/KTStarReceiptPrinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347760,"owners_count":19787230,"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":[],"created_at":"2024-11-09T18:19:13.736Z","updated_at":"2025-02-23T16:37:56.939Z","avatar_url":"https://github.com/willpowell8.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RMLStarReceiptPrinter\n\n[![Build Status](https://travis-ci.org/relishapps/RMLStarReceiptPrinter.svg?branch=master)](https://travis-ci.org/relishapps/RMLStarReceiptPrinter)\n[![Version](https://img.shields.io/cocoapods/v/RMLStarReceiptPrinter.svg?style=flat)](http://cocoapods.org/pods/RMLStarReceiptPrinter)\n[![License](https://img.shields.io/cocoapods/l/RMLStarReceiptPrinter.svg?style=flat)](http://cocoapods.org/pods/RMLStarReceiptPrinter)\n[![Platform](https://img.shields.io/cocoapods/p/RMLStarReceiptPrinter.svg?style=flat)](http://cocoapods.org/pods/RMLStarReceiptPrinter)\n\n## Introduction\n\nA wrapper for StarIO SDK that makes printing receipts a breeze.\n\n## Features\n\n- Works with SM-S220i and similar\n- Support for 2 inch-wide paper\n- Text print with styling: emphasis, alignment, character expansion, various character sets\n\n## Installation\n\nRMLStarReceiptPrinter is available through [CocoaPods](http://cocoapods.org). To install it:\n\n1. Add the following line to your Podfile:\n\n    ```objective-c\n    pod \"RMLStarReceiptPrinter\"\n    ```\n\n2. Run `pod install`.\n3. Open your `Info.plist` file and add the `jp.star-m.starpro` to `Supported external accessory protocols`.\n\nTo run the example project, clone the repo, and run `pod install` from the `Example` directory.\n\n## Usage\n\nTo use RMLStarReceiptPrinter in your existing project, once you've installed it, add `#import \"RMLStarReceiptPrinter.h\"` to the header file where you want to use it, and initialise it.\n\nInitialise with default device (factory name):\n\n```objective-c\nRMLStarReceiptPrinter *printer = [RMLStarReceiptPrinter new];\n```\n\nInit with specific RMLStarReceiptPrinterDevice:\n\n```objective-c\nRMLStarReceiptPrinter *printer = [RMLStarReceiptPrinter printerWithDevice:device];\n```\n\nAn `NSArray` of available devices can be fetched by:\n\n```objective-c\nNSArray *devices = [RMLStarReceiptPrinter availableDevices];\n```\n\nTo send text to the print buffer:\n\n```objective-c\n[printer sendText:@\"Hello, world!\"];\n```\n\nAnd to send the buffer to the printer:\n\n```objective-c\n[printer print];\n```\n\n## RMLStarReceiptPrinter Methods\n\n### init\n```objective-c\n- (instancetype)init;\n```\n\n##### Return Value\n\nAn instance of RMLStarReceiptPrinter.\n\n##### Description\n\nUsed to initialize the printer instance with a default device (one with factory name).\n\n### initWithDevice\n```objective-c\n- (instancetype)initWithDevice:(RMLStarReceiptPrinterDevice*)device;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\u003cdt\u003edevice\u003c/dt\u003e\n\u003cdd\u003einstance of an RMLStarReceiptPrinterDevice object\u003c/dd\u003e\n\u003c/dl\u003e\n\n##### Return Value\n\ninstance type of RMLStarReceiptPrinter\n\n##### Description\n\nUsed to initialize the printer instance with a specific device\n\n\n\n### availableDevices\n```objective-c\n+ (NSArray *)availableDevices;\n```\n\n##### Return Value\n\nAn array of RMLStarReceiptPrinterDevice objects\n\n##### Description\n\nSearches both Bluetooth and LAN networks for available printing devices\n\n\n\n### print\n\n```objective-c\n- (BOOL)print;\n```\n\n##### Return Value\n\na bool value based on the success of the pritner printing the receipt\n\n##### Description\n\nThe main method used to tell the printer to print the receipt\n\n\n\n### sendSeparator\n\n```objective-c\n- (void)sendSeparator;\n```\n\n##### Description\n\nSends a string of 32 hyphens ('-') to the printer, followed by a line break to help separate items on the receipt.\n\n\n\n### sendText:\n\n```objective-c\n- (void)sendText:(NSString *)text;\n```\n\n##### Parameters\n\n\n\u003cdl\u003e\n\n\u003cdt\u003etext\u003c/dt\u003e\n\n\u003cdd\u003e\n\nan NSString for the printer to print\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n\n##### Description\n\nUsed to send a single line of text to the printer to print.\n\n**WARNING:**\n\nFormat the text before you use this method (i.e. send all emphasis and alignment before ```sendtext:```)\n\n\n\n### setCharacterExpansion:\n\n```objective-c\n- (void)setCharacterExpansion:(RMLStarReceiptPrinterCharacterExpansion)expansion;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003eexpansion\u003c/dt\u003e\n\n\u003cdd\u003e\n\none of the RMLStarReceiptPrinterCharacterExpansion options\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n\n##### Description\n\nUsed to set the size of the characters you send to the printer\n\n\n\n### setCharacterSet:\n\n```objective-c\n- (void)setCharacterSet:(RMLStarReceiptPrinterCharacterSet)characterSet;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003echaracterSet\u003c/dt\u003e\n\n\u003cdd\u003e\n\nRMLStarReceiptPrinterCharacterSet on the character set you want\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nSet the character encoding set\n\n\n\n### setTextAlignment:\n\n```objective-c\n- (void)setTextAlignment:(RMLStarReceiptPrinterTextAlignment)alignment;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003ealignment\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe alignment that you want to set (as RMLStarReceiptPrinterTextAlignment)\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nAdjust the alignment of the text on the receipt\n\n\n\n### setTextEmphasis:\n\n```objective-c\n- (void)setTextEmphasis:(RMLStarReceiptPrinterTextEmphasis)emphasis;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003eemphasis\u003c/dt\u003e\n\n\u003cdd\u003e\n\nRMLStarReceiptPrinterTextEmphasisIsOff, RMLStarReceiptPrinterTextEmphasisIsOn\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nUsing the RMLStarReceiptPrinterTextEmphasis, you can set whether the following test is emphasised or not\n\n\n\n### starIOVersion\n\n```objective-c\n+ (NSString *)starIOVersion;\n```\n\n##### Return Value\n\nan NSString value of the StarIO framework version number\n\n##### Description\n\nReturns the current version of the StarIO framework in use\n\n\n\n### status\n\n```objective-c\n- (RMLStarReceiptPrinterStatus)status;\n```\n\n##### Return Value\n\nThe printer's current status (as RMLStarReceiptPrinterStatus)\n\n##### Description\n\nReturns the current status of the printer (Read-only)\n\n\n\n### RMLStarReceiptPrinterCharacterExpansion\n\n```objective-c\ntypedef NS_ENUM(char, RMLStarReceiptPrinterCharacterExpansion){  \nRMLStarReceiptPrinterCharacterExpansionNone = 0,  RMLStarReceiptPrinterCharacterExpansionSingleWidthDoubleHeight =\n(\n1 \u003c\u003c 0)|( 0),  RMLStarReceiptPrinterCharacterExpansionDoubleWidthDoubleHeight =\n(\n1 \u003c\u003c 0)|(\n1 \u003c\u003c 4) \n};\n```\n##### Constants\n\n\u003cdl\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterExpansionNone\u003c/dt\u003e\n\n\u003cdd\u003e\n\nResets to default width and height\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterExpansionSingleWidthDoubleHeight\u003c/dt\u003e\n\n\u003cdd\u003e\n\nMakes characters double height, but maintains width\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterExpansionDoubleWidthDoubleHeight\u003c/dt\u003e\n\n\u003cdd\u003e\n\nMakes characters double height and width\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nAn option for changing the height and/or width of the next charaters sent to the printer\n\n\n\n\n### RMLStarReceiptPrinterCharacterSet\n\n```objective-c\ntypedef NS_ENUM(char, RMLStarReceiptPrinterCharacterSet){  \nRMLStarReceiptPrinterCharacterSetUSA,  RMLStarReceiptPrinterCharacterSetFrance,  \nRMLStarReceiptPrinterCharacterSetGermany,  RMLStarReceiptPrinterCharacterSetUK,  \nRMLStarReceiptPrinterCharacterSetDenmark,  RMLStarReceiptPrinterCharacterSetSweden,  \nRMLStarReceiptPrinterCharacterSetItaly,  RMLStarReceiptPrinterCharacterSetSpain,  \nRMLStarReceiptPrinterCharacterSetJapan,  RMLStarReceiptPrinterCharacterSetNorway,  \nRMLStarReceiptPrinterCharacterSetDenmark2 \n};\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetUSA\u003c/dt\u003e\n\n\u003cdd\u003e\n\nUSA character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetFrance\u003c/dt\u003e\n\n\u003cdd\u003e\n\nFrance character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetGermany\u003c/dt\u003e\n\n\u003cdd\u003e\n\nGermany character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetUK\u003c/dt\u003e\n\n\u003cdd\u003e\n\nUK character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetDenmark\u003c/dt\u003e\n\n\u003cdd\u003e\n\nDenmark character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetSweden\u003c/dt\u003e\n\n\u003cdd\u003e\n\nSweden character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetItaly\u003c/dt\u003e\n\n\u003cdd\u003e\n\nItaly character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetSpain\u003c/dt\u003e\n\n\u003cdd\u003e\n\nSpain character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetJapan\u003c/dt\u003e\n\n\u003cdd\u003e\n\nJapan character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetNorway\u003c/dt\u003e\n\n\u003cdd\u003e\n\nNorway character set\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterCharacterSetDenmark2\u003c/dt\u003e\n\n\u003cdd\u003e\n\nDenmark 2 character set\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nValues to set the character set of the next text sent to the printer to.\n\n\n\n### RMLStarReceiptPrinterStatus\n\n```objective-c\ntypedef NS_ENUM(char, RMLStarReceiptPrinterStatus){  \nRMLStarReceiptPrinterStatusOffline,  RMLStarReceiptPrinterStatusOfflineCoverOpen,  \nRMLStarReceiptPrinterStatusOfflineOutOfPaper,  RMLStarReceiptPrinterStatusOnline,  \nRMLStarReceiptPrinterStatusError \n};\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003e\u003cRMLStarReceiptPrinterStatusOffline\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe printer is either powered off, or not connected to the device\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterStatusOfflineCoverOpen\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe printer cover is open\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterStatusOfflineOutOfPaper\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe printer is out of paper\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterStatusOnline\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe printer is online and ready to be used\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterStatusError\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe printer has an error\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n\n##### Description\n\nThe current status of the printer\n\n\n\n### RMLStarReceiptPrinterTextAlignment\n\n```objective-c\ntypedef NS_ENUM(char, RMLStarReceiptPrinterTextAlignment){  \nRMLStarReceiptPrinterTextAlignmentLeft = 0,  RMLStarReceiptPrinterTextAlignmentCenter = \n1,  RMLStarReceiptPrinterTextAlignmentRight = 2 \n};\n```\n\n##### Constants\n\n\u003cdl\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterTextAlignmentLeft\u003c/a\u003e\u003c/dt\u003e\n\n\u003cdd\u003e\n\nLeft alignment\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterTextAlignmentCenter\u003c/a\u003e\u003c/dt\u003e\n\n\u003cdd\u003e\n\nCenter alignment\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterTextAlignmentRight\u003c/a\u003e\u003c/dt\u003e\n\n\u003cdd\u003e\n\nRight alignment\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nValues to set the alignment of next text sent to the printer.\n\n\n\n### RMLStarReceiptPrinterTextEmphasis\n\n```objective-c\ntypedef NS_ENUM(char, RMLStarReceiptPrinterTextEmphasis){  \nRMLStarReceiptPrinterTextEmphasisOff = 0,  RMLStarReceiptPrinterTextEmphasisOn = \n1 \n};\n```\n\n##### Constants\n\n\u003cdl\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterTextEmphasisOff\u003c/a\u003e\u003c/dt\u003e\n\n\u003cdd\u003e\n\nTurns off the emphasis\n\n\u003c/dd\u003e\n\n\u003cdt\u003eRMLStarReceiptPrinterTextEmphasisOn\u003c/a\u003e\u003c/dt\u003e\n\n\u003cdd\u003e\n\nTurns on the emphasis\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n##### Description\n\nEqual to setting the text to bold.\n\n* * *\n## RMLStarReceiptPrinterDevice Methods\n\n### defaultDevice\n```objective-c\n+ (RMLStarReceiptPrinterDevice*)defaultDevice;\n```\n##### Return Value\n\ninstance of RMLStarReceiptPrinterDevice with portName \"BT:PRNT Star\"\n\n##### Description\n\nA class method to return a device with portName \"BT:PRNT Star\"\n\n\n\n### initWithPortName:macAddess:modelName:\n\n```objective-c\n- (instancetype)initWithPortName:(NSString *)portName \nmacAddess:(NSString *)macAddress modelName:(NSString *)modelName;\n```\n\n##### Parameters\n\n\u003cdl\u003e\n\n\u003cdt\u003eportName\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe full 'portName' for the device e.g. \"BT:PRNT Star\" (required)\n\n\u003c/dd\u003e\n\n\u003cdt\u003emacAddress\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe MAC address (optional)\n\n\u003c/dd\u003e\n\n\u003cdt\u003emodelName\u003c/dt\u003e\n\n\u003cdd\u003e\n\nThe model name (optional)\n\n\u003c/dd\u003e\n\n\u003c/dl\u003e\n\n\n##### Return Value\n\ninstance of RMLStarReceiptPrinterDevice\n\n##### Description\n\nAn init method to set all properties\n\n\n\n## RMLStarReceiptPrinterDevice properties\n\n### macAddress\n\n```objective-c\n@property NSString *macAddress;\n```\n\n##### Description\n\nThe MAC address of the device\n\n\n\n### modelName\n\n```objective-c\n@property NSString *modelName;\n```\n\n##### Description\n\nThe model name of the device\n\n### portName\n\n```objective-c\n@property NSString *portName;\n```\n\n##### Description\n\nThe 'portName' of the device e.g. \"BT:PRNT Star\"\n* * *\n\n## Planned improvements\n\n- Various widths of paper\n- Image printing\n\n## Authors\n\n- Pawel Decowski: pawel@relish.io\n- Dan Sinclair: dan@relish.io\n\n## License\n\nRMLStarReceiptPrinter is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillpowell8%2Fktstarreceiptprinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillpowell8%2Fktstarreceiptprinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillpowell8%2Fktstarreceiptprinter/lists"}