0

I'm displaying a PDF document using WebView in android. Problem is when document is scrolled, it's lagging, though the document which I'm trying to show is only 3 pages. I am unable to figure out the issue.

This is my code:

mWebView = (WebView) findViewById(R.id.webView1);
mWebView.getSettings().setJavaScriptEnabled(true);
final String doc="https://docs.google.com/gview?embedded=true&url=http://xxx.xx.xx.xxx:8001/ql/SignedAgreement/example.pdf&overridemobile=true";
mWebView.loadUrl(doc);

Tried using android:hardwareAccelerated="true" in the manifest file. It didn't help either.

Android version used: 4.1.1
Device: Lenovo IdeaPad A2109

It's showing same behavior in other devices too.

Anil M
  • 1,297
  • 2
  • 19
  • 42
  • Where are you testing this? On an actual device or the emulator? It may come down to a simple issue of computing power. Also, if you don't need it, I'd advise to not enable JavaScript as it consumes resources you might never use. – Eric Tobias Aug 21 '13 at 05:53
  • testing on actual device – Anil M Aug 21 '13 at 05:59
  • Unfortunately, and that is my personal experience as well, viewing PDF on Android is a bit of a hassle. What I have found is the following question and I sincerely hope you can find your answers there! http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android Sorry for editing my comment. I just noticed you override the mobile detection when you load the PDF. could you try not to do that? Basically, get rid of `&overridemobile=true`. – Eric Tobias Aug 21 '13 at 06:14

0 Answers0