Function getPrinters() on solution type NG Client

Forum to discuss the new web client version of Servoy.

Function getPrinters() on solution type NG Client

Postby rmidata » Tue Dec 03, 2019 10:30 pm

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
Roberto Diez.
Interdata Software.
Santa Fe, Argentina.
User avatar
rmidata
 
Posts: 42
Joined: Thu Jul 09, 2009 10:26 pm
Location: Santa Fe, Argentina.

Re: Function getPrinters() on solution type NG Client

Postby mboegem » Wed Dec 04, 2019 11:23 am

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.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Function getPrinters() on solution type NG Client

Postby rmidata » Sat Dec 07, 2019 4:40 pm

Thanks for the idea Marc
I solved it through a webservices
Roberto
Roberto Diez.
Interdata Software.
Santa Fe, Argentina.
User avatar
rmidata
 
Posts: 42
Joined: Thu Jul 09, 2009 10:26 pm
Location: Santa Fe, Argentina.


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests