Android, local PDF and the Browser Widget

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Android, local PDF and the Browser Widget

Knapp Martin via use-livecode
Can anyone tell me why this fails on Android, when it works on iOS and desktop:

put specialFolderPath("documents") & "myTemp.pdf" into fPath
put someRandomPDFData into url ("binfile:" & fPath)
set the url of widget "Browser1" to fPath  //I get a white screen

I have also tried:
set the url of widget "Browser1" to ("file:/" & fPath)
set the url of widget "Browser1" to ("file://" & fPath)

FWIW, this returns true:
answer (there is a file fPath)

I have verified that someRandomPDFData is valid PDF data and the detailed files returns the correct file name and size

Using LC 9.0.1

-Dan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android, local PDF and the Browser Widget

Knapp Martin via use-livecode
Is the browser capable of opening a file on Android?

Bob S


> On Aug 7, 2018, at 13:25 , Dan Friedman via use-livecode <[hidden email]> wrote:
>
> Can anyone tell me why this fails on Android, when it works on iOS and desktop:
>
> put specialFolderPath("documents") & "myTemp.pdf" into fPath
> put someRandomPDFData into url ("binfile:" & fPath)
> set the url of widget "Browser1" to fPath  //I get a white screen
>
> I have also tried:
> set the url of widget "Browser1" to ("file:/" & fPath)
> set the url of widget "Browser1" to ("file://" & fPath)
>
> FWIW, this returns true:
> answer (there is a file fPath)
>
> I have verified that someRandomPDFData is valid PDF data and the detailed files returns the correct file name and size
>
> Using LC 9.0.1
>
> -Dan
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android, local PDF and the Browser Widget

Knapp Martin via use-livecode
Hi friends,

> Am 07.08.2018 um 22:42 schrieb Bob Sneidar via use-livecode <[hidden email]>:
> Is the browser capable of opening a file on Android?
>
> Bob S
>
>
>> On Aug 7, 2018, at 13:25 , Dan Friedman via use-livecode <[hidden email]> wrote:
>> Can anyone tell me why this fails on Android, when it works on iOS and desktop:
>> put specialFolderPath("documents") & "myTemp.pdf" into fPath
>> put someRandomPDFData into url ("binfile:" & fPath)
>> set the url of widget "Browser1" to fPath  //I get a white screen
>> I have also tried:
>> set the url of widget "Browser1" to ("file:/" & fPath)
>> set the url of widget "Browser1" to ("file://" & fPath)
>> FWIW, this returns true:
>> answer (there is a file fPath)
>> I have verified that someRandomPDFData is valid PDF data and the detailed files returns the correct file name and size
>> Using LC 9.0.1

ANDROID cannot display PDF inside of a browser out-of-the-box!
This is no LC issue!

But there seems to be a way using JavaScript, please check this forum posting:
<http://forums.livecode.com/viewtopic.php?f=53&t=28518>


Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android, local PDF and the Browser Widget

Knapp Martin via use-livecode
In reply to this post by Knapp Martin via use-livecode
On 8/7/18 3:25 PM, Dan Friedman via use-livecode wrote:
> put specialFolderPath("documents") & "myTemp.pdf"

This returns on desktop: /Users/<name>/DocumentsmyTemp.pdf

So I think you're writing to the wrong folder. Apparently iOS allows
that, Android doesn't. Add a slash:

put specialFolderPath("documents") & "/myTemp.pdf"

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode