XPage:嵌入 PDF 和可能的 Office 文件 [英] XPages: Embed PDF and possibly Office files

查看:32
本文介绍了XPage:嵌入 PDF 和可能的 Office 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 xpage 应用程序中嵌入 PDF 文件.我们使用的是 IE11 x64,这无法更改.最后,我还需要嵌入 MS Office 文件(Word、Excel、Power Point).

I need to embed PDF files in an xpage application. We are using IE11 x64 and this cannot be changed. Eventually, I'll also need to embed MS Office files (Word, Excel, Power Point).

我查看了很多页面,但无法找到一个可行的解决方案...如果我在 IE10 模式下强制 IE11,我有一些代码可以工作,但是 Dojo 开始表现得很奇怪(无法关闭对话框,...).

I have looked at a lot of pages and couldn't get a working solution for this... I have some code that works if I force IE11 in IE10 mode, but then Dojo starts acting weird (cannot close dialog boxes, ...).

我现在在计算字段中的代码如下所示:

The code I have right now in my computed field looks like this:

var id:string = pageDocument.getDocument().getUniversalID();
var attNames = @AttachmentNames();
var url = getAttachmentURL(id,attNames);

'<object data="' + url + '#view=Fit&pagemode=none&statusbar=0&messages=0"' + 
'type="application/pdf" width="100%" height="100%" > ' + 
'<p>It appears your Web browser is not configured to display PDF files.  ' +  
'No worries, just <a href="' + url + '">click here to download the file.</a></p>'+
'</object>'

我需要一个免费的解决方案.

I need a free solution.

IBM,如果我们想与 SharePoint 竞争,这应该很容易,不是吗???

IBM, This should be made easy if we want to compete with SharePoint, no???

推荐答案

简短回答:别打扰.

长答案:虽然你可能会在 IE11 中让它为 PDF 工作,但你的老板不会高兴,因为它不会在她的 iPad 上显示,所以你需要有一个 B 计划......而且有另一个问题(阅读下文).这就是我要做的:

Long answer: While you might get it to work for PDF in IE11, your boss won't be happy, because it will not show on her iPad, so you need to have a plan B.... and there is another gotcha down the road (read below). This is what I would do:

  • Use Apache PDFBbox to extract text from the PDF and show that in the XPage.
  • Add a link to the page to open the whole PDF
  • Do the same thing for office documents using Apache POI eventually using OpenNTF POI4XPages
  • The download link should make use of WebDAV for Domino to allow round-trip editing

为什么所有这些模糊:

  • 您的用户在某个时间点会使用移动设备,并且没有移动浏览器支持嵌入(Mac 上的任何浏览器也不支持)
  • 即使您成功地使嵌入工作,用户也会开始编辑嵌入的文档并且因为您没有保存更改而感到非常沮丧
  • Your users will use mobile at some point of time and NO mobile browser does support embedding (nor do any browsers on a Mac)
  • Even if you successfully get embedding working, users will start to edit the embedded document and get really really upset since you don't save back the changes

附带说明:要求 IBM 支持在一个浏览器中运行的供应商专有技术(该技术已停产以备将来更新 - 请参阅 Spartan 项目) - 不会发生.

On a side note: asking IBM to support a technology that is vendor proprietary working in one browser (that has been EOL for future updates - see project Spartan) - ain't going to happen.

这篇关于XPage:嵌入 PDF 和可能的 Office 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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