Hi
Is there any way in servoy to show a file in default viewer within servoy(Smart/Web client). We have the file like PNG ,JPG ,PDF ,XPS ,TXT , DOC / DOCX (Word) ,XL* (Excel) ,XLSX (Excel) . In the left hand side I have all the file name and on right side I need to show the preview of the file.(It basically used when we are uploading a invoice or document and we just want to show a preview of the file). I have attached a screen shot that describing how I want to show within servoy.
Please help me on this.
Thanks,
Satya
whats a “default” viewer?
The ony from the OS ? so adobe reader or something for pdf’s?
and word itself for word documents?
i guess for a smart client you can do that by some command that you give to the runtime (application.executeProgram)
But that will be then something external.
For a webclient or smartclient you could also use plugins.file.openFile
Hi Johan
We can use the following code to show any file in a new window not within servoy.
if (/Windows/.test(osName)) {
application.executeProgram(‘rundll32’, [‘url.dll,FileProtocolHandler’, filePath]);
} else if (/Linux|Freebsd/.test(osName)) {
application.executeProgram(‘mozilla’, [filePath]);
} else if (/Mac/.test(osName)) {
application.executeProgram(‘open’, [filePath]);
}
While we using the above code the file is open in a new window (separate independent window). I want to show this file within servoy (Not in a separate window).
Like in windows OS there is a preview pane is there. While click on that in left hand side all file is shown and in the right hand side file preview is shown. So servoy provides to show the file outside of servoy but I want to show this file inside servoy. I have attached the screen shot of windows preview pane in my above comments. I just want same in sevoy.
Thanks,
Satya
that is not directly possible, because you want to embed native applications (parts) right into java
Maybe this could somehow be done by using a native plugin/bean or using the browsersuite and show the url inside there ?