Page 1 of 1

Reliable IOS and ANDROID pdf viewing

Posted: Sat May 18, 2024 9:46 am
by istech
Hi Livecoders,

I do hope all are doing well.

I have an issue I hope someone can shine a light on. I am trying to view pdf's on both IOS and ANDROID mobile platforms. I have checked a couple solutions on the forums but none have been reliable. The current one that comes close to working is having a google embed which works on both platforms but only 80% of the time. Is there a way to make this option consistent? I have added a hander to reset the url on the browser widget when it fails which has slightly improved the failure rate but am really looking for a permanant solution. Any help would be appreciated.

LC- 9.6.11
browser widget

source link
https://stackoverflow.com/questions/74 ... ing-first

Code: Select all

on updateLatestBullet
   local tLink
   
   put the url of widget "bullet" of cd "BULLET" into tLink
   
   put the htmltext of widget "bullet" of cd "BULLET" into tResult
   
   if tResult is "<html><head></head><body></body></html>" then 
      
      set the url of widget "bullet" of cd "BULLET" to empty
      set the HTMLTEXT of widget "bullet" of cd "BULLET" to empty
      wait 500 milliseconds with messages
      set the url of widget "bullet" of cd "BULLET" to tLink
      
   else
      
      exit updateLatestBullet
      
   end if
   
end updateLatestBullet

Re: Reliable IOS and ANDROID pdf viewing

Posted: Sat May 18, 2024 4:44 pm
by FourthWorld
istech wrote:
Sat May 18, 2024 9:46 am
The current one that comes close to working is having a google embed which works on both platforms but only 80% of the time. Is there a way to make this option consistent?
Possibly, if we can determine the difference between the working and non-working instances.

Do you find patterns to the failures? (by document, session duration, phone model, etc)

Another option:

Are you limited to PDF? If you don't have a choice you don't have a choice, but most PDFs are delivered with a fixed size far larger than can be gracefully viewed on a small screen, requiring horizontal scrolling with every line in addition to vertical scrolling.

ePub offers an alternative designed to reflow based on display area, and depending on how the document is used there may be other options as well.

Of course the viability of alternatives will depend on sourcing. If it's stuff you make, you can make it in a mobile-friendly format. But if you need to work with stuff others make, it's only been a decade and a half and it seems it may be be a few more years before many information providers realize that handheld devices have been invented. 🙂

Re: Reliable IOS and ANDROID pdf viewing

Posted: Sun May 19, 2024 6:52 pm
by istech
Hi Richard,

Thanks for chiming in. Hope you are doing well.

Currently, pdf is the only option for use. So no go on that front. I have definitely looked into seeing what the cause of the intermittent empty call. Nothing definitive at the moment. Narrowed down to either goggle embed issue or a browser widget cache problem. I saw a post with simular issue but the result was the bug had been fixed. May look to export the pages from the pdf to some images and go from there.

Re: Reliable IOS and ANDROID pdf viewing

Posted: Sun May 19, 2024 7:06 pm
by Klaus
There is a PDF widget form LC, but it cannot be bought separately, which is a shame. :(
It is part of the "Pro Pack"*, which costs 328.90 Euro PLUS VAT. :shock:

*This also contains:
Mobile Debugger
Script profiler
tsNet Pro
mergAccessory (Bluetooth on iOS and whatnot...)

Re: Reliable IOS and ANDROID pdf viewing

Posted: Tue May 21, 2024 3:37 pm
by istech
Wow not cheap when you only want one item. I'll think on it. In the meantime will try a couple workarounds. Thanks for your input.

Re: Reliable IOS and ANDROID pdf viewing

Posted: Mon May 27, 2024 1:45 pm
by istech
Just to update anyone trying this. I resolved this issue by putting a longer wait and a recheck/reset of the URL until the page is rendered.

Re: Reliable IOS and ANDROID pdf viewing

Posted: Mon May 27, 2024 4:43 pm
by FourthWorld
istech wrote:
Mon May 27, 2024 1:45 pm
Just to update anyone trying this. I resolved this issue by putting a longer wait and a recheck/reset of the URL until the page is rendered.
Glad you found a solution. Thank you for sharing what you'd learned.