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

Command line arguments not working #2965

Closed
GitHubRulesOK opened this issue Sep 18, 2022 Discussed in #2964 · 10 comments
Closed

Command line arguments not working #2965

GitHubRulesOK opened this issue Sep 18, 2022 Discussed in #2964 · 10 comments

Comments

@GitHubRulesOK
Copy link
Collaborator

Discussed in #2964

Originally posted by exonie September 18, 2022
Hello,
SumatraPDF does not respect any arguments I tried passing to it. It's the latest Sumatra ver. 3.4.6 64-bit on Windows 10 ver. 21H2.

Neither arguments in shortcuts to PDF files, nor from the command terminal as shown in the attached images:
sumatra-arguments1
sumatra-arguments3

It does not open the indicated page, nor does it start in fullscreen. It worked fine before. Other programs on my system, like the Chrome browser, work alright with arguments.

Does anyone else have this problem or is something wrong with my set-up?

@GitHubRulesOK
Copy link
Collaborator Author

@exonie

OK I agree 3.4.6 does not work same as 3.4.5

@kjk
I confirmed there is a difference in both 32 bit and 64 bit compared to any previous so moved to issues

@hme3
Copy link

hme3 commented Sep 20, 2022

I noticed in 3.4.6 the shell open command in registry (specific to my user) for SummatraPDF.pdf
"C:\Users\Henry\AppData\Local\SumatraPDF\SumatraPDF.exe" "%1"
changing it to:
"C:\Users\Henry\AppData\Local\SumatraPDF\SumatraPDF.exe" "%1" "%2" "%3"
allows the -page 10 to work
It does generate a load error message on documents without a -page xx but the document opens

@GitHubRulesOK
Copy link
Collaborator Author

GitHubRulesOK commented Oct 20, 2023

@kjk I am reminded by this issue that Something changed in the way sumatraPDF exe is called
which may or may not have a bearing on other problems such as use by LaTeX

I am uncertain which combinations fail to work as previous since a simple command from command line seems to work well but sent via shortcuts the options dont always seem to be respected so unclear if its a registry issue or due to exe parameter handling.

@kjk
Copy link
Member

kjk commented Oct 20, 2023

I can't reproduce this.

> ."C:\Users\kjk\AppData\Local\SumatraPDF\SumatraPDF.exe" "C:\Users\kjk\!sumatra\1.pdf"
> ."C:\Users\kjk\AppData\Local\SumatraPDF\SumatraPDF.exe" "C:\Users\kjk\!sumatra\1.pdf" -page 3
> ."C:\Users\kjk\AppData\Local\SumatraPDF\SumatraPDF.exe" "C:\Users\kjk\!sumatra\1.pdf" -fullscreen

all work as expected.

Also made a copy of the shortcut and added pdf path an -page 3 arg and it worked.

One thing that doesn't work is naked -fullscreen but I don't know if that every worked or should work.

I would need a step-by-step repro that demonstrates the problem.

@GitHubRulesOK
Copy link
Collaborator Author

GitHubRulesOK commented Oct 20, 2023

@kjk thanks I agree it is naked full screen seems the common one mentioned and perhaps that is the core of this issue?

If i use a shortcut with sumatrapdf.exe filename.pdf -fullscreen -page 12 it works

@GitHubRulesOK
Copy link
Collaborator Author

@kjk
I wonder if manual needs adjusted mention

List of command line options
-presentation : start in presentation view
-fullscreen : start in full screen view

List of command line options
-presentation : start with file in presentation view
-fullscreen : start with file in full screen view

@kjk
Copy link
Member

kjk commented Oct 23, 2023

made -fullscreen work even without any file opened

@kjk kjk closed this as completed Oct 23, 2023
@exonie
Copy link

exonie commented Jan 11, 2024

This still does not work for me (SumatraPDF 3.5.2 64bit). It turns out a bit more complicated as it seems to be connected with this bug #3992

  1. In Settings: "Use tabs"-> uncheck
  2. Open some file.
  3. Try to open another file with the -page option - either through a shortcut or in the command line. It does not open at that page. The other bug also instantiates here as an additional copy of the first file is opened.

@GitHubRulesOK
Copy link
Collaborator Author

GitHubRulesOK commented Jan 11, 2024

@exonie
fixes are only generally applied to newest pre-release (or in a few cases to a new minor release) thus if a bug was in 3.5.2 it stays in 3.5.2 unless especially a fix added and Oct 23, 2023 may not have been added to 3.5.2 (2023-10-25) even if the date is later

I suspect it was not added.

@exonie
Copy link

exonie commented Jan 11, 2024

Alright, just checked it - it's fixed in the prerelease.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants