PDF Widget

JeeJeeStudio jeejeestudio at gmail.com
Sun Apr 25 07:22:59 EDT 2021

hhhmmm, yes, sorry let me refrase that....

What I did is download the pdf then opened an external browser, and as 
soon the browser was closed it went back to the app.

Don't know exactly anymore why I did not use the browser widget, so I 
was remembering it wrong. But probably because displaying a pDF sucks 
Big TIme on Android within LC using Indy that time.

(just like our prime minister, he remembers nothing and has no 
recollection of it or remembered it wrong :) )

If it helps, what I did was:

local tFile, tHier, tHeaders,tResult
on mouseUp
    if the environment is "mobile" then --ok for Android and iOS
       set the defaultFolder to specialFolderPath("documents")
       put specialFolderPath("documents") & "/help.pdf" into tHier
    end if
    put tsNetGetFile("1", tHier, 
"https://www.somewebpage.nl/folder/help.pdf", tHeaders, 
"transferComplete") into tResult
end mouseUp

on helpdownloaded
    if the environment is "mobile" then --ok for Android and iOS
       put specialFolderPath("documents") & "/help.pdf" into tFile
    end if
    if there is a file tFile then
       if the platform is "android" then
          mobileToast "Help file is gedownload", "short"
       --this works OK with external browser on Android--downloaden en 
dan kopieren naar sdcard
       put URL ("binfile:" & specialFolderPath("documents") & 
"/help.pdf") into URL ("binfile:/mnt/sdcard/help.pdf")
       launch url "file:/mnt/sdcard/help.pdf"
       end if
       mobileToast "No file"
    end if
end helpdownloaded

on transferComplete pID, pResult, pBytes, pCurlCode
    local tData
    --answer tsNetGetStatus("1")
    if pCurlCode is not 0 then
       answer tsNetRetrError(pID)
       --answer "File has been downloaded"
    end if
    tsNetCloseConn pID
end transferComplete

Op 24-4-2021 om 22:37 schreef Klaus major-k via use-livecode:
>> Am 24.04.2021 um 21:31 schrieb JeeJeeStudio via use-livecode <use-livecode at lists.runrev.com>:
>> Aber Klaus, for just displaying a PDF, you could use the browser widget
> Maar JeeJee, I wrote:
> ... directly as a control) in a stack and
> NOT inside of a browser widget, which is not working "out of the box" on Android.
> Yes, call me lazy... 8-)
>> Op 23-4-2021 om 13:48 schreef Klaus major-k via use-livecode:
>>> Hi Tore,
>>>> Am 23.04.2021 um 13:28 schrieb Tore Nilsen via use-livecode <use-livecode at lists.runrev.com>:
>>>> Not everyone needs it.
>>> that was just a little joke. :-)
>>>> I had the business edition for a year and for what it is worth, the pdf-widget did not offer anything
>>>> I needed. I had hoped I could use it for mark up and annotations but did not find a way to do that.
>>> It would be enough, at least for me, if we could display a PDF (directly as a control) in a stack and
>>> NOT inside of a browser widget, which is not working "out of the box" on Android.
>>>> I do however think that it would be a good thing if it was possible to buy widgets on a per widget basis.
>>>> That would enhance the LiveCode experience in my mind.
>>> Definitively!
>>>> Best regards
>>>> Tore Nilsen
> Best
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> klaus at major-k.de
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

More information about the use-livecode mailing list