Opening Browser Default Print Dialog

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Opening Browser Default Print Dialog

Postby ryan1680098789 » Wed Aug 30, 2023 6:00 pm

I'm looking to have it so users can preview an image that they have previously uploaded. Beside the preview there is a print button that I would like to open the browsers printing dialog so the user can print the image. The image is stored as a base64 string, Looking for some guidance with this.
ryan1680098789
 
Posts: 13
Joined: Wed Mar 29, 2023 4:06 pm

Re: Opening Browser Default Print Dialog

Postby mboegem » Thu Aug 31, 2023 8:41 am

Hi Ryan,

have a look at the ngclientutils plugin.
This plugin contains a printDocument function that can print url content using the browser print dialog.
The tooltip on this function has some code pointers.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Opening Browser Default Print Dialog

Postby ryan1680098789 » Thu Aug 31, 2023 3:30 pm

I've been trying to use that function from ngclientutils, the issue I'm having is it keeps returning this error and I cannot find any documentation for this error:

ERROR org.sablo.BrowserConsole - 9:28:29 ERROR ServicesService - trying to call a service api printDocument for service ngclientutils but the sevice ([object Object]) or the call was not found!
at SabloService.buildStackMessage (http://localhost:8183/default-src_ngcli ... s:29297:15)
at Object.apply (http://localhost:8183/default-src_ngcli ... s:29112:36)
at ServicesService.callServiceApi (http://localhost:8183/default-src_ngcli ... s:29404:16)
at Object.handleNormalServiceApis (http://localhost:8183/default-src_ngcli ... s:29375:34)
at WebsocketSession.handleMessage (http://localhost:8183/default-src_ngcli ... s:30410:46)
at http://localhost:8183/default-src_ngcli ... :30210:103
at _ZoneDelegate.invoke (http://localhost:8183/polyfills.js:500:158)
at Object.onInvoke (http://localhost:8183/vendor.js:42847:25)
at _ZoneDelegate.invoke (http://localhost:8183/polyfills.js:500:46)
at Zone.run (http://localhost:8183/polyfills.js:283:35)
ryan1680098789
 
Posts: 13
Joined: Wed Mar 29, 2023 4:06 pm

Re: Opening Browser Default Print Dialog

Postby mboegem » Thu Aug 31, 2023 3:59 pm

Right, using from TiNG it fails, in NG client it works.
Have created a case: https://support.servoy.com/browse/SVY-18517
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 34 guests