Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread Display and search PDF's on mobile devices
Fri, Mar 21 2025 8:13 AMPermanent Link

Eivind

Gents,

As explained in another post, I am in the process of building an in-house web app for the employees. This will only be run on mobile phones and tablets. Some part of the functionality will be to display various PDF files. Not to just download them and open in other apps. I have looked at various free and paid option, but I am lost in the jungle. Have you guys done this before? Any recommendation on what framework is best and easiest for mobile devices? The app and the PDF's are hosted on IIS on an Azure server.

The PDF viewer will have to have a search function, but apart from that, only basic functionality is needed to read the file without downloading it.

Thanks!

Br

Eivind
Fri, Mar 21 2025 11:15 AMPermanent Link

erickengelke

Avatar

Eivind wrote:

>  Some part of the functionality will be to display various PDF files. Not to just download them and open in other apps. I have looked at various free and paid option, but I am lost in the jungle. Have you guys done this before?

I do this.  Apple devices create some challenges, they don't support some media.  However, found if you use a TBrowser and set the URL to the PDF file, it works on all devices
(That was mentioned in https://erickengelke.com/posts/post38.html )

I think you can Ctrl/Command(mac) F and search the PDF in the TBrowser, or press the search icon in the top corner.

I have other server tricks I use for PDF scanning, but they are written in PHP.  Ask if you want more info.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Fri, Mar 21 2025 11:46 AMPermanent Link

Eivind

Erick

I will give the TBrowser a try. I thought that I needed a 3rd party component to prevent the file to be offered as a download only.

Br

Eivind
Fri, Mar 21 2025 2:28 PMPermanent Link

erickengelke

Avatar

Eivind wrote:
> I will give the TBrowser a try. I thought that I needed a 3rd party component to prevent the file to be offered as a download only.

The downloading is if the file server gives it a filename.  No filename specified causes it to display in the browser.  You do need to give it a MIME type  I think it's Application/pdf but I haven't done it recently.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Fri, Mar 21 2025 4:57 PMPermanent Link

Eivind

erickengelke wrote:
I do this.  Apple devices create some challenges, they don't support some media.  However, found if you use a TBrowser and set the URL to the PDF file, it works on all devices
(That was mentioned in https://erickengelke.com/posts/post38.html )

I did try this but run into some problems. When I set the URL to somepdf.pdf it does diplay the file, but I am unable to scroll to the next page. Yes, I can move the first page a bit up and down, but never to the next page. Also, the browsers search function only find data on the web app and not in the actual PDF. If I call the same PDF file in the browser using a full url then it displays well and I can scroll to all pages and search for data in the actual PDF file.

I just tested the TPlugin as well and the whole first page of the file is shown without any possibility to scroll to the next page too

Little bit stuck here

Br
Eivind
Fri, Mar 21 2025 8:04 PMPermanent Link

erickengelke

Avatar

Eivind wrote:

erickengelke wrote:
>> I do this.  Apple devices create some challenges, they don't support some media.  However, found if you use a TBrowser and set the URL to the PDF file, it works on all devices
(That was mentioned in https://erickengelke.com/posts/post38.html )

Elvind wrote:
> I did try this but run into some problems. When I set the URL to somepdf.pdf it does diplay the file, but I am unable to scroll to the next page. Yes, I can move the first page a bit up and down, but never to the next page. Also, the browsers search function only find data on the web app and not in the actual PDF. If I call the same PDF file in the browser using a full url then it displays well and I can scroll to all pages and search for data in the actual PDF file.


When you create the TBrowser element, be sure scrolling is set to True.  If that doesn't solve it - it was already set True, then I think your server script may just be sending a single page of the PDF????
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Sat, Mar 22 2025 8:06 AMPermanent Link

Eivind

erickengelke wrote:
When you create the TBrowser element, be sure scrolling is set to True.  If that doesn't solve it - it was already set True, then I think your server script may just be sending a single page of the PDF????
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com

Yep. scrolling is set to True. The web server just serves the file up as it is in the public web folder. In the URL of the TBrowser I only set the pdf file name. However, if I do the same in the mobile browser and put the full path of the file, the file can be scrolled to all pages and searched in.

As a backup plan I tried using the TLink and set the URL the same there. This one serves up the PDF correctly, but in fullscreen and not "in" the web app.

Thanks again

Eivind
Sat, Mar 22 2025 11:52 AMPermanent Link

erickengelke

Avatar

Eivind wrote:

> Yep. scrolling is set to True. The web server just serves the file up as it is in the public web folder.
> In the URL of the TBrowser I only set the pdf file name. However, if I do the same in the mobile browser
> and put the full path of the file, the file can be scrolled to all pages and searched in.

It sounds like a browser issue.  

I tried with both a TMedia and TBrowser and was able to scroll sucessfully on Chrome and Safari (didn't try TMedia there).  IE failed, but IE should never be used - it's braindead and unsupported for ages now.

You can detect ie with the IsIE function IIRC, and put up a warning saying its not supported.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Sat, Mar 22 2025 3:37 PMPermanent Link

Eivind

erickengelke wrote:
I tried with both a TMedia and TBrowser and was able to scroll sucessfully on Chrome and Safari (didn't try TMedia there).  IE failed, but IE should never be used - it's braindead and unsupported for ages now.

Erick. Sorry for not being clear. I get it also to work on a pc using chrome, but I test on an iPhone using Chrome and Safari. Thats when the problems described above comes into play. I do not have access to an Android phone to test the same. I could wrap up a quick demo later and post a link

Br
Eivind
Sat, Mar 22 2025 4:41 PMPermanent Link

Eivind

I just wraped this one together for testing:

https://www.reachfx.no/pdftest.html

All good on desktops, but only showing first page on my iPhone
Page 1 of 2Next Page »
Jump to Page:  1 2
Image