无法将动态生成的图像从任何浏览器粘贴到 MS Word [英] Can't paste dynamically generated image from any browser to MS Word

查看:64
本文介绍了无法将动态生成的图像从任何浏览器粘贴到 MS Word的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序可以生成图像,然后将其推送到浏览器.图像显示绝对没有困难,也可以通过右键单击保存,并且可以毫无问题地粘贴到 Gimp 等应用程序中,但无法粘贴到 MS Word 中.我摆弄了应用程序的所有方面以确保内容类型和所有其他标题都是正确的,但这对能够粘贴图像没有影响.

I have an application that generates an image and then pushes this to the browser. The image displays with absolutely no difficulty, and can also be saved by right clicking, and can be pasted without issue into applications such as Gimp but cannot be pasted into MS Word. I fiddled with all aspects of the application to make sure that content-types and all other headers are correct, but this has no effect on being able to paste in the image.

推荐答案

解决方案有点奇怪.这与 MS Word 实际上根据剪贴板中存储的HTML 格式"格式的内容从 Web 重新下载图像的明显事实有关.因此,网址问题可能会导致图片无法正确粘贴.

The solution is a little strange. It is related to the apparent fact that MS Word actually re-downloads the image from the web based on the contents of the "HTML Format" format stored in the clipboard. Because of this, issues with the URL can cause the image to not paste correctly.

就我而言,URL 太长.我向我的应用程序传递了很多参数,而 URL 字符串超过了 255 个字符.看起来幻数是 253.因此,如果您似乎无法将动态生成的图像复制到 MS Word 中,这可能是您的问题.

In my case, the URL was too long. I was passing a lot of parameters to my application and the URL string exceeded 255 characters. It looks like the magic number is 253. So, if you can't seem to copy dynamically generated images into MS Word, this could be your issue.

此外,由于 MS Word 正在针对图像的 URL 发出请求,如果您的应用程序使用自签名 SSL 证书,它也会失败(尽管以一种奇怪的方式),因为 MS Word 在尝试连接时会失败安全.

Also, since MS Word is doing a request against the URL for the image, it will also fail (although in a stranger way) if your application uses a self-signed SSL certificate, because MS Word will fail when trying to connect securely.

这篇关于无法将动态生成的图像从任何浏览器粘贴到 MS Word的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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