cordova_plugin_gcprint
v1.0.11
Published
Print service plugin for goodcom machine
Maintainers
Readme
cordova_plugin_gcprint SDK
About
This plugin is designed for Goodcom Android POS terminals (Refer to here for the machine details.). It provides a Cordova interface to print text, HTML, BMP images.
Installation
Add the plugin to your Cordova project:
cordova plugin add cordova_plugin_gcprintAPI Reference
All APIs are accessed via cordova.plugins.GcPrintPlugin.
The print plugin provides 4 function: (1):Print string. (2):Print html (provide a URL or content) (3):Print BMP (manually select the image in the file explore). (4):Print BMP (provide the URI of the image).
1. printHtml
Usage:
cordova.plugins.GcPrintPlugin.printHtml(url, htmlString, width, timeOutTime, bTimeOutPrint, setCancelable, successCallback, errorCallback);Description: Print content in HTML format.
Callback function is a prompt to send a print message.
url: - Reserved; the input parameter is fixed as an empty string.
htmlString: - The text content of the HTML.
eg. <html>
<head><meta charset="utf-8">
<script type="text/javascript" src="cordova.js"></script>
</head><body>
<p>This is the print content</p>
</body>
width: - Reserved; the input parameter is fixed at 0.
timeOutTime: - Page load timeout(s).Setting 0 is not enabled
bTimeOutPrint: - Reserved; currently unused,fixed to true.
setCancelable: - Reserved; currently unused,fixed to true.2. printString
Usage:
cordova.plugins.GcPrintPlugin.printString(message, successCallback, errorCallback);Description: Print the string content. Callback function is a prompt to send a print message. message - The string will be sent to the printer.
3. printBmp
cordova.plugins.GcPrintPlugin.printBmp(successCallback, errorCallback);Description: Print bitmap Callback function is a prompt to send a print message.
4. printBmpUri
Usage:
cordova.plugins.GcPrintPlugin.printBmpUri(uri, successCallback, errorCallback);Description: Print bitmap by uri Callback function is a prompt to send a print message. uri - The storage location of the local picture or network address URL. eg. file://storage/emulated/0/xxxx/xx.png content://com.android.providers.media.documents/document/image%3A16 http://xxxxx/xxx.jpg
