簡體   English   中英

使用Poppler Qt4 C ++

[英]using Poppler Qt4 c++

我需要在我的應用程序中使用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;
}

應該為您構建並運行。

希望這會有所幫助,問候

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM