Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Browse PDFs in a Qt Widgets application

git clone git://code.qt.io/qt-labs/qtpdf
cd qtpdf
git submodule update --init --recursive
qmake
make
cd examples/pdf/pdfviewer
qmake
make
./pdfviewer
#include <QPdfDocument>
#include <QPdfView>

QPdfDocument *document = new QPdfDocument;
document->load("document.pdf");

QPdfView *view = new QPdfView;
view->setDocument(document);
view->show();

View our 'Widgets and more' video series

About KDAB


21 Comments

2 - May - 2018

Andy

3 - May - 2018

piomiq

4 - May - 2018

Tobias Koenig

9 - Jun - 2024

Eduardo

3 - May - 2018

piomiq

4 - May - 2018

Tobias Koenig

3 - May - 2018

Thaodan

4 - May - 2018

Tobias Koenig

15 - May - 2018

Will

16 - May - 2018

Tobias Koenig

23 - May - 2018

Martin Koller

cd lib/ && ( test -e Makefile || /usr/bin/qmake-qt5 -o Makefile /home/PACKAGES/qt/5.9.2/src/qtpdf/src/lib/lib.pro ) && make -f Makefile
Traceback (most recent call last):
  File "/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/gyp2pri.py", line 162, in
    gyp = Gyp(config.input, variables)
  File "/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/gyp2pri.py", line 7, in __init__
    with open(fileName, "r") as f:
IOError: [Errno 2] No such file or directory: '/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/pdfium/pdfium.gyp'
Traceback (most recent call last):
  File "/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/gyp2pri.py", line 162, in
    gyp = Gyp(config.input, variables)
  File "/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/gyp2pri.py", line 7, in __init__
    with open(fileName, "r") as f:
IOError: [Errno 2] No such file or directory: '/home/PACKAGES/qt/5.9.2/src/qtpdf/src/3rdparty/pdfium/third_party/third_party.gyp'
Cannot read /home/PACKAGES/qt/5.9.2/src/qtpdf/src/lib/pdfium.pri: No such file or directory
Cannot read /home/PACKAGES/qt/5.9.2/src/qtpdf/src/lib/freetype.pri: No such file or directory
and later also
jsbridge.cpp:37:50: fatal error: fpdfsdk/javascript/JS_Runtime_Stub.cpp: No such file or directory

23 - May - 2018

Tobias Koenig

24 - May - 2018

Martin Koller

24 - May - 2018

Martin Koller

23 - May - 2018

JohnL

15 - Jun - 2018

Robert

15 - Jun - 2018

Tobias Koenig

18 - Jun - 2018

Robert

28 - Sept - 2021

Korbi

29 - Sept - 2021

Tobias Koenig

29 - Sept - 2021

Korbi

TobiasKoenig

Tobias Koenig

Senior Software Engineer