How to open PDF files per link in Qt5-Assistant-Help?
-
Are there some help or working examples for *.qhcp *.qhp files with links to PDF files?
What possibilities are supported (local PDF files with relative or absolute paths to them, PDF files on the web, Qt internal PDF Rendering, call of external Viewer like okular...)? Syntax? Do I need any system/os settings outside of Qt-Assistant, e.g. permissions?
My experience on Ubuntu 22: files obtained by conversion from old Qt4 *.adp files -> *.qhcp+qhp -> *.qch+qhc show empty frame, if I click on PDF links. These links are relative, in qthelp:// 'style'. All files, html, pdf, qhc.. are in the same directory, and I call assistant in this directory. If I include PDF files in <files>-block in *.qhp, I see "Frame load interrupted by policy change. Failed to load URL qthelp://site/proj/f.pdf WebKit Error 102". Trying 'absolute paths' did not help. The 'policy change' message let me guess, Qt-Assistant thinks, it is not allowed to start external program. If so, where can I change this? Should I be a member of some special unix group?
My system is aware about pdf file type:
$ xdg-mime query filetype f.pdf
application/pdf
$ xdg-mime query default application/pdf
okularApplication_pdf.desktop
$ okular f.pdf # works, also click in filemanager is OkQtAssistant/Menu/About -> Qt Assistant Version 5.15.3 Browser: Qt WebKit
I've seen bug reports https://bugreports.qt.io/browse/QTBUG-95269 and https://bugreports.qt.io/browse/QTBUG-95282. Are they related to this issue? Should I really update to 5.15.7 or maybe even to 6.2?
I must ask this, because I cannot find out what is 'the right way', is it my mistake in qhcp, dhp files, or is it a bug in the App, what are the options and how to choose between them (e.g. internal PDF rendering and external PDF viewer)... -
@SemP I have the exact same issue. Still looking for an answer. I tried using ‘file://‘ in my html href on PDFs, but it tries to open the PDF in a text editor.
Older versions of Assistant had a PDF tab in preferences with a default PDF viewer configurable field, but not in this one…
Still looking for a solution… I might start an http server and use http://localhost/pdffile.pdf because it will open http links in a web browser.