PDF offline viewer

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

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?

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

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.

Here is an example of displaying a remote PDF if that helps.

Hi,

I’m working on a solution to have a PDF offline viewer (android capable):
https://github.com/xcarpentier/rn-pdf-reader-js

2 Likes

Thanks! Will try it.