Are you trying to open a PDF from a (web) server or are you trying to open a PDF in your database?
Also ‘00000444.pdf’ is not an URL…it’s a filename.
So I am wondering what you expect it to do.
Hi, I’m looking for a cross-platform way of opening a PDF file on the local machine, without having to specify a path to Acrobat. The filename is stored in a dataprovider. If you enter a path/filename into application.showURL() it will open that file with its default application, so it seems like a neat way to achieve this. It’s the same as entering the URL file:///C:/Program%20Files/Servoy/PDF/00000444.pdf
It used to work just fine, prior to 3.1
I’ve now changed to this approach
if(plugins.file.convertToJSFile(PDFfile).isFile())
{
if (utils.stringLeftWords(application.getOSName(), 1) == "Mac")
{
application.executeProgram('open', '-a', 'preview', PDFfile )
}
else
{
application.executeProgram("cmd.exe", "/c", PDFfile )
// application.showURL(PDFfile)
}
}
else
{
plugins.dialogs.showErrorDialog( "Error", "The file " + PDFfile + " was not found in the PDF folder", "OK")
}
Alternatively I could store the PDF in a dataprovider.