Dear All,
I have an encrypted PDF file that I can open just fine in Adobe Reader under Windows. But I'd really prefer to read it in Xpdf (or any open source tool). Unfortunately, Xpdf needs the password supplied on the command line, and the password contains characters that are special to the shell. (Actually, I don't think I need to be coy about this. It contains a percent sign, an ampersand, and a pound sign.) I've tried escaping the special characters with backslashes, enclosing the password in various types of quotes, and putting the password in an environment variable, but all of these result in "Incorrect password" errors and failure to open the document. Any ideas, please?
On 30-Jan-10 23:00:00, Dan Hatton wrote:
Dear All, I have an encrypted PDF file that I can open just fine in Adobe Reader under Windows. But I'd really prefer to read it in Xpdf (or any open source tool). Unfortunately, Xpdf needs the password supplied on the command line, and the password contains characters that are special to the shell. (Actually, I don't think I need to be coy about this. It contains a percent sign, an ampersand, and a pound sign.) I've tried escaping the special characters with backslashes, enclosing the password in various types of quotes, and putting the password in an environment variable, but all of these result in "Incorrect password" errors and failure to open the document. Any ideas, please? --
Thanks, Dan
You might try seetting it as an environment variable:
$ passwd="abc%cd&ef£gh" $ echo $passwd abc%cd&ef£gh
'man xpdf' gives the password options:
-opw password Specify the owner password for the PDF file. Providing this will bypass all security restrictions.
-upw password Specify the user password for the PDF file.
so probably something like
xpdf -upw $passwd ...
may work. The other thing to watch is what encoding "£" may have (e.g. utf8 where it is 'a3c2 000a' in hex; or ISO 8859-1 where it is 00A3[hex] = 163[dec] = 243[oct]), since there is no "£" in ASCII.
There should be no problem with "%" or "&", since these have ASCII encodings.
Good luck! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 31-Jan-10 Time: 00:07:22 ------------------------------ XFMail ------------------------------
On 30 Jan 2010, at 23:00, Dan Hatton wrote:
Dear All,
I have an encrypted PDF file that I can open just fine in Adobe Reader under Windows. But I'd really prefer to read it in Xpdf (or any open source tool). Unfortunately, Xpdf needs the password supplied on the command line, and the password contains characters that are special to the shell. (Actually, I don't think I need to be coy about this. It contains a percent sign, an ampersand, and a pound sign.) I've tried escaping the special characters with backslashes, enclosing the password in various types of quotes, and putting the password in an environment variable, but all of these result in "Incorrect password" errors and failure to open the document. Any ideas, please?
The pound sign could be in the problem, what charset is your X in and is the command prompt in the same? Bill
On Sat, 30 Jan 2010, Dan Hatton wrote:
I have an encrypted PDF file that I can open just fine in Adobe Reader under Windows. But I'd really prefer to read it in Xpdf (or any open source tool). Unfortunately, Xpdf needs the password supplied on the command line, and the password contains characters that are special to the shell. (Actually, I don't think I need to be coy about this. It contains a percent sign, an ampersand, and a pound sign.) I've tried escaping the special characters with backslashes, enclosing the password in various types of quotes, and putting the password in an environment variable, but all of these result in "Incorrect password" errors and failure to open the document. Any ideas, please?
During an e-mail catch-up session, I realize I haven't yet posted what the resolution of this was. I found a version of Xpdf (3.0-r2, IIRC) on Cygwin which accepts the password in a GUI dialogue box. Problem solved. Thanks to Bill and Ted for their replies.
On Wed, Apr 21, 2010 at 11:45 AM, Dan vi5u0-alug@yahoo.co.uk wrote:
On Sat, 30 Jan 2010, Dan Hatton wrote:
Thanks to Bill and Ted for their replies.
'Excellent!'
/hides
Ricky