Titanium, displaying PDF

Forum to discuss the new web client version of Servoy.

Titanium, displaying PDF

Postby alk » Tue Jul 11, 2023 4:16 pm

Hi,
in NG/Titanium

scopes.svyIO.openFileWithDefaultViewer('F:/Eigene Dateien/servoy_workspace_Arbeit/NG_BIB/medias/Historie.pdf')

is no longer support

Any idea, how display a PDF- and an EXCEL-file in Titanium solutions?

Thanks and hope to see you all during Servoycamp

Ralf
alk
 
Posts: 61
Joined: Wed May 21, 2014 8:34 pm
Location: Berlin

Re: Titanium, displaying PDF

Postby mboegem » Tue Jul 11, 2023 5:11 pm

Hi Ralf,

There is no way you can control the file system from a browser, so you can not open files directly.

If you want / need more integration with your local machine, you could look into NGDesktop, which has some extensions that will enable you to do quite a lot of things that could been done in smart client
Otherwise, most browsers can display pdf files natively, but you can also look into the pdf viewer component.

Hope this helps, see you at ServoyCamp :-)
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: Titanium, displaying PDF

Postby alk » Tue Jul 11, 2023 5:24 pm

Hi Marc,

thanks and which way I should choose using NGDesktop Client????

Best
Ralf
alk
 
Posts: 61
Joined: Wed May 21, 2014 8:34 pm
Location: Berlin

Re: Titanium, displaying PDF

Postby robert.edelmann » Tue Jul 11, 2023 7:36 pm

You use a JNLP-File right now, if I remember correctly?

With NGDesktop-Client you need a special client which can be exported in the Developer. You need a link to the solution (same link you use in the browser) an Icon and a logo and then you receive a mail with the link to the installer / files for the auto-update (windows only).

With this client you can use desktop-features, if you install the relevant webcomponents NG-Desktop File plugin (Handling files similar to smartclient, but with much more callback), NGDesktop UI plugin for Menus (Mac-Users can only use Cmd-C / X / V if the menu is defined, example is included) and NG Desktop Utils which gives the ability to check if you are in NGDesktop and to execute programms / open URLs.

You can then do something like

Code: Select all
plugins.ngdesktopfile.openFile(targetFileName);


of if you want to go the manual route and adapt the code from scopes.svyIO:
Code: Select all
   if (application.getApplicationType() == APPLICATION_TYPES.NG_CLIENT && scopes.svyDocumentManagement.isNgDesktopFile()) {
      fileName = '"' + fileName + '"';
      var osName = application.getOSName();
      if (/Windows/.test(osName)) {
         plugins.ngdesktoputils.executeCommand('rundll32', ['url.dll,FileProtocolHandler', fileName]);
      } else if (/Linux|Freebsd/.test(osName)) {
         plugins.ngdesktoputils.executeCommand('mozilla', [fileName]);
      } else if (/Mac/.test(osName)) {
         plugins.ngdesktoputils.executeCommand('open', [fileName]);
      }
   }
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 95
Joined: Wed Aug 14, 2013 6:12 pm

Re: Titanium, displaying PDF

Postby jcompagner » Wed Jul 12, 2023 9:21 am

for pdf just the file plugin will work fine i think so: plugins.file.openFile()

for excel i guess it depends a bit what is installed and what the browsers does..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 25 guests