Alcumus / react-doc-viewer

Apache License 2.0
208 stars 101 forks source link

Custom File Name Option #65

Open aaquibnaved opened 3 years ago

aaquibnaved commented 3 years ago

@mattmogford

For a project I'm working on, it was quite useful to be able to override the filename of the file I'm displaying using React Doc Viewer (as most of the files I'd be getting from an S3 store and the names wouldn't be that user friendly).

I created this small PR to accept an additional fileName parameter to override the filename if you'd like.

Feel free to comment and/or suggest improvements to the PR. I've made it as minimal as possible.

subtainishfaq7175 commented 3 years ago

That's great @aaquibnaved

abhishekchhugani commented 3 years ago

Can you please merge this. I need this feature @mattmogford @mattmogford-alcumus

cyntler commented 2 years ago

@abhishekchhugani I forked this repository and added changes from this pull request. Additionally, I added the ability to overwrite the component with loading renderer and no renderer (error). This fork is here and has the ability to add from npm: https://github.com/cyntler/react-doc-viewer