如何隐藏Microsoft Office在线查看器中的状态栏 [英] How to hide status bar in Microsoft office online viewer

查看:1517
本文介绍了如何隐藏Microsoft Office在线查看器中的状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户需要只查看办公室查看器(doc,docx,ppt等...)。我试图在java中将文档转换为PDF(使用apache poi和doc4j)并使用pdf viewer显示它。但结果并不那么完美。转换后的pdf文件无法正确呈现图像和表格,因为它在文档中。所以我想在线使用Microsoft Office viewer并隐藏提供下载按钮和打印按钮的状态栏,因此只能查看。但是我无法访问iframe中的dom元素。有没有更好的方法来处理这个问题或建议任何解决方案将office文件转换为pdf或任何图像格式。

My client need view only office viewer(doc,docx,ppt etc..). I tried to convert Docs to PDF in java(using apache poi and doc4j) and show it using pdf viewer.But results are not so much perfect.The converted pdf file does not render images and tables correctly as it was in document.So i thought of using Microsoft office viewer online and hide the status bar which provide download button and print button and hence make it view only.But i couldn't access the dom elements inside iframe. Is there any better way to handle this problem or suggest any solution to convert office files to pdf or to any image formats.

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=https://calibre-ebook.com/downloads/demos/demo.docx' width='1366px' height='623px' frameborder='0'></iframe> 

这是用于在html中嵌入实时办公室查看器的代码。

This is code for embedding live office viewer in html.

我也尝试了

<iframe id='resViewer' src='https://docs.google.com/viewer?url=https://calibre-ebook.com/downloads/demos/demo.docx&embedded=true' style='width: 700px; height: 700px;' frameborder='0'></iframe>

在这种情况下,我无法隐藏Pop-Out Button.i在堆栈溢出本身中引用了很多帖子但没有这对我有用。

In this case i cannot hide Pop-Out Button.i referred many post in stack overflow itself but none of that worked for me.

推荐答案

你为什么不尝试这个 hide popout

div[aria-label="Pop-out"] {
display: none;
 }
div["aria-label=toolbar"] {
width: 52px;
}

这篇关于如何隐藏Microsoft Office在线查看器中的状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆