Open cjohnsto-nz opened 3 years ago
Really surpised that the dialog does not provide a way to open the pdf directly in a PDF reader.
The dialog is just the typical Windows Save As dialog. It looks like it hasn't picked up the PDF mime type.
I think it would be best to save the file to a temp directory, or a download directory, and to follow up the file writing with ShellExecute(0, 0, L"FILE_URI", 0, 0 , SW_SHOW );
@cjohnsto-nz Which exact zim file and article do you test with?
Go to page Pro C9100/9110 and click the Point to Point Diagram link.
It's a Mediawiki I've drafted as a POC for a knowledgebase, dumped to .zim with mwoffliner.
Mime-type seems correct, so yes we have an improvement potential here:
path: I/M205_m238_ptop.pdf
» title: M205_m238_ptop.pdf
» idx: 46
» type: item
» mime-type: application/pdf
» item size: 2171551
@asashnov @juuz0 Do you know if Qt provides a way to open a known (by the OS) mime-type by an installed application, before offering the opportunity to save the file to the fs?
https://doc.qt.io/qt-5/qdesktopservices.html I think?
This is not available anymore though, cant test
Oops. Moved the web server. It should be there again now.
@juuz0 sure? The file is still there for me.
There is a zim with pdf and epub content here as well http://download.kiwix.org/zim/other/lesbelleshistoires_fr_2020-05.zim
@juuz0 Does your code test has been conclusive?
@kelson42 I can reproduce the issue, yes. But haven't figured out a way yet. Will see again
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
Added a PR, that downloads the pdf file in the downloads directory and opens it using the pdf reader.
More of a feature request than an issue, Currently the behavior of the Desktop app differs to the UWP and the browser extensions. In the UWA app, PDF files are automatically saved to a folder in the Downloads area, and opened automatically.
Kiwix deskop opens a dialog, and asks the user where they would like to save the PDF. I would imagine that in the vast majority of situations, a user clicking on a PDF in Kiwix would rather it just open than be asked where to save it to.
I would request that the files either be stored in a temporary location and automatically opened, or behave like the UWP apps and the browser extensions; storing the file in the downloads location and then opening the file in the shell associated application.