Page 2 of 2

Re: PDF Viewer

Posted: Tue Feb 16, 2016 12:15 am
by Jamie37
Sorry for the confusion. It is an IOS app but I am probably just not understanding sorry.

Jamie

Re: PDF Viewer

Posted: Tue Feb 16, 2016 12:39 am
by quailcreek
Ahh... that's what I though. Take a look at my first post in this thread. If you do a copy file like yo did. It puts the file into the engine folder of the app container. It's best to copy it to the documents folder. Then just read it from there.

Re: PDF Viewer

Posted: Tue Feb 16, 2016 9:48 am
by Klaus
Hi Tom,
quailcreek wrote:If you do a copy file like yo did. It puts the file into the engine folder of the app container.
It will end up in -> specialfolderpath("resources") as I wrote a couple of times!
OK, on iOS systems this is the same as the ENGINE folder, but for crossplatform reasons
we should get used to use specialfolderpath("resources") :D
Read up the definition of this folder in the dictionary.

But I see this is obviously some version of LC 8, maybe another yet undiscovered bug of that DEVELOPER preview? :D
Jamie, can you try this with version 7.x to be sure?



Best

Klaus

Re: PDF Viewer

Posted: Tue Feb 16, 2016 11:29 pm
by Jamie37
Hello,

Thank you both for your help. It is very much appreciated. I have tried using version 7.1.1. However still no luck. This is the code I have on the card

Code: Select all

global sBrowserId

on openCard
    browserOpen
end openCard

on browserOpen
    -- We pass the windowId of the stack to revBrowser 
    -- so that it can determine which window to place the
    -- browser object into
    put the windowid of this stack into tWinID

    -- Open the browser, using the windowId and initial url
    put revBrowserOpen(tWinID,"") into sBrowserId

    -- Set some basic properties for the browser
    revBrowserSet sBrowserId, "showborder","true"
    revBrowserSet sBrowserId, "rect",rect of image "browser image"
end browserOpen

on browserClose
    revBrowserClose sBrowserId
end browserClose
And this is the code I have on the button...

Code: Select all

global sBrowserId

on mouseUp
   put specialfolderpath("resources") & "/TEST.pdf" into tPDFFile
   browserSetURL tPDFFile
end mouseUp

the browserSetURL handler is implemented in the card script

on browserSetURL tPDFFile
    ## Set the url to be displayed to the given url
    revBrowserSet sBrowserId, "url", ("file://" & tPDFFile)
end browserSetURL
Thanks
Jamie