How to remove the 'open external' option from Google Docs PDF viewer embed?

I’m working on a project that uses Google Docs viewer to show PDFs on my website. But I’ve run into a problem. There’s this ‘open external’ button that pops up when you view the PDF. I really don’t want users to be able to download or open the PDF in another app. Is there a way to get rid of this button?

I tried looking for settings or options to disable it, but no luck so far. It’s important for my site that the PDFs stay within the embedded viewer only. Has anyone figured out how to remove this feature or know if it’s even possible?

Here’s what the viewer looks like with the button I want to hide:

+-------------------+
|   PDF Viewer      |
|                   |
|   [Content]       |
|                   |
|  [Open External]  |
+-------------------+

Any help or ideas would be great. Thanks!

I’ve encountered this issue as well, and it’s indeed frustrating. While there’s no direct way to remove the ‘open external’ option, I’ve found a solution that works well. Consider using an iframe with the PDF embedded directly, rather than relying on Google Docs viewer. This approach gives you more control over the display.

You can host the PDF on your server and use JavaScript to create a custom viewer interface. This method allows you to implement your own controls and remove unwanted options. It requires more work upfront, but it offers the best balance of functionality and security for your needs.

Keep in mind that truly determined users might still find ways to access the file, so it’s worth evaluating if this level of restriction is necessary for your project goals.

hey, have u tried using mozilla’s pdf.js? its pretty cool and lets u customize stuff. i used it for a project and could hide the download button. might be worth checkin out. just google ‘pdf.js’ and you’ll find their github. its not too hard to set up

I’ve dealt with this exact issue before, and unfortunately, there’s no straightforward way to remove the ‘open external’ option from the Google Docs PDF viewer embed. Google doesn’t provide an official method to disable this feature.

However, I found a workaround that might help. Instead of using Google Docs viewer, you could try using PDF.js, which is an open-source PDF viewer. It allows for more customization, including the ability to disable download options.

Alternatively, you could consider converting your PDFs to images or HTML. This would make it harder for users to download the original file, though it might impact the quality or searchability of the content.

Remember, determined users can always find ways to download content, so it’s also worth considering if restricting access is truly necessary for your use case. Sometimes, providing a good user experience is more valuable than trying to lock down content completely.