PDF offline viewer

#1

Hi
My app saves PDF documents locally, and needs to present them when offline.
While iOS web view is capable of displaying pdf files, Android’s web view cannot.
How do I display pdf documents on Android without detaching from Expo?
Thanks

#2

this might be a little bit tricky but i think you could do this with PDF.js if you make sure the pdf.js code is downloaded onto the file system and then you use that and some static HTML and then load the PDF in in a webview. does that make sense?

#3

Hi there,
Did you get this working? I am looking to do the same thing: Download a pdf and then render it.

I’ve looked into PDF.js but I’m not sure how I’d leverage it to render the PDF.

Thanks

#4

I couldn’t get to run PDF.js locally.
I ended up saving the pdf as a base64 string, and serving it to a WebView as a string source.
Unfortunately, it only works for iOS.

#5

Here is an example of displaying a remote PDF if that helps.
https://snack.expo.io/@ccheever/pdf-example

#6

Hi,

I’m working on a solution to have a PDF offline viewer (android capable):

2 Likes
#7

Thanks! Will try it.