ViewerJS不显示ODT和ODS文件的内容

时间:2015-05-22 06:40:47

标签: asp.net-mvc documentviewer document-view

我只是在1小时前开始使用ViewerJS。我用PDF,ODS,ODT,ODP,TXT,XML文件试过它, 但它只支持PDF和ODS ......所有其他文件格式无法打开。 对于ODT和ODP,它在顶部显示加载文件...但内容根本不存在。

代码示例:

<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文件夹包含以下内容。

enter image description here

我是否需要更改某些内容,或者这是问题?

我可以使用其他图书馆在网页上显示文件吗?我正在使用asp.net MVC。

2 个答案:

答案 0 :(得分:0)

第一个:您使用的浏览器是什么?这可能与你的问题有关。

第二个: ViewerJS支持很多扩展文件,包括PDF,ODS,ODT,ODP,TXT,XML。检查您如何将ViewerJS的.js文件导入您的网页?

第三个:你的代码显示在这篇文章中非常安静。别担心! ^^

答案 1 :(得分:0)

您的代码片段看起来很好。由于ODS工作正常但ODP和ODT没有,因此ODP和ODT文件可能有些奇怪。你能看一下控制台日志,看看发生了什么吗?

我看到你已经在github找到了问题数据库:  https://github.com/kogmbh/ViewerJS/issues/145

请在此处或问题中粘贴控制台的输出。如果您可以将ODT和ODP文件上传到有用的地方。

相关问题