Displaying PDF in Webview in GlideApps

Okay, so my use case is to display documents for signing through a Glide App. The original plan was a Glide Page (but there is no signature component).

Now, it Glide Pages the following works for me perfectly:
https://drive.google.com/uc?id={{ID}}

But when I put this in GlideApps I get HTML returned.

Any body got any suggestions?

PS: my documents are shared within our organization, I cannot turn on public sharing as it is company information. But in saying that, it is still working in Glide Pages even with the restricted sharing.

This isn’t a direct answer, but read through this thread. There is a lot of discussion regarding various ways to wrap the url of the PDF so you can display it nicely in an app. Along with some trial and error to cope with various problems.

Your method still works for me nowadays, and I indeed use it every time I need to embed a PDF.

1 Like

I have tried all different examples. And I am having no luck just yet. I will update if I find a solution

Get script to create a file in your g drive and save the link in the same row… then you can display it in image element

@Uzo I am not sure which script. I am using Airtable as my data source.

Also, I need to have access to then entire document, not just the first page

Oh…always use Google sheets, is the most powerful tool in the world…
Transfer your air tables
If you dig dip, you will find out… that everything on some point, runs on Google services

So i have found success with using this:

https://docs.google.com/viewer?embedded=true&url=(Document URL)

I am hosting my document in Airtable. Using a template column to join them. Now, it seems to be okay

2 Likes

There you go…

If your file is on google drive
Use the following link:

https://drive.google.com/file/d//preview

This works in webview embed

Unfortunately this is not working for me. It just says drive.google.com may not allow itself to be embedded

Can you share the file link?

@ShantanuIyengar

https://drive.google.com/file/d/1OXR97mAxLj7j3hdDp5c8vz2jt777RZh5/preview

Mitch - I don’t think that will work unless it’s public. I saw you mentioned earlier that it works in Pages. My guess would be because the browser you’re viewing in is already authenticated with your Google account. I suspect that if you tried it in a different browser - one that isn’t already authenticated - then you’d get the same result as you’re seeing in the app.

2 Likes

Please change the sharing options for the file, and it should work about 99% of the time!

@Darren_Murphy I just opened in a another browser that I’m not signed into and it never worked. You’re correct.

@ShantanuIyengar I cannot change sharing options. The documents we are using contains sensitive information.

I am going to go with the Airtable attachment route. Then use the url created from that to display the PDF in the webview