react-file-viewer icon indicating copy to clipboard operation
react-file-viewer copied to clipboard

RTF support

Open DevCraftsmanShubham opened this issue 4 years ago • 6 comments

How i can, show the rtf file, i did't get how to extend the rtf and how to show the rtf file.

DevCraftsmanShubham avatar Apr 23 '20 07:04 DevCraftsmanShubham

Are you able to import and use the component for PDF, Image and Doc preview with in React application. I am facing problem importing the package, would appreciate your help.

mparupat avatar Apr 23 '20 12:04 mparupat

Are you able to import and use the component for PDF, Image and Doc preview with in React application. I am facing problem importing the package, would appreciate your help.

I tried this for pdf and this is working fine for me

import FileViewer from 'react-file-viewer';
import { CustomErrorComponent } from 'custom-error';
const file = 'pdf_url'
const type = 'pdf'

class App extends Component {

 onError(e) {
    logger.logError(e, 'error in file-viewer');
  }
  render() {

    return (
      <FileViewer
        fileType={type}
        filePath={file}
        errorComponent={CustomErrorComponent}
        onError={this.onError}/>
    );
  }
}

DevCraftsmanShubham avatar Apr 23 '20 15:04 DevCraftsmanShubham

I used create react app, to create my project its giving me memory heap error. I am not understanding if problem is with virsion of file viewer or if i missed to add any dependencies . Can you send the dependencies that you have in package.json. just to check if i have missed any dependency.

mparupat avatar Apr 23 '20 15:04 mparupat

I used create react app, to create my project its giving me memory heap error. I am not understanding if problem is with virsion of file viewer or if i missed to add any dependencies . Can you send the dependencies that you have in package.json. just to check if i have missed any dependency.

Annotation 2020-04-23 215656

DevCraftsmanShubham avatar Apr 23 '20 16:04 DevCraftsmanShubham

Thank you for your input, it still didn't work for me. The moment i import react-file-viewer compiler is throwing error for me.

image

mparupat avatar Apr 24 '20 12:04 mparupat

@mparupat change the import to this import FileViewer from "react-file-viewer";

imdeepmind avatar Jun 30 '20 12:06 imdeepmind