Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Show pdf files on embedded Linux
Forum Update on Tuesday, May 27th 2025

Show pdf files on embedded Linux

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 2 Posters 841 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nekk
    wrote on 6 Sept 2023, 08:47 last edited by Nekk 9 Jun 2023, 08:49
    #1

    Hi all.

    I'm developing a Qt application for embedded Linux (built using the Yocto Project resources). The Qt version is 5.11.2. I need to show pdf documents. I read something on internet. If I well understand, the Qt packages/plugins/library that can allow to do what I need are qtwebengine, qtwebkit, poppler, evince, pdf.js but I don't know how to use them . In my Linux image are currently installed the following packages/plugins:

    qtwebengine cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
    qtwebengine-plugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
    qtwebengine-qmlplugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
    
    qtwebkit cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
    qtwebkit-dev cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
    qtwebkit-mkspecs cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
    qtwebkit-plugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
    qtwebkit-qmlplugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
    
    poppler-data all 0.4.9-r0.0
    libpoppler-glib8 cortexa7t2hf-neon-vfpv4 0.70.1-r0.0
    libpoppler81 cortexa7t2hf-neon-vfpv4 0.70.1-r0.0
    
    evince cortexa7t2hf-neon-vfpv4 3.28.2-r0.0
    evince-locale-en-gb cortexa7t2hf-neon-vfpv4 3.28.2-r0.0
    

    I'm not an expert Qt/Linux/Yocto programmer. Can someone tell me how to proceed?

    Many thanks
    Regards

    J 1 Reply Last reply 6 Sept 2023, 17:04
    0
    • N Nekk
      6 Sept 2023, 08:47

      Hi all.

      I'm developing a Qt application for embedded Linux (built using the Yocto Project resources). The Qt version is 5.11.2. I need to show pdf documents. I read something on internet. If I well understand, the Qt packages/plugins/library that can allow to do what I need are qtwebengine, qtwebkit, poppler, evince, pdf.js but I don't know how to use them . In my Linux image are currently installed the following packages/plugins:

      qtwebengine cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
      qtwebengine-plugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
      qtwebengine-qmlplugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+18412af977_2095a35f30-r0.0
      
      qtwebkit cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
      qtwebkit-dev cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
      qtwebkit-mkspecs cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
      qtwebkit-plugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
      qtwebkit-qmlplugins cortexa7t2hf-neon-vfpv4 5.11.3+git0+beaeeb9988-r0.2
      
      poppler-data all 0.4.9-r0.0
      libpoppler-glib8 cortexa7t2hf-neon-vfpv4 0.70.1-r0.0
      libpoppler81 cortexa7t2hf-neon-vfpv4 0.70.1-r0.0
      
      evince cortexa7t2hf-neon-vfpv4 3.28.2-r0.0
      evince-locale-en-gb cortexa7t2hf-neon-vfpv4 3.28.2-r0.0
      

      I'm not an expert Qt/Linux/Yocto programmer. Can someone tell me how to proceed?

      Many thanks
      Regards

      J Offline
      J Offline
      JoeCFD
      wrote on 6 Sept 2023, 17:04 last edited by JoeCFD 9 Jun 2023, 17:05
      #2

      @Nekk https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html

      N 1 Reply Last reply 7 Sept 2023, 15:41
      1
      • J JoeCFD
        6 Sept 2023, 17:04

        @Nekk https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html

        N Offline
        N Offline
        Nekk
        wrote on 7 Sept 2023, 15:41 last edited by
        #3

        @JoeCFD ,

        Hi JoeCFD.
        The link you give me is for QT 5.15. I work with an embedded QT 5.11.2 version. Do you think it would be good for my case? Honestly, I don't know how to use it. In my project I don't use ".ui" files.
        Thanks

        J 1 Reply Last reply 7 Sept 2023, 18:46
        0
        • N Nekk
          7 Sept 2023, 15:41

          @JoeCFD ,

          Hi JoeCFD.
          The link you give me is for QT 5.15. I work with an embedded QT 5.11.2 version. Do you think it would be good for my case? Honestly, I don't know how to use it. In my project I don't use ".ui" files.
          Thanks

          J Offline
          J Offline
          JoeCFD
          wrote on 7 Sept 2023, 18:46 last edited by JoeCFD 9 Jul 2023, 18:46
          #4

          @Nekk
          qpdf is available since 5.10.
          https://doc.qt.io/qt-5/qpdfdocument.html

          ui file will be converted to C++ code in the build. You do not need ui file to make Qt GUI app. I do not use it either.

          N 1 Reply Last reply 8 Sept 2023, 07:07
          0
          • J JoeCFD
            7 Sept 2023, 18:46

            @Nekk
            qpdf is available since 5.10.
            https://doc.qt.io/qt-5/qpdfdocument.html

            ui file will be converted to C++ code in the build. You do not need ui file to make Qt GUI app. I do not use it either.

            N Offline
            N Offline
            Nekk
            wrote on 8 Sept 2023, 07:07 last edited by Nekk 9 Aug 2023, 07:09
            #5

            @JoeCFD

            Based on the example you indicated me, I tried to add the mainwindow, pageselector, zoomselector files (cpp and header) in my project. I modified the ".pro" file adding "QT += pdfwdgets" but the build process return the error

            "Unknown module(s) in QT: pdfwidgets"

            This is my".pro" file

            QT += serialbus qml quick quickcontrols2 sql charts widgets pdfwidgets
            QT += opengl
            
            
            DEFINES += QT_DEPRECATED_WARNINGS
            DEFINES += QT_USE_FAST_OPERATOR_PLUS
            DEFINES += QT_USE_FAST_CONCATENATION
            
            CONFIG += c++11
            CONFIG += disable-desktop
            CONFIG += link_pkgconfig
            CONFIG += lang-all
            
            
            static {
                QT += svg
                QTPLUGIN += qtvirtualkeyboardplugin
            }
            
            QTPLUGIN += QMYSQL
            
            QT += quick multimedia
            PKGCONFIG += gstreamer-1.0 glib-2.0 gobject-2.0 gstreamer-app-1.0 gstreamer-pbutils-1.0
            
            QT += printsupport
            
            
            SOURCES += \
                canBus.cpp \
                dbManagement.cpp \
                main.cpp \
                myUtility.cpp \
                stateMachine.cpp \
                mainwindow.cpp \
                pageselector.cpp \
                zoomselector.cpp
            
            RESOURCES += \
                resources.qrc \
                qml.qrc
            
            
            TARGET = MYAPP
            
            
            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target
            
            
            disable-xcb {
                message("The disable-xcb option has been deprecated. Please use disable-desktop instead.")
                CONFIG += disable-desktop
            }
            
            
            
            HEADERS += \
                Data.h \
                canBus.h \
                dbManagement.h \
                myTimer.h \
                myUtility.h \
                stateMachine.h \
                myProcess.h \
                mainwindow.h \
                pageselector.h \
                zoomselector.h
            
            OTHER_FILES  += \
                notes.txt    \
                other_file1.txt \
                other_file2.txt
            
            

            Thanks

            J 1 Reply Last reply 8 Sept 2023, 14:29
            0
            • N Nekk
              8 Sept 2023, 07:07

              @JoeCFD

              Based on the example you indicated me, I tried to add the mainwindow, pageselector, zoomselector files (cpp and header) in my project. I modified the ".pro" file adding "QT += pdfwdgets" but the build process return the error

              "Unknown module(s) in QT: pdfwidgets"

              This is my".pro" file

              QT += serialbus qml quick quickcontrols2 sql charts widgets pdfwidgets
              QT += opengl
              
              
              DEFINES += QT_DEPRECATED_WARNINGS
              DEFINES += QT_USE_FAST_OPERATOR_PLUS
              DEFINES += QT_USE_FAST_CONCATENATION
              
              CONFIG += c++11
              CONFIG += disable-desktop
              CONFIG += link_pkgconfig
              CONFIG += lang-all
              
              
              static {
                  QT += svg
                  QTPLUGIN += qtvirtualkeyboardplugin
              }
              
              QTPLUGIN += QMYSQL
              
              QT += quick multimedia
              PKGCONFIG += gstreamer-1.0 glib-2.0 gobject-2.0 gstreamer-app-1.0 gstreamer-pbutils-1.0
              
              QT += printsupport
              
              
              SOURCES += \
                  canBus.cpp \
                  dbManagement.cpp \
                  main.cpp \
                  myUtility.cpp \
                  stateMachine.cpp \
                  mainwindow.cpp \
                  pageselector.cpp \
                  zoomselector.cpp
              
              RESOURCES += \
                  resources.qrc \
                  qml.qrc
              
              
              TARGET = MYAPP
              
              
              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /opt/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target
              
              
              disable-xcb {
                  message("The disable-xcb option has been deprecated. Please use disable-desktop instead.")
                  CONFIG += disable-desktop
              }
              
              
              
              HEADERS += \
                  Data.h \
                  canBus.h \
                  dbManagement.h \
                  myTimer.h \
                  myUtility.h \
                  stateMachine.h \
                  myProcess.h \
                  mainwindow.h \
                  pageselector.h \
                  zoomselector.h
              
              OTHER_FILES  += \
                  notes.txt    \
                  other_file1.txt \
                  other_file2.txt
              
              

              Thanks

              J Offline
              J Offline
              JoeCFD
              wrote on 8 Sept 2023, 14:29 last edited by
              #6

              @Nekk I guess you did not install the module.
              Check it out with command:
              locate libQt5PdfWidgets.so

              you can install them
              sudo apt-get install libqt5pdfwidgets5 libqt5pdf5 in Debian Linux

              N 1 Reply Last reply 8 Sept 2023, 15:41
              0
              • J JoeCFD
                8 Sept 2023, 14:29

                @Nekk I guess you did not install the module.
                Check it out with command:
                locate libQt5PdfWidgets.so

                you can install them
                sudo apt-get install libqt5pdfwidgets5 libqt5pdf5 in Debian Linux

                N Offline
                N Offline
                Nekk
                wrote on 8 Sept 2023, 15:41 last edited by
                #7

                @JoeCFD I have an embedded Yocto Linux operative system. I can't use the commands you suggested me

                J 1 Reply Last reply 8 Sept 2023, 15:46
                0
                • N Nekk
                  8 Sept 2023, 15:41

                  @JoeCFD I have an embedded Yocto Linux operative system. I can't use the commands you suggested me

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 8 Sept 2023, 15:46 last edited by JoeCFD 9 Aug 2023, 15:47
                  #8

                  @Nekk Then use what you have to install them. You have installed other Qt modules. You can do the same thing.

                  N 1 Reply Last reply 10 Sept 2023, 11:20
                  0
                  • J JoeCFD
                    8 Sept 2023, 15:46

                    @Nekk Then use what you have to install them. You have installed other Qt modules. You can do the same thing.

                    N Offline
                    N Offline
                    Nekk
                    wrote on 10 Sept 2023, 11:20 last edited by
                    #9

                    @JoeCFD I didn't install the other Qt modules (the project was passed to me) and I wouldn't know how to do it. Can anyone give me guidance on this? Thanks

                    1 Reply Last reply
                    0

                    1/9

                    6 Sept 2023, 08:47

                    • Login

                    • Login or register to search.
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved