Hello,
Is there any parameter I can use to open a protected pdf that I know the password?
Hello,
Is there any parameter I can use to open a protected pdf that I know the password?
Unfortunately it’s not possible to provide a password from cmd-line. You’ll be asked for password when Sumatra tries to open the file.
there arey 2 solutions
a whitespace separated list of passwords to try when opening a password protected document
(passwords containing spaces must be quoted) (introduced in version 2.4)
DefaultPasswords =
IF YOU REPLACE A COPY OF THE INI from the command line prior to opening the file by command line it may work, the SumatraPDF-settings.txt could be stored in a secured zip and deleted afterward if you dont want others to see the plaintext however you still need to supply the password for extracting from zip
if you first open the file sumatra pdf will ask if you wish to store the password and will keep the pasword in the SumatraPDF-settings.txt file encrypted for that path\filename e.g. for test123 you will see under “filestates” a line such as
DecryptionKey = 7486a20913ab1c6920675702c3b7c0b7251cdbe84c957c5031cd301679816ee100000000000000000000000000000000
again if you store / replace the SumatraPDF-settings.txt file as required at runtime then SumatraPDF will apply that entry for that given path\filename , if you need a more general solution you will need to use a program to manipulate those entries
Does sound like a feature worth adding though IMO.
Open protected pdf from command line with password parameter
Not at the moment. It should be fairly easy to add though, so I’ll look into it.
Krzysztof Kowalczyk on October 3, 2007
Passing pdf’s password by argument to Sumatra PDF
Currently it’s not possible but it would be easy to add a command line argument -password for passing the password to the program.
Krzysztof Kowalczyk on April 18, 2008
Great solution!! Thanks!