WAP4 EB Printing API Keep the printer open between pages

I can search and find a printer, connect to the printer, and print to the printer.  What I need to do is keep the printer open and print to it on subsequent pages as well.


How do I do that?  How do I keep the printer object accessible on another page without re-doing the printer search?


Does setDefault have anything to do with it?  Is there another way?




Rajiv Kashyap
Hi MacLean,HTML5 local

Hi MacLean,

HTML5 local storage can be used to achieve this ,where web storage, web applications can store data locally within the user's browser and all pages, from one origin, can store and access the same data.

To get this working,you need to do setItem item on your main/first page of the application as localStorage.setItem('printerObj', printers_array[i]);

and in the similar ways you need to getItem on all the subsequent pages wherever you need to access the printer as localStorage.getItem('printerObj');

This will help you to search, connect and can be used to print from any other pages till you are not closing the application.

Note : If you are changing any setting you need to start again the entire process of printer again i.e (search,connect and print).



Vote up!
Vote down!

Points: 0

You voted ‘up’

Log in to post comments