我需要在我的应用中使用pdf查看器库,
我正在使用c++和QT

我下载了Poppler
和代码示例The Poppler Qt4 interface library
但是,我不知道如何配置该库以在我的代码中工作。
我在Windows XP中使用QT创建器。

在此先感谢您,任何提示都将被完全遗失,不胜感激。

最佳答案

假设您已在系统上正确安装poppler header 和库。我在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;
}

应该为您构建并运行。

希望这会有所帮助,问候

关于c++ - 使用Poppler Qt4 c++,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5135353/

10-10 13:20