KitKat Printer Not working



I am working on android KitKat platform and want to use the Printer Service , so I write a simple cordova plugin to do it, but it fails. I got “cant create print job” again and again while I want to print the page.

here is my plugin code (it’s dirty, please ignore the context reply part):

Please note the above code works but is not what I want. It is just like a simple test for the printer api, and if I comment out line 86-88 , and uncomment line 85, it doesn’t work.

And this code is a little complex as I use an new offlineWebView, in fact for the first time I just resuse the current webview of the plugin, same issue.

It seems that for simple page, it works, but for page with ionic framework, it fails.

Any ideas ?