我需要在我的应用程序中使用 pdf 查看器库,我正在使用 c++ 和 QT
我下载了Poppler 和代码示例Poppler Qt4 接口库 ,但是我不知道如何配置该库以在我的代码中工作。我在 windows xp 中使用 QT 创建器。
在此先感谢,任何提示都表示赞赏,因为我完全迷路了。
假设您已在系统上正确安装了 poppler 头文件和库。我在 ubuntu 上,并且正在运行:
./configure
make
make install
制作并安装了 poppler 库。据我了解,您可以在 Windows 上使用msys/mingw来进行类似的操作。
现在在您的.pro
文件中添加以下行:
INCLUDEPATH += /path_to_poppler_include_files/qt4
LIBS += -L/path_to_poppler_libs -lpoppler-qt4
和这样的代码:
#include <poppler-qt4.h>
....
QString filename;
Poppler::Document* document = Poppler::Document::load(filename);
if (!document || document->isLocked())
{
// ...
delete document;
}
应该为您构建和运行。
希望这会有所帮助,问候