Word 2016加载项使用HTML插入链接的图像不会显示在在线Word中 [英] Word 2016 Add-in Linked images using HTML insert not displayed in online Word

查看:128
本文介绍了Word 2016加载项使用HTML插入链接的图像不会显示在在线Word中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Word 2016和在线Word开发一个加载项。 


在其中,在桌面版Word上,如果我使用html内容插入document.setSelectedDataAsync与图像标记和我们服务器上图像的URL,图像显示在桌面版本的Word上。  如果我将同一文件保存到OneDrive并在Word的在线版本上显示
,则图像不会显示。  如果我将图像包装在< a>中带有链接的标记,当我将鼠标悬停在Word的在线版本中的图像上时,链接会显示,但图像永远不会出现。如果我修改文件,将
保存回OneDrive,在桌面版Word中打开文件,图像就会出现。  


由于我更喜欢​​使用超链接嵌入html,我还尝试创建一个< img>标签与本地base64 DataURI的图像,虽然完美有效,无法在桌面或在线版本的Word中显示。


我希望此功能允许两个直播更新文档中的图像以及链接到我们的网络应用程序以编辑图像。


如果我获得实际图像,将其转换为Base64编码图像并插入图像(强制)在document.setSelectedDataAsync 到图像中的类型,图像显示在桌面和在线,但我们失去了自动更新和超链接
功能。 


尝试与其他加载项相同,例如Word的Wikipedia加载项,我看到完全相同的问题。如果您使用桌面版word上的插件并从插件中添加图像,然后将文件保存到OneDrive,然后在Word的在线版本上打开文件
,图像将不会显示。 / p>

在我看来,从桌面版Word 2016到在线版本的外部链接往返基于html的内容存在一个根本问题。


任何人都可以验证他们是否也看到了这一点吗?


解决方案


我正在为Word 2016和在线Word开发一个加载项。 



在它的桌面版Word中,如果我使用document.setSelectedDataAsync将html内容与图像标记和URL连接到我们服务器上的图像,则图像显示在桌面上Word的版本。  如果我将相同的文件保存到OneDrive并在Word的在线版本上显示
,则图像不会显示。  如果我将图像包装在< a>中带有链接的标记,当我将鼠标悬停在Word的在线版本中的图像上时,链接会显示,但图像永远不会出现。如果我修改文件,将其保存回OneDrive,在桌面版Word中打开文件,图像就会出现。  



因为我更喜欢使用超链接嵌入html,我还尝试创建一个< ; IMG>标签与本地base64 DataURI的图像,虽然完美有效,无法在桌面或在线版本的Word中显示。



我希望这个功能允许在文档中实时更新图像,以及链接到我们的网络应用程序来编辑图像。



如果我得到实际图像,将其转换为Base64编码图像并插入图像(强制将document.setSelectedDataAsync中的类型强制转换为图像),图像显示在桌面和在线,但我们失去了自动更新和超链接功能。&nbs p;



尝试与其他加载项相同的东西,例如Word的Wikipedia加载项,我看到完全相同的问题。如果你在桌面版本的word上使用插件并从插件中添加图像,然后将文件保存到OneDrive,然后在
上打开Word的在线版本文件,图像将不会显示。



在我看来,从桌面版Word 2016到在线版本的外部链接往返基于HTML的内容存在一个根本问题。


< p style ="padding-right:0px;字体大小:14px的;行高:21.532px; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;垂直对齐:基线;列表样式类型:无;颜色:#2a2a2a">
任何人都可以验证他们是否也看到了这个?


I'm developing an add-in for Word 2016 and online Word. 

In it, on the desktop version of Word, if I insert html content using document.setSelectedDataAsync with an image tag and URL to an image on our server, the image displays on the desktop version of Word.  If I save the same file to OneDrive and show it on the online version of Word, the image does not display.  If I wrap the image in an <a> tag with a link, the link shows up when I hover over the image in the online version of Word, but the image never appears. If I modify the file, save it back to OneDrive, open the file in the desktop version of Word, the image does appear.  

Since I'd prefer to do html embed with hyperlinks, I also tried creating an <img> tag with a local base64 DataURI for the image, while perfect valid, that failed to display in either the desktop or online version of Word.

I'd like this functionality to allow for both live updating of images in documents as well as linking to our web app to edit the images.

If instead I get the actual image, convert it to a Base64 encoded image and insert an image (coercing the type in document.setSelectedDataAsync to image), the image displays on both desktop and online, but we lose the auto-updating and hyperlinking features. 

Trying the same thing with other add-ins, for example the Wikipedia add-in for Word, I see exactly the same issue. If you use the plug-in on the desktop version of word and add an image from the plugin, then save the file to OneDrive, then open the file on the online version of Word, the image will not display.

It seems to me that there is a fundamental issue with roundtripping html-based content with external links from the desktop version of Word 2016 to the online version.

Can anyone verify if they are seeing this as well?

解决方案

I'm developing an add-in for Word 2016 and online Word. 

In it, on the desktop version of Word, if I insert html content using document.setSelectedDataAsync with an image tag and URL to an image on our server, the image displays on the desktop version of Word.  If I save the same file to OneDrive and show it on the online version of Word, the image does not display.  If I wrap the image in an <a> tag with a link, the link shows up when I hover over the image in the online version of Word, but the image never appears. If I modify the file, save it back to OneDrive, open the file in the desktop version of Word, the image does appear.  

Since I'd prefer to do html embed with hyperlinks, I also tried creating an <img> tag with a local base64 DataURI for the image, while perfect valid, that failed to display in either the desktop or online version of Word.

I'd like this functionality to allow for both live updating of images in documents as well as linking to our web app to edit the images.

If instead I get the actual image, convert it to a Base64 encoded image and insert an image (coercing the type in document.setSelectedDataAsync to image), the image displays on both desktop and online, but we lose the auto-updating and hyperlinking features. 

Trying the same thing with other add-ins, for example the Wikipedia add-in for Word, I see exactly the same issue. If you use the plug-in on the desktop version of word and add an image from the plugin, then save the file to OneDrive, then open the file on the online version of Word, the image will not display.

It seems to me that there is a fundamental issue with roundtripping html-based content with external links from the desktop version of Word 2016 to the online version.

Can anyone verify if they are seeing this as well?


这篇关于Word 2016加载项使用HTML插入链接的图像不会显示在在线Word中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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