Skip to content

Instantly share code, notes, and snippets.

@Aarbel
Forked from tzmartin/embedded-file-viewer.md
Last active October 17, 2023 15:55
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Aarbel/1794c18b64266e568dbe80ca1b2e9f9c to your computer and use it in GitHub Desktop.
Save Aarbel/1794c18b64266e568dbe80ca1b2e9f9c to your computer and use it in GitHub Desktop.
Free desktop and mobile files viewers and editors: Google Drive, OneDrive, Zoho public viewers and editors.

Desktop / Web

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

Format :

    http://view.officeapps.live.com/op/view.aspx?src=[ONLY_OFFICE_FILE_URL_ENCODED]
    
    <iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[ONLY_OFFICE_FILE_URL_ENCODED]' width='px' height='px' frameborder='0'>
    </iframe>

Examples :

    https://view.officeapps.live.com/op/view.aspx?src=http%3A%2F%2Ftechslides.com%2Fdemos%2Fsamples%2Fsample.docx

Documentation here : https://products.office.com/fr-FR/office-online/view-office-documents-online?legRedir=true&CorrelationId=1fe164cf-2fd0-4194-89c8-c2be0bb4bc85

Office Online editor integration.

Office just unveiled Microsoft Online editor, which could be integrated into your app, like Dropbox does. More infos here :

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)

Format :

    https://docs.google.com/viewer?url=[FILE_URL_NOT_ENCODED]
    <iframe src="https://docs.google.com/gview?url=[FILE_URL]&embedded=true"></iframe>

You can add the hl query parameter to specify a different locale using ISO language codes. For instance, to use Dutch you should add &hl=nl as in the following example:

<iframe src="https://docs.google.com/gview?url=[FILE_URL]&embedded=true&hl=en"></iframe>

Examples :

    https://docs.google.com/viewer?url=http://research.google.com/archive/bigtable-osdi06.pdf
    https://docs.google.com/viewer?url=http://techslides.com/demos/samples/sample.docx

Zoho Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx', '.jpg', '.png', '.gif', etc)

Format :

https://sheet.zoho.com/sheet/view.do?url==[FILE_URL]

Mobile Apps

Office mobile apps

list of scheme names used to invoke :

    ms-word:
    ms-powerpoint:
    ms-excel:

More infos here : https://wopi.readthedocs.io/projects/officewopi/en/latest/scenarios/from_app.html

Drive mobile apps

Ex:

Googlesheets://[FILE_URL]
Googlesheets://http://docs.google.com/spreadsheets/Google-document

More infos here : https://apple.stackexchange.com/questions/113680/how-to-open-google-drive-links-directly-in-google-drive-app

Resources

Samples files for testing : http://techslides.com/sample-files-for-development

Info: http://www.labnol.org/internet/google-docs-viewer-alternative/ http://googlesystem.blogspot.com/2015/02/google-docs-viewer-page-no-longer.html

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