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

Show pdf files on embedded Linux

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 2 Posters 1.7k 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 last edited by Nekk
    #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

    JoeCFDJ 1 Reply Last reply
    0
    • N Nekk

      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

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

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

      N 1 Reply Last reply
      1
      • JoeCFDJ JoeCFD

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

        N Offline
        N Offline
        Nekk
        wrote on 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

        JoeCFDJ 1 Reply Last reply
        0
        • N Nekk

          @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

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #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
          0
          • JoeCFDJ JoeCFD

            @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 last edited by Nekk
            #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

            JoeCFDJ 1 Reply Last reply
            0
            • N Nekk

              @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

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on 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
              0
              • JoeCFDJ JoeCFD

                @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 last edited by
                #7

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

                JoeCFDJ 1 Reply Last reply
                0
                • N Nekk

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

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #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
                  0
                  • JoeCFDJ JoeCFD

                    @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 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

                    • Login

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