kiwix-desktop icon indicating copy to clipboard operation
kiwix-desktop copied to clipboard

PDF file dialog box should allow to open PDF file directly with PDF reader

Open cjohnsto-nz opened this issue 2 years ago • 14 comments

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.

cjohnsto-nz avatar Sep 17 '21 04:09 cjohnsto-nz

Really surpised that the dialog does not provide a way to open the pdf directly in a PDF reader.

kelson42 avatar Sep 17 '21 04:09 kelson42

The dialog is just the typical Windows Save As dialog. It looks like it hasn't picked up the PDF mime type. image

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 avatar Sep 17 '21 04:09 cjohnsto-nz

@cjohnsto-nz Which exact zim file and article do you test with?

kelson42 avatar Sep 17 '21 05:09 kelson42

http://x3200.media/kelson.zim

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.

cjohnsto-nz avatar Sep 17 '21 05:09 cjohnsto-nz

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

kelson42 avatar Sep 17 '21 06:09 kelson42

@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?

kelson42 avatar Nov 27 '21 20:11 kelson42

https://doc.qt.io/qt-5/qdesktopservices.html I think?

http://x3200.media/kelson.zim

This is not available anymore though, cant test

juuz0 avatar Nov 28 '21 06:11 juuz0

Oops. Moved the web server. It should be there again now.

cjohnsto-nz avatar Nov 28 '21 06:11 cjohnsto-nz

@juuz0 sure? The file is still there for me.

kelson42 avatar Nov 28 '21 06:11 kelson42

There is a zim with pdf and epub content here as well http://download.kiwix.org/zim/other/lesbelleshistoires_fr_2020-05.zim

kelson42 avatar Nov 28 '21 06:11 kelson42

@juuz0 Does your code test has been conclusive?

kelson42 avatar Dec 04 '21 05:12 kelson42

@kelson42 I can reproduce the issue, yes. But haven't figured out a way yet. Will see again

juuz0 avatar Dec 04 '21 05:12 juuz0

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.

stale[bot] avatar Apr 16 '22 15:04 stale[bot]

Added a PR, that downloads the pdf file in the downloads directory and opens it using the pdf reader.

vinurk avatar Mar 27 '24 19:03 vinurk