17

I just switched from an iPhone to a Pixel. Whenever I try to open a PDF document, the browser automatically downloads it and ask me to open it elsewhere. I don't want that; I want an in-browser PDF view. Also it's not specific to browsers: the Gmail app, the Telegram app, almost any app is like that. Do I need to install a system plugin/extension or something?

Edit 1: can you "hack" the pdf feature into the webview by e.g. rooting the phone?

Edit 2: as I understand from the answers it's the AOSP developers' intention to make the pdf feature unavailable, contrary to say legal reason with adobe?

5
  • 2
    Related: Open PDF files directly in Chrome for Android Nov 22, 2022 at 16:41
  • It's almost like asking "why a gallery app cannot open text files?". Simply, it's the developers' choice what functionality they want to offer in their app. Web browser are for "web" which is mainly HTML and JavaScript. Both have nothing in common with PDF. So it's not mandatory by any means for web browsers to support PDF. Nov 23, 2022 at 7:43
  • You can use Kiwi Browser and add a PDF reader extension such as this one. It should load the PDFs within the browser, just like Chrome does on desktop. It did work on a couple of PDFs I tried.
    – Firelord
    Nov 23, 2022 at 22:48
  • Firefox Nightly just added this feature. It works like a charm. Jan 17, 2023 at 19:58
  • @TiagoCarneiro how long will it take for the Google play version to have this feature approximately? Jan 19, 2023 at 11:40

2 Answers 2

19

Short answer:

Install a PDF reader app to your device. Or find a browser (or other app) which suits your needs.

Long answer:

Android from the start has a concept called Intents, which means one app could use a different app to handle specific task like 'open email app to start a message' or 'play a video'. This also means if a document format has a version 2 / or additional features, the receiver app could be updated to handle it.

The downside is Android devices need to have an app installed capable of reading the file/intent/URI passed to it.

From what I understand iOS only added Universal Links in iOS 9 which could provide similar behavior. Since Apple provides a PDF viewer in their UIWebview/WkWebview I expect any app on iOS to use the existing iOS framework as cross-app interaction had additional requirements.

Given that any additional feature (like displaying PDF) will add size to the original app, in the early days it was better to have a distinct separate app. Didn't need the feature, you didn't need to download anything which could cost valuable data airtime or take up space in your phone and possibly avoid having a duplicated function in different apps. Understandably modern phone have lots of storage space but in the end Android has had a guiding principle via the Intent system to leave the ability to read/play any document (PDF, office file, video, audio) to those apps who can specifically handle those file formats.

Answers to Edit1 and Edit2 by OP:

Edit1 response: "Rooting" won't give you additional features in any browser/app as adding features involves deep changes to the app requiring software development time. If you want a well integrated PDF viewer in a browser app, you'll have to find one. Opera has been suggested. This would be the same with any other messaging/communications app for any particular file or action, i.e. you don't expect it to view spreadsheets or handle geographic mapping. The advantage of Android is that you are free to change which app handles the action and get a better experience rather than be limited to any prebuilt apps (which iOS limits).

Edit2 response: Manufacturers are free to add in their own PDF/Document viewers for their particular flavor of Android. AOSP just provides the environment. PDF at this point is a mix of open and proprietary parts so depending on the document version any PDF rendering engine may encounter difficulties. Additionally PDF is trying to display text/images in a particular way including fonts. This now means that any app embedding a PDF engine will need be aware of security attacks. See my answer to Why has Android made it impossible to install system fonts? on how fonts can pose a security risk. Browsers given their sandbox nature displaying arbitrary HTML and Javascript code are attentive to security, other apps perhaps not so much as it is not a core product feature.

5
  • 1
    Ugh. The whole reason I don't want an external reader is because I don't want the PDF polluting the file system, plunking the file who knows where using flash erase cycles as well as making me hunt for and deleting it afterwards. Often the in-browser viewer will read it directly from memory without having to save it somewhere first.
    – Michael
    Nov 22, 2022 at 20:08
  • 2
    @Michael For browsers, if it doesn't end up in the Download directory, the document will still be in the browser's temp file space along with other HTML/Javascript files. Sadly Android's end user file management is complicated, even for Android developers, so your frustration is understandable. Nov 22, 2022 at 20:39
  • Yes as the previous discussion, my reasons to wish for pdf in browser are that no only do they pollute the download folder, but it also loses the webpage title (e.g. the file from arxiv is named with an id number instead of the article title), and also adobe reader has no tab feature and in general has bad experience. Is there a workaround, I'd take it even if I have to root my phone... Nov 22, 2022 at 21:11
  • 1
    @SayakoHoshimiya See my additional answers to your edits. You may want to post on Software Recommendations for a Android browser that fits you needs. Nov 23, 2022 at 0:25
  • moon+ reader will ask if you want to keep the pdf in the filesystem after viewing it. If you choose "no" it will remove it from the temporary directory it's put it in.
    – stanri
    Nov 23, 2022 at 10:12
11

Your premise is wrong.

Android browsers absolutely can display PDFs.

However, the application design paradigm in Android is fairly Unixy in that applications are generally designed to do one thing (i.e. browse the web) and do it well. If they need something else doing (i.e. reading a PDF), they pass that on to another application to handle (whose sole purpose is handling that other thing) using intents.

Just because that's the typical design paradigm, doesn't mean that developers couldn't choose to eschew it, as in Opera's case.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .