Function getPrinters() on solution type NG Client

Hi!
If the solution is NG Client type, a warning that says: “the getPrinters () function is not available” is displayed
But if we change the type of solution to Normal, the warning disappears
Why is the getPrinters function not available for NG Client solutions?
We need to read the printers that are on the server side
How can it be done differently?
Roberto

Hi Roberto,

the reason this function is not available in an NG-type solution, is that this will run in the browser.
And browsers typically can not access local printers directly from a web page.

In order to read the printers serverside, you can spawn a headless client, using the headless client plugin.
This headless client can run a solution (or module) from a different type, which does have this function available.

The headless client plugin has the ability to pass callback function, that way you will be able to return the result from the headless client.
After the job has been done, you can simply make the headless client exit itself.

Hope that helps.

Thanks for the idea Marc
I solved it through a webservices
Roberto