This demo shows how to use printer by javascript. This usually happens when developing the HTML5 application and webview based application.
Please download here