11

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

Ali Zia
  • 3,825
  • 5
  • 29
  • 77

1 Answers1

3

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')

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
  • I added this code but the open external button is still displaying. – Ali Zia Sep 05 '16 at 09:24
  • @AliZia can you share a link to your document and I´ll take a look at it. – Rashwan L Sep 06 '16 at 06:28
  • https://docs.google.com/viewerng/viewer?url=http://istudy.com.pk/assets/3f05cc5ff16a157b57338f1262aeb0ae/1470400497d41d8cd98f00b204e9800998ecf8427e.pdf – Ali Zia Sep 06 '16 at 09:31
  • @AliZia, what browser do you use? I don´t get that external button were you get it I get it in the toolbar... And I think that what you can´t remove with `rm=minimal` can´t be removed unfortunately. – Rashwan L Sep 06 '16 at 16:49
  • Bro I am using the google doc pdf viewer plugin.. I am embedding it in my phone application. – Ali Zia Sep 07 '16 at 05:28
  • Ok, then I´ll stick with my comment above "I think that what you can´t remove with rm=minimal can´t be removed unfortunately". – Rashwan L Sep 07 '16 at 06:10
  • any way to remove it via css or jquery? – Ali Zia Sep 07 '16 at 06:23
  • @AliZia, I´m not a jQuery guru but when I inspect the top row I get a class name called `ndfHFb-c4YZDc-Wrql6b-SmKAyb` you can either remove the entire row by doing `$(".ndfHFb-c4YZDc-Wrql6b-SmKAyb").remove();` I could not find a way to remove the button only... Regarding the class name for the top row, I don´t think it will change but I´m not 100% sure. But try it and see if it helps you. – Rashwan L Sep 07 '16 at 06:40
  • Bro I already tried it. It hides temporarily. When I scroll pdf and go back to top, it appears again. :( – Ali Zia Sep 07 '16 at 08:22
  • 1
    Try `.css('display','none')` instead. – haldagan Sep 09 '16 at 12:08
  • @AliZia, did the above comment help you? Otherwise try the .hide() statement instead of .remove(). – Rashwan L Sep 10 '16 at 05:29