Search code examples
htmlpdfiframeuser-experience

embed pdf in html: difference between gview and simple iframe


in this video they recommend using an iframe that calls the GView (google viewer). Is it of any use? Can't you simply reference the pdf in the iframe? what's the benefit of adding the GView?

https://www.youtube.com/watch?v=visxQbQIySg


Solution

  • Most of browsers are expected to manipulate standard web extension such HTML,CSS,JS etc. however they may optionaly support non-web extension (as well as PDF,SWF etc.).

    If you push a PDF directly to the browser and the browser does not support PDF extension the file will be downloaded and no defference if you push it inisde an iframe. When you use GView or other Document Viewers they convert the target file to HTML tags or other supported formats for all browsers (like canvas) and so you make sure that the file will be displayed on screen rather than being downloaded. Also they have extra tools like zooming, paging etc. that improves the user experience.