Tuesday, 10 August 2021

Google's PDF embed doesn't work on Android webview, any alternatives?

I would like to show a PDF in an application embedded in a WebView. It works fine until I would like to use get parameters in the url.

So for example this works well:

https://drive.google.com/viewerng/viewer?embedded=true&param=1&url=http://africau.edu/images/default/sample.pdf

But as soon as I put a get parameter in the given URL which I cannot show for security reasons, it doesn't work, for example:

https://drive.google.com/viewerng/viewer?embedded=true&url=http://{anydomain}/any.php?args1=1&args2=2

Downloading and showing then deleting the pdf is not an option since the business model of the given application. Since the information on the given pdfs are sensitive. I must have to show an embedded PDF from an url and no matter where I search I only found this solution, Google's drive embed which is horrible from many point of views but the worst is that it doesn't handle well GET params.

Any tips?

EDIT 1:

I tried with URL encoding. Same result in Android's WebView. And I experience the same WITHOUT encoding in PC browsers do I don't think the problem is with encoding, or is it?



from Google's PDF embed doesn't work on Android webview, any alternatives?

No comments:

Post a Comment