我需要在我的应用程序中使用 pdf 查看器库,
我使用 C++ 和 QT
我下载了Poppler http://poppler.freedesktop.org/和代码示例Poppler Qt4 界面库 http://people.freedesktop.org/~aacid/docs/qt4/但是,我不知道如何配置该库以在我的代码中工作。
我在 Windows XP 中使用 QT Creater。
提前致谢,任何提示都值得赞赏,因为我完全迷失了。
假设您已在系统上正确安装了 poppler 头文件和库。我在 ubuntu 上运行:
./configure
make
make install
构建并安装了 poppler 库。根据我的理解,你可以使用msys/mingw在 Windows 上与此类似。
现在在你的.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;
}
应该为你构建并运行。
希望这有帮助,问候
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)