How to stop Google document viewer from downloading the files?

1.2k views Asked by At

I am using Google Document Viewer to display the pdf files. I have given link of pdf file to display and it is displaying properly in firefox browser and chrome is allowing me to download that file without displaying.

I don't want to download it in any browser, just view document.

And is it possible to hide viewer toolbar which contains zooming, downloading and printing options?

When i click on view document it will take me to show.htm where google doc viewer will display the pdf.

<%= link_to "View Document", course_path(:course_id => @course.id), :class =>"view_btn" %>    

show.html.erb

<iframe src="http://docs.google.com/gview?url=http://localhost:3000/<%= @document.document.url(:original) %>&embedded=true" style=" height: 1039px; width: 1039px; margin-left: 5px;" frameborder="0"></iframe>
1

There are 1 answers

1
Igor Kasyanchuk On

You can try to hide toolbar using CSS. just place some div over it using "z-index" and "position" (relative, absolute).