2

Background:

Here is my use case, an app that user uploads documents and will be showed as a link allow him to click. Once it is clicked, it will popup and display the actual content. e.g. like a document viewer that you can scroll to see content.

I have around 100 file types (no video type) need to display. Whether it is displayed as original document, html or image. The user doesn't really care, as long as the content can be viewed.

Approach 1:

Native browsers are not able to support all the document types

React file viewer support some of file types, but not most of them.

  • Images: png, jpeg, gif, bmp, including 360-degree images
  • pdf
  • csv
  • xslx
  • docx
  • Video: mp4, webm
  • Audio: mp3

Question 1:

Is there any paid file viewer that support most of the file types?

Approach 2:

I upload files to micro-service, then it converts the file to an image, react can display it easily.

  1. upload file to a micro service.
  2. convert the file to an image and display in react
  3. e.g. https://medium.com/batary/file-conversion-microservice-cba0e9321151

Example supported documents

txt rtf doc docx ppt pptx xls xlsx csv html pdf 
latex bib bmp svg eps tiff png jpg gif apng 
mp3 ogg mp4 avi webm mkv mov flv

It is better, but the supported doc type need to increase. It uses LibreOffice as a process to convert files

Question 2

Is it able to support more document types?

kenpeter
  • 7,404
  • 14
  • 64
  • 95

0 Answers0