PRINTER
This class provides functions that check current system support for printing, prints image file on local or remote(http) storage, activate printing screen.
This class provides methods that check whether the current printer is available or not, print image file on local or remote(http) storage and activate printing screen and, etc.
Add the following line for printer class into a html file your own : <script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js"></script> |
You can declare printer class like this : ex) var printer = deviceapis.printer; |
Methods
isPrintingServiceSupported | ||
Description | ||
Returns a boolean value indicating current system support for printing. | ||
Parameters | none | |
Return | ■Boolean - true : supports printing - false : otherwise | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
deviceapis.printer.isPrintingServiceSupported(); |
runFilePrinting | ||
Description | ||
The application can prints image file on local or remote(http) storage with this API. When the application call this API, the dialog for printing will be displayed. | ||
Parameters | ■filePath - DOMString - file path for printing(http URL or local file - relative path from the application directory) | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
deviceapis.printer.runFilePrinting('file://image/testImage.jpeg'); deviceapis.printer.runFilePrinting('http://test.co.kr/testImage.jpeg'); |
runScreenPrinting | ||
Description | ||
Activates screen printing. After activating screen printing module, user can select printing option and print the screen. | ||
Parameters | ■screen - PRINT_SCREEN_LAYER_TYPE - print screen layer(PRINT_SCREEN_LAYER_ALL, SCREEN_LAYER_OSD) ■rect - SRect - print area demarcated by top left and bottom right coordinate | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
SRect printRect = new SRect(0, 0, curWidget.width, curWidget.height); deviceapis.printer.runScreenPrinting(deviceapis.printer.PRINT_SCREEN_LAYER_ALL, printRect); |