1.0.2 • Published 3 years ago

preview-office-docs v1.0.2

Weekly downloads
107
License
MIT
Repository
github
Last release
3 years ago

preview-office-docs

A React component to embed and preview office documents on website using Microsoft's officeapps.live.com .

NPM JavaScript Style Guide

Install

npm install --save preview-office-docs

Requirements

Files urls must be publicly accessible over internet

Supported formats .ppt .xls .doc .odt .ods .odp

Uses Microsoft officeapps . Check their terms when using .

Usage

import React, { Component } from 'react'

import Preview from 'preview-office-docs'

class Example extends Component {
  render() {
    return (
      <div>
        <Preview
          url='https://file-examples-com.github.io/uploads/2017/08/file_example_PPT_250kB.ppt'
          height='700px'
          width='800px'
        />

        <Preview
          url='https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_10.xls'
          height='700px'
          width='800px'
        />

        <Preview
          url='https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc'
          height='700px'
          width='800px'
        />

        <Preview
          url='https://file-examples-com.github.io/uploads/2017/10/file-sample_100kB.odt'
          height='700px'
          width='800px'
        />

        <Preview
          url=' https://file-examples-com.github.io/uploads/2017/10/file_example_ODS_10.ods'
          height='700px'
          width='800px'
        />

        <Preview
          url='https://file-examples-com.github.io/uploads/2017/10/file_example_ODP_200kB.odp'
          height='700px'
          width='800px'
        />
      </div>
    )
  }
}

Props

propisdescriptionexample
urlrequiredurl of the hosted filehttps://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc
heightoptionalheight of preview component500px
widthoptionalwidth of preview component500px

License

MIT © yatheeshraju

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago