LibreOffice c++ API丢失头文件

LibreOffice C++ API missing headers

本文关键字:文件 c++ API LibreOffice      更新时间:2023-10-16

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

#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并安装了liboffice -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