使用“预览”我的自定义页面中的功能 [英] Use "Preview" feature in my custom page

查看:118
本文介绍了使用“预览”我的自定义页面中的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,


我看到有一个"预览" Sharepoint 2016中的功能,可以显示PPTX和PDF文件(也可能是其他文件类型)。


像这样:




我的问题是,我是否可以在JavaScript中调用此功能的API,以便我可以将其添加到我的自定义页面。 (比方说我链接到一个文件,当用户将鼠标悬停在链接上时,会显示这个小小的"预览"框?)



谢谢,


Michael


解决方案

嗨Michael,


此预览功能来自SharePoint 2016中的Office Online Service配置.Office Online Server不提供JavaScript API以在SharePoint页面中实现相同的功能。


解决方法是您可以使用OOTB页面查看Web部件来显示和预览库中的文件:




谢谢


最好的问候


Hi experts,

I see there's a "Preview" feature in Sharepoint 2016 that can show PPTX and PDF files (probably other file types too).

like this one:

my question is, is there an API I can call in JavaScript for this feature so that I can add it to my custom page. (say I have link to a file, when user hover-over on the link, this little "Preview" box shows up?)

Thanks,

Michael

解决方案

Hi Michael,

This Preview feature is coming from Office Online Service Configuration in SharePoint 2016. Office Online Server not provide JavaScript API to achieve the same function in a SharePoint page.

A workaround is that you could use OOTB Page View Web Part to display and preview files from library:

Display a web page, folder, or file on a classic SharePoint page

Or we can use <iframe> to show the document by passing the file url:

<iframe src="http://web/Shared%20Documents/Myfile.pdf
"></iframe>


Thanks

Best Regards


这篇关于使用“预览”我的自定义页面中的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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