I am trying to make a pdf viewer in Qt5.8
.I know that poppler
is a choice for Qt
but I want to do this using pdf.js
.I dont know how to embed pdf.js
with Qt5.8
. I have seen the hello world
documentation of pdf.js
but it didn't helped. Please help me.
Thanks in advance .
相关问题
- Sorting 3 numbers without branching [closed]
- QML: Cannot read property 'xxx' of undefin
- How to compile C++ code in GDB?
- Correctly parse PDF paragraphs with Python
- Why does const allow implicit conversion of refere
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
No idea why you want to use pdf.js, but you might want to have a look at QtLabs PDF module. It seems pretty recent and well integrated with current Qt. (and I guess it's more efficient than JavaScript code)
If you want to try it out, here’s how to get started:
The basic idea would be to have some widget to display HTML if you want to make use of pdf.js - it seems that
QWebEngineView
(makes use of Chromium) could do the job as it takes a minimum of code to get your first implementation done.Having an installation of pdf.js on your computer and a minimalistic gui application (QT Widgets project) prepared with your QT Creator, you could use the following code to have the basics:
From there on you can add extra functionality to your user interface. You could even add modifications to your installation of pdf.js (if needed).
If you'd need to call JavaScript on your pdf.js, you can make use of the view's page (a
QWebEnginePage
) which in turn canrunJavaScript
.