有没有一种方法可以在不后台运行 Libreoffice 的情况下从 C# 读取/修改 ODF 文件?

问题描述 投票:0回答:1

我一直在研究使用 LibreOffice SDK 来编辑 ODF 文件(Writer 和 Calc 文档/ODS 电子表格),当我在示例源代码中发现这一点时,我感到非常惊讶:

    /** Connect to a running office that is accepting connections.
        @return  The ServiceManager to instantiate office components. */
    private XMultiServiceFactory connect( String [] args )
    {
        
        m_xContext = uno.util.Bootstrap.bootstrap();
        
        return (XMultiServiceFactory) m_xContext.getServiceManager();
    }

您是否真心希望在任何计算机(很可能是服务器)上安装 LibreOffice 并连接到它的运行实例只是为了编辑电子表格?如果是这样,我认为这太疯狂了。有些库可让您编辑 Excel 电子表格(例如 EPPlus 和 NPOI),但它们只允许您在库中打开文件,而不是在后台运行 Excel。有什么方法可以对 LibreOffice 文件执行类似的操作吗?

c# libreoffice odf
1个回答
0
投票

有这个,不过是用Java写的。我不知道 C# 端口。

https://odftoolkit.org/

这似乎是一个C#商业库,但我没有使用过:

https://www.independentsoft.de/odf/index.html

© www.soinside.com 2019 - 2024. All rights reserved.