empower-file-viewer
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

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;

Readme

Keywords

none

Package Sidebar

Install

npm i empower-file-viewer

Weekly Downloads

2

Version

0.1.4

License

none

Unpacked Size

99.3 kB

Total Files

78

Last publish

Collaborators

  • empower.dio.danganan
  • empower-harold
  • regino.victorino
  • mquibal
  • mike.baccay