c++ - LibreOffice C++ API 缺少 header

标签 c++ api libreoffice

我目前正在尝试在 headless 模式下使用 LibreOffice 将文档转换为 pdf。 我想使用 LibreOffice C++ API 来完成这项工作,但我的问题是我找不到 LibreOffice C++ 示例中使用的一些 header 。

#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>

我使用的是 Ubuntu 14.04 并安装了 libreoffice-dev 包。

有人可以向我解释如何正确使用 LibreOffice C++ API 吗?

最佳答案

我找到了答案。 这些文件必须使用 cppumaker 工具(随 SDK 提供)从 IDL 文件生成。从包含 cppumaker 的文件夹中,我以 root 身份运行了这个命令。

./cppumaker -Gc -O"/usr/include/libreoffice/com/sun/star" /usr/lib/ure/share/misc/types.rdb /usr/lib/libreoffice/program/types/offapi.rdb /usr/lib/libreoffice/program/types/oovbaapi.rdb

关于c++ - LibreOffice C++ API 缺少 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25056127/

相关文章:

python - 使用命名管道连接到 LibreOffice

c++ - OpenCV getDefaultPeopleDetector 的系数是多少?

javascript - ember-model、ember-reSTLess 和 emu 之间的主要区别(优点/缺点)是什么?

api - 我们可以更便宜地使用 Google Custom Search API 吗?

json - 带 [ ] 的 getJSON 不起作用

python - 获取任意文件类型的缩略图

java - java或c++中的邻接矩阵来查找连接的节点

c++ - 我如何使用 NPAPI 从 JavaScript 调用 C++ 代码

c++ - 命名空间与两个大型库发生冲突

java - LibreOffice SDK Bootstrap