PDA

View Full Version : Display .pdf file in Qt window screen



prabhatjha
19th March 2020, 17:16
Hello every one please assist me to display the pdf file in qt window screen with confirm button(that is for file is Ok)

d_stranz
19th March 2020, 17:35
Qt does not have any UI widgets for displaying PDF files.

There is a third-party library (Poppler (https://poppler.freedesktop.org/)) which you might be able to use. Unfortunately it is linux-only and is GPL-licensed, which means it cannot be used in a commercial closed-source product.

There is a Qt Labs project, QtPdf (https://code.qt.io/cgit/qt-labs/qtpdf.git) but this is not part of the regular Qt distribution and you will have to build it from source code. It is being considered for inclusion in a future version of Qt (5.14 or later) as a "Tech Preview" module. It is not as mature as Poppler, but it does have a more permissive license.

prabhatjha
20th March 2020, 04:08
Qt does not have any UI widgets for displaying PDF files.

There is a third-party library (Poppler (https://poppler.freedesktop.org/)) which you might be able to use. Unfortunately it is linux-only and is GPL-licensed, which means it cannot be used in a commercial closed-source product.

There is a Qt Labs project, QtPdf (https://code.qt.io/cgit/qt-labs/qtpdf.git) but this is not part of the regular Qt distribution and you will have to build it from source code. It is being considered for inclusion in a future version of Qt (5.14 or later) as a "Tech Preview" module. It is not as mature as Poppler, but it does have a more permissive license.

Thank you so much for your reply but i need to display the data in window like webview() where i can add button also to verify that loaded is correct or incorrect.
I have seen somewhere that through qwebview we can display data in widget but in my case it does not work.

d_stranz
20th March 2020, 18:00
I have read that there is a PDF.js library that allows PDF files to be displayed in browsers. I have no idea how to use this or if it will work with Qt's webview.