Skip to Content
Author's profile photo Daniel Van Leeuwen

Getting Started with Kapsel – Part 19 — Printer


Printer (New in SP06)

This plugin enables the ability to print using AirPrint on iOS and the Android Printing Framework on Android 4.4 or higher devices.  It uses the open source Printer plugin.

For additional details on the Kapsel Printer plugin see the JavaScript file in a project that includes this plugin at


or the JS Documentation at Kapsel Printer API Reference.

The following steps will demonstrate using this plugin.

  • Create the project.
    cordova -d create C:\Kapsel_Projects\PrinterDemo com.mycompany.printer PrinterDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
    cd C:\Kapsel_Projects\PrinterDemo
    cordova -d platform add android
    cordova -d create ~/Documents/Kapsel_Projects/PrinterDemo com.mycompany.printer PrinterDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"
    cd ~/Documents/Kapsel_Projects/PrinterDemo
    cordova -d platform add ios
  • Add the Kapsel or open source printer plugin.
    cordova -d plugin add de.appplant.cordova.plugin.printer or cordova -d plugin add 
  • Replace www\index.html with the contents of index.html.
  • Copy the files to the platform directory by running
    cordova -d prepare
  • Use the Android IDE or Xcode to deploy and run the project.

    The Print Original Page passes the location.href to the print method while Print Current Page passes document.body which includes the logged messages such as Printer is available.  Notice that thedate text input is empty either way.  Finally the Print Other Page prints the current weather forecast in Waterloo Ontario (

    The following demonstrates how to view the results of printing a page on an Andoid emulator and an iOS simulator. Press the Is Printer Available button and then the Print Current Page.


    To download the Printer Simulator, in Xcode, choose Xcode > More Developer Tools… > Hardware IO TOols for Xcode – Xcode 6.1.
    Once downloaded start the Printer Simulator.  Note if an error appears in Xcode while attempting to print, the following may help.  AirPrint Connection Refused Error.


Back to Getting Started With Kapsel

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo saket amraotkar
      saket amraotkar

      Hi Daniel,

      Very nice document.

      Is there any API available which will print reports from windows 8.1 platforms to bluetooth printers?

      We are developing SAPUI5 application which will be packaged in Cordova container, i searched KAPSEL/Cordova, but no API to print for Windows 8.1 platforms.

      Can you please help me in this regard.



      Author's profile photo Daniel Van Leeuwen
      Daniel Van Leeuwen
      Blog Post Author

      I don't believe Kapsel/SMP SDK provides this in the SP08 release.

      I suppose you could look for an open source plugin to provide this.  I have not myself used one on Windows.


      Dan van Leeuwen

      Author's profile photo Marius Stoica
      Marius Stoica

      Hi Daniel,

      I'm trying to print the some data from my Cordova app to a bluetooth printer imZ320 but I get an error.

      10-30 12:03:45.875: E/AndroidRuntime(26534): at$ 10-30 12:03:45.875: E/AndroidRuntime(26534): at

      I've tried to do some debug on the issue and I found that the exception message is:

      No Activity found to handle Intent { act=android.intent.action.SEND typ=image/png }

      Now let me tell you what I've installed (nothing modified just open source code). 1. Printer app - 2. Cordova Kapsel plugin - (I know it said "deprecated" but I need to make something work on my device). By default the plugin from the SCN message send the "object" to the Android print server and creates a PDF file. In my case I need o send it to a real printer, ergo imZ320 and the network-printer.

      The intent is created in the function below (found in the file of the plugin):

      private Intent getPrintController (String appId) { String intentId = "android.intent.action.SEND";

      Other sources that I found that work (but native apps created): and

      I tried to reverse engineer them but with no luck 🙁

      And here is a related plugin that I found on github to zebra printing, but couldn't make it do anything:



      Author's profile photo Former Member
      Former Member

      Any new about the support of this plugin in Windows 8.1?

      Thank you!

      Author's profile photo Daniel Van Leeuwen
      Daniel Van Leeuwen
      Blog Post Author

      There is a table at the link below that mentions Windows 8.1.

      Updating the content displayed in this section is on my todo list 🙂

      Note, the version that I will be updating is.

      Getting Started with Kapsel - Part 14 -- Printer (SP09+)


      Dan van Leeuwen

      Author's profile photo Former Member
      Former Member

      Hi Daniel

      When i click on the index.html file as you said i am getting page not found . Kindly send me the link where i can the index.html code


      Author's profile photo Daniel Van Leeuwen
      Daniel Van Leeuwen
      Blog Post Author

      This blog post was archived and covers an early version of the Kapsel SDK.  Please see or for the very latest version of the blog series see


      Dan van Leeuwen