I'm a web developer new to livecode and I'm trying to convert a web application to an iPad app that contains many PDF links. I've been using the following but I can't get it to work anyone know what I'm doing wrong? I have several videos playing using specialfolderpath("engine") and including them in the standalone application screen does it work the same for all documents such as pdfs?
//On my card
command openpdfs pdffile
launch url "file://" & specialfolderpath("engine") & pdffile
end openpdfs
//On my buttons
on Mouseup
openpdfs "HY3780.pdf"
end Mouseup
I don't have an ios device to test on right now but my guess is that you can go into settings for acrobat reader on the device and set it as the default for .pdf file types. Might be in the reader app itself or might be in the settings elsewhere.
Let me know if it works. If it does its because it is using the adobe registered URL scheme so that IOS knows what to use to open the file. Of course if the file is STILL not registered as an association, or the scheme isn't there then it still won't work, but its worth a shot. I've read of folks being able to use this to get reader to open but that full support for the url scheme wasn't there yet. However, the stuff I read was old and may no longer apply. Worst case, there are other adobe readers out there that you CAN call using a URL scheme that fully support the URL scheme method.
on mouseUp
openPdf "HY3780.pdf"
end mouseUp
on openPdf pPdfFile
put "theBrowser" into tBrowserName
if tBrowserName is among the lines of mobileControls() then mobileControlDelete tBrowserName
put the rect of button "theBrowserPlaceholder" into tRect
put (specialFolderPath("engine") & slash & pPdfFile) into tUrl
mobileControlCreate "browser", tBrowserName
mobileControlSet tBrowserName, "rect", tRect
mobileControlSet tBrowserName, "visible", true
mobileControlSet tBrowserName, "url", tUrl
mobileControlSet tBrowserName, "autoFit", true
end openPdf
I use it without "file://" and it works just fine with pdfs and local html files.
But, I did a quick test now and it seems that adding the "file://" prefix works, too.
One advantage of this method is, obviously, the user won't leave your app.