• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help App to open HTML links to PDFs on local storage

shmn

Android Enthusiast
I have some various user's manuals that are in the format of an index.html file which has about 500 links that open 500 PDFs that are stored in sub folders. Everything is on a micro SD card in my phone. Chrome says "content" is blocked. I tried HTML viewer apps but they open the html file but won't open the PDFs. Also tried Firefox and Opera and same thing...content blocked.

Anyone have a suggestion? Using Android 9, I believe on Moto Z4.
 
Why are your PDF files only accessible in this way?

Have you tried accessing them directly?

Browsers like you have tried will only try to open links online, not on the device itself.

Have you tried copying the PDF files to a folder of there own and using a PDF file reader?

The one I like is somewhat tricky to get to read from a SD card (I can instruct on this), but it works excellent.

https://f-droid.org/en/packages/org.sufficientlysecure.viewer/
 
Thanks for the reply.

I can open and read the PDFs directly from a file viewer (I use Root Explorer). But their filenames are just numbers so there is no way to find the right file without the HTML links.

I've been using an HTML viewer to look at the actual code to find the file names within the links and then opening them manually but this is a very slow process especially when I'm searching for data that may be in any number of files.

Opening PDFs by clicking on the links would be so much easier if I can figure out how.
 
I'm not renaming thousands of files. I have six of these manuals, each with about 500--800 files. That's at least 3000 files.

This works fine on a PC with Chrome so I'm hoping there is some workaround on Android. I'll keep looking.
 
Last edited:
Thanks for the suggestion. I've tried these browsers: Chrome, Firefox, Brave, Opera, Puffin, Samsung, Duck Duck Go, Edge, Vivaldi, Naked and Habit. The last one will open a link to PDFs if I manually enter it but it's buggy and kept crashing (it's no longer supported). I'll keep playing with it as it's a good lead. It's actually a cool browser and it's a shame the developers abandoned it.
 
I got Lightning to kind of work (thanks for the suggestion, puppykickr). It would display index.html which contains links to other HTML pages which then link to the PDFs. Lightning would not link from index.html to the other HTML pages but if I clicked on the sub-pages from Root Explorer (file explorer app...where I set Lightning as default to open HTML files) it would open that page and if I clicked on a link to a PDF it would use the default PDF to open the file. Which is great news. There are only about 2-6 sub-HTML files which have identifiable names so I have no problem opening them from Root Explorer.

However, none of the PDF viewers/readers/editors would open the PDF. It would try and then revert back to the main menu of the PDF app or throw some sort of error. Even though that app could open those PDF files if opened through Root Explorer or from with the PDF app itself. I tried about a dozen PDF apps and none worked.

I tried puppykickr's suggestion of Document Viewer but that didn't work either. Although I do like that app and am keeping it around. Here is the error it threw. Any ideas? I feel like I'm close on this.

aperr.jpg
 
You have to host your local pdf file to make it open inside your application. Use SimpleHTTPServer for installing a server and run it wherever your pdf file is located. After successfully running the SimpleHTTPServer, you can check it by opening the pdf file inside your web browser.

Thanks for the suggestion. I will give this a try and post the results.
 
Forgot to report back. Using Simple HTTP Server app worked. I set the "Root Folder" as the folder containing the HTML and PDF files and then using the IP address provided by the app I can navigate through the all the HTML pages and open links to the PDF files. Works great.
 
Back
Top Bottom