Android WebView PDF zoom functionality not working with Google Docs Viewer

I’m having trouble with PDF zoom features when using Google Docs Viewer in my Android app’s WebView. The pinch-to-zoom gesture doesn’t seem to work properly on certain Android versions. It works fine on Android 2.3.3 but fails on Honeycomb and Ice Cream Sandwich devices. The built-in zoom controls from Google Viewer don’t provide enough magnification to read small text in PDF documents. Has anyone found a way to enable or fix the zoom functionality for these newer Android versions? I really like using Google Docs Viewer for displaying PDFs in native apps, but this zoom issue is becoming a major problem for users who need to read detailed content.

I ran into this exact issue building a financial report viewer. Google Docs Viewer just handles touch events inconsistently across different Android versions - it’s a mess.

I gave up trying to fix the viewer and went with a hybrid approach instead. I detect the Android version and use different PDF viewing methods based on that. For the problematic versions (Honeycomb, ICS), I preprocess PDFs on my server to create high-res images at various zoom levels, then serve those through a custom viewer.

Yeah, it uses more bandwidth, but users can actually read the content without wrestling with Google’s broken viewer.

had similar issuse before. what worked for me was checking js is on and adding these lines in my webview setup:

webview.getSettings().setBuiltInZoomControls(true)
webview.getSettings().setDisplayZoomControls(false)
webview.getSettings().setSupportZoom(true)

this solved it for my ICS tablets, but not sure for all devices.

Yeah, this is a known bug with Google Docs Viewer on those Android versions. I ran into the exact same thing two years ago while working on a document management app. Google’s viewer interface overrides the webview zoom settings on Honeycomb and ICS builds.

What fixed it for me was switching to PDF.js instead. You can embed it straight into your webview and it handles zoom gestures way better across different Android versions. Takes more work upfront but you get consistent behavior across all devices.

Another option is MuPDF if you need more control over the viewing experience, though that means dealing with native integration.