Skip to content

Instantly share code, notes, and snippets.

Last active July 20, 2023 09:32
Star You must be signed in to star a gist
Save izazueta/4961650 to your computer and use it in GitHub Desktop.
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
  • Microsoft Excel (.XLS and .XLSX)
  • Microsoft PowerPoint (.PPT and .PPTX)
  • Adobe Portable Document Format (.PDF)
  • Apple Pages (.PAGES)
  • Adobe Illustrator (.AI)
  • Adobe Photoshop (.PSD)
  • Tagged Image File Format (.TIFF)
  • Autodesk AutoCad (.DXF)
  • Scalable Vector Graphics (.SVG)
  • PostScript (.EPS, .PS)
  • TrueType (.TTF)
  • XML Paper Specification (.XPS)
  • Archive file types (.ZIP and .RAR)

Google Docs Viewer (Apps)[DOMINIO]/viewer?url=[FILE_URL]

Google Docs Viewer[DOMINIO]/viewer?url=[FILE_URL]

##Office Web Apps Viewer ('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

Pantalla completa[OFFICE_FILE_URL]

Incrustado dentro de un 'iframe'

<iframe src='[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>


Copy link

Is there any way to increase limit of 25 MB ?

Copy link

Is it authentic way, as I do not see mention of this service on any of Google site

Copy link

BraPan commented May 15, 2016

Hello, is there any possibility to change the view of the Office Web Apps Viewer, for example I only want to "print as PDF" and not to download the whole document.
Thank you.

Copy link

How to view private documents?

Copy link

when i open an excel file using 'Office Web Apps Viewer ' first time it open correctly but when i made some changes in the file then pass the same url it does not show the changes .
plz some one give me solution for the same.

Copy link

Does the plugin have a limit of pages?
When i try to upload some PDF it says: there is no preview available
My file size is 15 mb with 140 pages.


Copy link

I have some hard-files (paper) then I use scanner machine scan these hard files to Pdf file.
Google Doc viewer and Office Web Apps Viewer don't support to view online.
I wish to view that Pdf file online. How can I do it?


Copy link

Copy link

Thanks! You did help me so much. :)

Copy link

it's really nice....
can we disable "download option", "share option" from slide views. please tell me.

Copy link

Their is problem with when load images, it is showing There was Problem displaying this image, same msg for multiple types of image which have size under 200kb

Copy link

Thank you !

Copy link

Hi please the google doc FIle viewer[DOMINIO]/viewer?url=[FILE_URL] what do i replace the DOMINIO with.

Copy link

Does this Google app viewer can be used for "csv" files? Or can you please suggest something for the conversion of similar not listed file formats.

Copy link

mtx-z commented Jun 16, 2017

Image file are not working anymore. Someone succeed to make it work ?

Copy link

Thank you very much !!

Copy link

hnarun commented Jul 28, 2017

how can I view document from website that use iframe?
I tested with, but instead of viewing my file it viewed my html code.
What wrong with that?

Copy link

udara86 commented Aug 9, 2017

Samething happened to me..I tested with, but instead of viewing my file it viewed my html code.
What wrong with that?

Copy link

When user will scroll down to bottom of the page then how do I give any alert message.
Currently, I am using an iframe to show google docs viewer on my website, but I have to apply some javascript event after a complete reading of the document.

Copy link

StarWar commented Jan 3, 2018

Is there any bandwidth limit, if I use google drive this way?

Copy link

I tried the pdf in my office unsuccessfully. The pdf is in the webserver of shared by IIS. But I use the URL as below, the google chrome appear the error message "No preview available"。Does somebody know how to solve this problem?

Copy link

Aarbel commented Feb 19, 2018

Hi ! Do you know alternatives to provide a .docx or .xlsx viewer (and maybe editor) on our own interfaces ? Like opensource libraries and editors, thanks !

Copy link

@akira32chen you are using a local IP address which is unknown to Google

Copy link

Hello, what about security? If the documents are private of a client. What happens when we put them in a web folder, so that the Google service has access.

Copy link

If i give local url, it shows no preview available...why?

Copy link

Local URL's will not work as's servers must be able to access the document over the internet.

Copy link

zqdevelopment commented May 24, 2021

hello, I use this API but it is don't work for this formats:
.TTF (no)
.XPS (no)
.ZIP (no)
.RAR (no)
.PNG (no)
.GIF (no)
.WebM (no)
.MPEG4 (no)
.3GPP (no)
.MOV (no)
.AVI (no)
.WMV (no)
.FLV (no)
I will be grateful for any recommendation, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment