如何使用 C# 将 Word 文件内容(包含图像和表格)转换为 RFC 822 格式?

发布于 2024-08-23 15:43:49 字数 103 浏览 13 评论 0原文

  1. 我想阅读一个Word文件(包含图像和表格)。
  2. 之后我想将其内容转换为“RFC 822 格式”。

寻找上面的一些 API 和示例代码。

  1. I want to read a Word file (contains images and table).
  2. After that i want to convert it's content into "RFC 822 format ".

Looking for some APIS and sample code for above.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝眼泪 2024-08-30 15:43:49

Open XML SDK 2.0 for Microsoft Office开始阅读字文件。

Start with the Open XML SDK 2.0 for Microsoft Office to read the Word file.

呢古 2024-08-30 15:43:49

RFC 822 不是您正在寻找的规格。

RFC 5322 的摘要揭示了一个原因:

   This document specifies the Internet Message Format (IMF), a syntax
   for text messages that are sent between computer users, within the
   framework of "electronic mail" messages.  This specification is a
   revision of Request For Comments (RFC) 2822, which itself superseded
   Request For Comments (RFC) 822, "Standard for the Format of ARPA
   Internet Text Messages", updating it to reflect current practice and
   incorporating incremental changes that were specified in other RFCs.

本段第 1.1 节(“范围”)揭示了另一个问题:

   This document specifies a syntax only for text messages.  In
   particular, it makes no provision for the transmission of images,
   audio, or other sorts of structured data in electronic mail messages.
   There are several extensions published, such as the MIME document
   series ([RFC2045], [RFC2046], [RFC2049]), which describe mechanisms
   for the transmission of such data through electronic mail, either by
   extending the syntax provided here or by structuring such messages to
   conform to this syntax.  Those mechanisms are outside of the scope of
   this specification.

我认为您实际上想要另一个问题的答案,例如:

如何将 Word 消息转换为基于 MIME 的格式,以便在各种邮件用户代理中看起来都不错?

如果我错了,并且您确实询问如何将Word文档转换为纯文本电子邮件,那么您可能应该看看antiword,一个功能强大的工具,用于将 Word 文档转换为纯文本、PostScript、PDF 或 docbook。 (不过,没有迹象表明它在输出纯文本时可以对图像执行任何操作 - 但是,无论如何。)

RFC 822 is not the specification you're looking for.

The abstract for RFC 5322 reveals one reason:

   This document specifies the Internet Message Format (IMF), a syntax
   for text messages that are sent between computer users, within the
   framework of "electronic mail" messages.  This specification is a
   revision of Request For Comments (RFC) 2822, which itself superseded
   Request For Comments (RFC) 822, "Standard for the Format of ARPA
   Internet Text Messages", updating it to reflect current practice and
   incorporating incremental changes that were specified in other RFCs.

This paragraph from section 1.1 ("Scope") reveals another:

   This document specifies a syntax only for text messages.  In
   particular, it makes no provision for the transmission of images,
   audio, or other sorts of structured data in electronic mail messages.
   There are several extensions published, such as the MIME document
   series ([RFC2045], [RFC2046], [RFC2049]), which describe mechanisms
   for the transmission of such data through electronic mail, either by
   extending the syntax provided here or by structuring such messages to
   conform to this syntax.  Those mechanisms are outside of the scope of
   this specification.

I think that you actually want the answer to a different question, like:

How can I convert a Word message to a MIME-based format that will look nice in a variety of mail user-agents?

If I'm wrong, and you really are asking how to convert Word documents to plain text emails, you should probably take a look at antiword, a highly featureful tool for converting Word documents to plain text, PostScript, PDF, or docbook. (There's no indication that it can do anything with images when outputting plain text, though — yet, anyway.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文