ViewerJS not display contents of ODT and ODS files

2.6k views Asked by At

I just start using ViewerJS before 1 hour. I tried it with PDF, ODS, ODT, ODP, TXT, XML files, But it only supporting PDF and ODS... All other file formats not opening. For ODT and ODP it showing loading file on top... but contents are not coming at all.

Code example :

<a href="/ViewerJS/#../Sample.odp">odp</a>
        <a href="/ViewerJS/#../Sample_invoice.odt">odt</a>

enter image description here

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="/ViewerJS/#../demodoc.pdf">PDF</a>
        <a href="/ViewerJS/#../Dev_Windows_Phone_Apps_Getting_Started_Guide.pdf">pdf2</a>
        <a href="/ViewerJS/#../sample.ods">ods</a>
        <a href="/ViewerJS/#../StockChart.ods">od2</a>

        <a href="/ViewerJS/#../Sample.odp">odp</a>  <%--loading--%>
        <a href="/ViewerJS/#../Sample-Impress-Template_Bern2014_rtryon.odp">odp2</a> <%--loading--%>
        <a href="/ViewerJS/#../Sample_invoice.odt">odt</a> <%--loading--%>

        <a href="/ViewerJS/#../hotTextInteraction.xml">xml</a> <%--not working--%>
        <a href="/ViewerJS/#../qtiplayerCommon.txt">text</a> <%--not working--%>

        <br />

        <iframe src = "/ViewerJS/#../Sample_invoice.odt" width='400' height='300'></iframe>
    </div>
    </form>
</body>
</html>

ViewerJS folder contains following things.

enter image description here

Do I need to change something, or this is issue ?

Is there any other library which I can use to show documents on web page ? I am using asp.net MVC.

2

There are 2 answers

4
ThanhND25 On

The first: What browser did you use? It maybe related to your problem.

The second: ViewerJS supports a lot of extension file include PDF, ODS, ODT, ODP, TXT, XML. Check about how you imported the .js file of ViewerJS into your web page?

The third: Your code show in this post is very quiet good. Don't worry about it! ^^

0
Jos van den Oever On

You code fragment looks fine. Since ODS works fine but ODP and ODT do not, there might be something strange with the ODP and ODT files. Can you look in the console log to see what is going on?

I see you already found the issue database at github: https://github.com/kogmbh/ViewerJS/issues/145

Please paste output from the console in here or in the issue. If you can upload the ODT and ODP files somewhere that would be helpful.