Show pdf files on embedded Linux
-
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 -
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 -
@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 -
@Nekk
qpdf is available since 5.10.
https://doc.qt.io/qt-5/qpdfdocument.htmlui 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.
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
-
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
-
@Nekk I guess you did not install the module.
Check it out with command:
locate libQt5PdfWidgets.soyou can install them
sudo apt-get install libqt5pdfwidgets5 libqt5pdf5 in Debian Linux -
@JoeCFD I have an embedded Yocto Linux operative system. I can't use the commands you suggested me
-
@Nekk Then use what you have to install them. You have installed other Qt modules. You can do the same thing.