【问题标题】:Microsoft Word Interop - Compress all images in a documentMicrosoft Word Interop - 压缩文档中的所有图像
【发布时间】:2016-07-07 11:34:58
【问题描述】:

我正在尝试Compress a Picture 使用其自动化库。 不知道该怎么做。

static void Main(string[] args)
    {
        Application app = new Application();
        Document doc = app.Documents.Open(DOC_FILE_PATH);

        foreach(InlineShape ilPicture in doc.InlineShapes)
        {
            //ilPicture.{compress the picture}
        }
    }

默认情况下,MSWord 实际上会压缩 document.Save() 上的图像,但它会将图像压缩到 220ppi,而我希望它压缩到 150ppi 或 96ppi。

手动很容易实现。

【问题讨论】:

    标签: .net ms-word office-interop


    【解决方案1】:

    听起来您可能已经知道如何压缩图像。如果您只是在寻找从文档中获取图像的方法,请参阅this question/answer

    不幸的是,Word 没有公开那个特定的应用程序选项。

    【讨论】:

      猜你喜欢
      • 2013-07-04
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-22
      • 2016-01-11
      相关资源
      最近更新 更多