1

In npm ng2-pdf-viewer is it possible that we can view images, excel, and other documents. I have base64 string of all documents but I want to view not only pdf but all documents. Is it possible? If so, can anyone help me?

Viveka
  • 175
  • 2
  • 12
  • you mean you have a base64 string and want to show when you open a pdf file you want to show that base64 string – errorau Dec 31 '20 at 06:18
  • @errorau I have multiple base64 strings which contains .pdf,.png,.xls files. I am looping the base64 string in html with , but I can see only the pdf not .png and .xls files. – Viveka Dec 31 '20 at 06:22

1 Answers1

1

As the repo details it, ng2-pdf-viewer is just for PDF files. If you need to display Excel documents, photos, and so on, you should use a different component.

You can make a function that picks which component to use depending on what file type you have, but you cannot display them all in ng2-pdf-viewer.

ViewerJS is an example of a Framework that supports both PDF and office documents (Open Document Format).

GeoSn0w
  • 684
  • 1
  • 9
  • 20