0.1.4 • Published 2 years ago

empower-file-viewer v0.1.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Empower File Viewer


Installation


npm i empower-file-viewer

Usage

Include in the component:

import FileViewer from 'empower-file-viewer';

Properties

file - Object that consist of path and type.
path - The path of the file you wanted to view, MUST be on the public folder.
type - Type of the file (e.g. pdf,png,jpeg).
watermark - This string would be used to watermark your file just for security reason if they downloaded it as image, this is an optional property.

Limitations

The file viewer only caters the following file types (.docx,.pdf,.png,.jpeg,.jpg)

Example

const sampleProps = {
  file: {
    path : 'sample.pdf', //public path
    type : 'pdf',
  },
  watermark : 'EMPOWER'
};
const App = () => {

  return (
    <div className="sample-div">
      <FileViewer
        {...sampleProps}
      />
    </div>
  );
}

export default App;