Results 1 to 3 of 3

Thread: read pdf with qt

  1. #1
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default read pdf with qt

    I used poppler to read pdf in my qt app. I want to merge poppler source code with my own source code because I do not to load any libraries. But poppler has thousands of c and h files and I can not achieve this. I always get errors when compile project. I want to only read pdf in my app nothing more. Is there any simple library for this? Or can I do this with qt?

    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: read pdf with qt

    You could just build Poppler with static libraries and link against these rather than the dynamic libraries.

  3. #3
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: read pdf with qt

    I compiled poppler statically. I added poppler library to my pro file:
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2014-06-14T21:26:48
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8. QT += sql
    9.  
    10. TARGET = project2
    11. TEMPLATE = app
    12.  
    13. CONFIG += staticlibs
    14. CONFIG += static
    15.  
    16. SOURCES += main.cpp\
    17. project.cpp
    18.  
    19. HEADERS += project.h
    20.  
    21. FORMS += project.ui
    22.  
    23. LIBS += /usr/lib/libpoppler-qt4.so
    To copy to clipboard, switch view to plain text mode 

    When I add .so file my app works. But if I add .a file my app does not work.

    Qt Code:
    1. LIBS += /usr/lib/libpoppler-qt4.a
    To copy to clipboard, switch view to plain text mode 

    Errors are :

    Qt Code:
    1. /usr/lib/libpoppler-qt4.a(poppler-document.o):-1: In function `Poppler::DocumentData::setPaperColor(QColor const&)':
    2. /home/eee/Desktop/poppler-0.8.7/qt4/src/poppler-private.h:230: error: undefined reference to `SplashOutputDev::setPaperColor(unsigned char*)'
    3. /usr/lib/libpoppler-qt4.a(poppler-document.o):-1: In function `Poppler::DocumentData::getOutputDev()':
    4. /home/eee/Desktop/poppler-0.8.7/qt4/src/poppler-private.h:141: error: undefined reference to `SplashOutputDev::startDoc(XRef*)'
    5. /usr/lib/libpoppler-qt4.a(poppler-document.o):-1: In function `Poppler::Document::linkDestination(QString const&)':
    6. ...
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 3
    Last Post: 3rd May 2013, 20:27
  2. Read contents from the file using QHTTP Read()?
    By Gokulnathvc in forum Newbie
    Replies: 2
    Last Post: 21st June 2011, 08:03
  3. How to read a CD
    By skepticalgeek in forum Qt Programming
    Replies: 7
    Last Post: 22nd March 2010, 08:27
  4. Best way to read xml
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 17:38
  5. How to read CD with read?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 29th June 2007, 08:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.