Search code examples
javascriptjquerypdfgoogle-docsgoogle-docs-api

I want Google Docs embeddable PDF viewer not to display "open external" link


I am making a pdf viewer using google doc viewer. I am facing an issue. I don't want the user to download the pdf. If user clicks open external button, an external application is opened and pdf can be viewed. I don't want that button. What can I do?

Please see the attached image.

enter image description here


Solution

  • Add rm=minimal to the URL and you will scale of features from your viewer.

    Here is an example with rm=minimal in the URL: https://docs.google.com/spreadsheets/d/1byEvnxDkjQ49GNqRldHJyBrptlibFVItO_eneLypWic/edit?rm=minimal#gid=0

    enter image description here

    And here is an example without rm=minimal in the URL: https://docs.google.com/spreadsheets/d/1byEvnxDkjQ49GNqRldHJyBrptlibFVItO_eneLypWic/edit#gid=0

    enter image description here

    I think that what you can´t remove with rm=minimal can´t be removed unfortunately.

    Update
    If rm-minimal can´t scale of what you want you could try to remove the element by jQuery with: $(".ndfHFb-c4YZDc-Wrql6b-SmKAyb").remove(); or by CSS: .css('display','none')