使用Poppler Qt4 c ++

编程入门 行业动态 更新时间:2024-10-23 05:33:06
本文介绍了使用Poppler Qt4 c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要一个pdf查看器库来使用我的应用程序, am使用c ++和QT

我下载 Poppler 和代码示例 Poppler Qt4接口库 但是,我不知道如何配置库在我的代码中工作。

提前感谢,任何提示都被赞赏为完全失去。

解决方案

我在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 ++

本文发布于:2023-10-09 18:25:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476436.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Poppler

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!