Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cjohnsto-nz opened this issue Sep 17, 2021 · 14 comments · May be fixed by #1123
Open

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

cjohnsto-nz opened this issue Sep 17, 2021 · 14 comments · May be fixed by #1123
Assignees
Milestone

Comments

@cjohnsto-nz
Copy link

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.

@kelson42
Copy link
Collaborator

kelson42 commented Sep 17, 2021

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

@cjohnsto-nz
Copy link
Author

cjohnsto-nz commented Sep 17, 2021

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 );

@kelson42
Copy link
Collaborator

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

@kelson42 kelson42 self-assigned this Sep 17, 2021
@cjohnsto-nz
Copy link
Author

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.

@kelson42
Copy link
Collaborator

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 kelson42 changed the title PDF Handling could be improved. Currently prompts for download location and does not open file. PDF file dialog box should allow to open PDF file directly with PDF reader Sep 17, 2021
@kelson42
Copy link
Collaborator

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

@juuz0
Copy link
Collaborator

juuz0 commented Nov 28, 2021

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

http://x3200.media/kelson.zim

This is not available anymore though, cant test

@cjohnsto-nz
Copy link
Author

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

@kelson42
Copy link
Collaborator

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

@kelson42
Copy link
Collaborator

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

@kelson42 kelson42 assigned juuz0 and unassigned kelson42 Nov 28, 2021
@kelson42 kelson42 added this to the 2.1.0 milestone Nov 28, 2021
@kelson42
Copy link
Collaborator

kelson42 commented Dec 4, 2021

@juuz0 Does your code test has been conclusive?

@juuz0
Copy link
Collaborator

juuz0 commented Dec 4, 2021

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

@stale
Copy link

stale bot commented Apr 16, 2022

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 stale bot added the stale label Apr 16, 2022
@vinurk
Copy link
Contributor

vinurk commented Mar 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment