Home > OS >  How to preview files having different formats like .docx, .pdf, .xlsx using its base64 format in Ang
How to preview files having different formats like .docx, .pdf, .xlsx using its base64 format in Ang

Time:09-21

In my Angular application (Angular 9), there is a requirement to preview files in the browser using its base64 data. The files can be of different formats like docx, pdf, xlsx. I have looked into the ngx-doc-viewer. This library can only use the URL to show the files.

Is there any library or methods to achieve this functionality?

CodePudding user response:

You can display PDF using PDF.js, but I don't think there is a good way to display Office docs

CodePudding user response:

Using this simple one line of code, you can display .pdf files, but not .docx.

enter image description here

  • Related