Display PDF file in Qt app



  • Dear Qt forum,

    Is it possible to display pdf file within my Qt GUI? I have tried with poppler according to link text but I never succeed to build it. I got many errors like: LNK1104: cannot open file ‘..\Debug\poppler.lib’

    I would appreciate your help!

    Cheers,

    Massi


  • Lifetime Qt Champion

    Hi,

    Where's you poppler lib located ?



  • Hi Massi

    wihtout poppler lib you can´t link to poppler. On windows it´s an exhausting task to get all dependencies to compile poppler. I have a set of working release and debug builds for poppler-qt5 created with msvc2013. You can get them if this setup suits you.



  • @SGaist Thank you for your reply! I started by building poppler link text using CMake with vs2008 + Qt4 under win7 64x with linking all the dependencies (freetype, zlib, openjpeg, cairo). After building the solution in vs2008, I got the following errors (There is no poppler-qt4.lib at all in my folders):

    • Error 252 fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' QtCored4.lib poppler-qt4
      Error 253 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' stress-poppler-qt4 stress-poppler-qt4
      Error 254 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' poppler_attachments poppler_attachments
      Error 255 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' stress-poppler-dir stress-poppler-dir
      Error 256 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' test-poppler-qt4 test-poppler-qt4
      Error 257 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' poppler-texts poppler-texts
      Error 259 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' poppler-forms poppler-forms
      Error 264 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' stress-threads-qt4 stress-threads-qt4
      Error 265 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' test-password-qt4 test-password-qt4
      Error 266 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' poppler-fonts poppler-fonts
      Error 286 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_search check_search
      Error 287 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_permissions check_permissions
      Error 288 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_password check_password
      Error 289 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_pagemode check_pagemode
      Error 290 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_pagelayout check_pagelayout
      Error 291 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_pagelabelinfo check_pagelabelinfo
      Error 293 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_optcontent check_optcontent
      Error 294 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_metadata check_metadata
      Error 295 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_links check_links
      Error 296 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_goostring check_goostring
      Error 297 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_lexer check_lexer
      Error 300 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_fonts check_fonts
      Error 301 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_dateConversion check_dateConversion
      Error 302 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_attachments check_attachments
      Error 303 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' check_actualtext check_actualtext
      Error 304 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' test-render-to-file test-render-to-file
      Error 305 fatal error LNK1104: cannot open file '..\src\Debug\poppler-qt4.lib' poppler_qt4viewer poppler_qt4viewer
      Error 202 fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory c:\Users\massinissa.bandou\Downloads\poppler-0.35.0.tar\poppler-0.35.0\poppler-0.35.0\poppler\CairoRescaleBox.cc 48 pdftocairo
      Error 207 fatal error C1083: Cannot open include file: 'fontconfig/fontconfig.h': No such file or directory C:\Users\massinissa.bandou\Downloads\cairo\include\cairo\cairo-ft.h 50 pdftocairo
      Error 208 fatal error C1083: Cannot open include file: 'fontconfig/fontconfig.h': No such file or directory C:\Users\massinissa.bandou\Downloads\cairo\include\cairo\cairo-ft.h 50 pdftocairo
      Error 227 fatal error C1083: Cannot open include file: 'fontconfig/fontconfig.h': No such file or directory C:\Users\massinissa.bandou\Downloads\cairo\include\cairo\cairo-ft.h 50 pdftocairo


  • @sneubert First I really appreciate your help!! Actually I'm using vs2008 + Qt4 under win7 x64. I really don't know how to get the poppler lib. It seems more difficult to build than using it!!



  • The first error explains the problem. You are doing a 32bit build but you have a 64bit Qt version. You need to build poppler with a 64bit compiler or get a 32bit Qt install. I don't think VS2008 will do 64 bit.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.