You found a bug! We've classified it as
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
Sencha Premium Member
Print option in desktop app
We are using sencha desktop packager to package our POS application (built using Ext JS 4.2.1).
I've gone through http://docs.sencha.com/desktop-packager/1.2/#!/api/Ion however didn't find any API for print. How do we go about print within an app packaged using sencha desktop packager?
Appreciate ideas/suggestions on getting this done!
Sencha - Engineering Operations
I've linked this thread to our existing internal issue that is tracking work towards a built-in printing solution.
Right now there is no direct approach. However, you can potentially make use of Ion.sys.exec to offload the printing work to the host OS. Obviously, the exact commands you would use would depend on the platform or platforms you are targeting.
exec method: http://docs.sencha.com/desktop-packager/1.2/#!/api/Ion.sys-method-exec
I am not sure which platform(s) you are targeting... however, on OSX for example, you could use the lpr utility via the exec command: Ion.sys.exec('lpr /path/to/file/to/print'); This of course could be a temp file generated for the purpose of printing.
Similar approach should be possible on other platforms.
This thread will recognize when the linked issue gets resolved, so you can keep an eye out for when we get this functionality brought into the SDP runtime.
Hope this helps!