在显示 .msg 文件的 HTML 正文时,是否可以呈现与 Outlook 完全相同的 HTML?
我们正在显示从 Outlook 导出的 .MSG 文件中提取的 HTML 正文。
要显示 HTML 正文,需要从 PR_RTF_compressed
字段解压缩 RTF,然后将 RTF 解码为 HTML(Outlook 在导出 MSG 文件时实际上将 HTML 编码为 RTF)。我们使用 RDO 库来解析 msg 文件并提取 HTML 正文。
RDO 生成的一些 HTML 并不总是与 Outlook 显示的相同(文本大小有时不匹配等)。
是否有人知道 HTML 正文提取的实现最接近 Outlook 显示的 HTML 的外观,或者这是不可能的?
We are displaying HTML body extracted from .MSG files exported from Outlook.
To display the HTML body, one needs to decompress RTF from PR_RTF_Compressed
field and then decode the RTF to HTML (outlook actually encodes HTML to RTF when exporting MSG files). We are using RDO library to parse the msg files and extract the HTML body.
RDO produces some HTML that is not always the same as Outlook displays (text size sometimes does not match etc.)
Is anybody aware of an implementation of HTML body extraction that would most closely match the appearance of HTML displayed by Outlook or is this impossible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想法多于答案……
您是否在 IE 等浏览器中显示提取的正文?
我预计问题在于 Outlook (2007) 使用 Word 呈现引擎来显示 HTML,而浏览器则使用自己的引擎。因此,我认为您不太可能找到有帮助的提取实现。
您能否将样式表应用于提取的正文文档,以覆盖大部分不一致之处?
more thoughts than an answer...
Are you displaying the extracted body in a browser such as IE?
I expect that the issue is that Outlook (2007) uses the Word rendering engine to display HTML while browsers use their own. So, I don't think you are likely to find an extraction implementation that will help.
Can you apply a stylesheet to your extracted body document, that will override most of the inconsistencies?