使用Poppler Qt4 c ++ [英] using Poppler Qt4 c++
问题描述
我需要一个pdf查看器库来使用我的应用程序,
am使用c ++和QT
我下载 Poppler
和代码示例 Poppler Qt4接口库
但是,我不知道如何配置库在我的代码中工作。
提前感谢,任何提示都被赞赏为完全失去。
<假设您已经在系统上正确安装了poppler头文件和库文件,那么我们可以使用div class =h2_lin>解决方案
我在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文件名;
Poppler :: Document * document = Poppler :: Document :: load(filename);
if(!document || document-> isLocked())
{
// ...
删除文档;
}
应该为您构建和运行。
希望这有助于您,
i need a pdf viewer library to be used in my app, am using c++ and QT
i downloaded Poppler and code example The Poppler Qt4 interface library but, i do not know how to configure the library to work in my code. i am using QT Creater, in windows xp.
thanks in advance, any hint is appreciated as am completely lost.
assuming you've installed poppler headers and libraries on your system correctly. I'm on ubuntu, and running:
./configure
make
make install
made poppler libraries built and installed. From my understanding you can use msys/mingw on windows to something similar to this.
Now in your .pro
file add following lines:
INCLUDEPATH += /path_to_poppler_include_files/qt4
LIBS += -L/path_to_poppler_libs -lpoppler-qt4
and the code like this:
#include <poppler-qt4.h>
....
QString filename;
Poppler::Document* document = Poppler::Document::load(filename);
if (!document || document->isLocked())
{
// ...
delete document;
}
should build and run for you.
hope this helps, regards
这篇关于使用Poppler Qt4 c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!