Unsolved QML show PDF file
-
@jsulm: Hmmm... Okay. Unfortunately in Qt5.12.4 folder there is no qmake available ...
-
@Melle_87 said in QML show PDF file:
Qt5.12.4 folder there is no qmake available
Then this is not a valid Qt installation.
How did you install it? -
@jsulm: It was not me who installed the Qt version ... So I have to ask. But is there a way to get the qmake of this version?
Or maybe it would be easier to cross compile Poppler? -
@Melle_87 said in QML show PDF file:
Or maybe it would be easier to cross compile Poppler?
Cross compiling is more complex than building directly on the device. But you need to make sure you use same Qt version on device and host machine if you want to cross compile your app later.
"But is there a way to get the qmake of this version?" - sure. If it was installed using apt then install the qt dev packages, which exactly depends on the distribution.
-
Another quick and easy way to render a pdf with QML is to use a WebView together with pdfjs lib :
WebView{ url:"file:///%path_to_pdfjs%/web/viewer.html?file=file://%PathToFile%.pdf" }
You can find a working example in Swag projet : https://github.com/a-team-fr/swag/blob/master/Swag/PDFElement.qml
-
@Charby: Okay, thank you. I will have a look at it.
-
@jsulm: Ok. Now I am sure that I am using the same Qt libs on host an Raspi. Poppler was built with the same. But now I get a SEG FAULT on start up when I set the variable QML2_IMPORT_PATH = /usr/lib/arm-linux-gnueabihf/qt5/qml in run environment.
What could be the reason for that error? -
@Melle_87 said in QML show PDF file:
What could be the reason for that error?
Don't know. Run it through debugger.