I've been sent some password-protected PDF files.
These have empty user passwords, but I don't think that the fact that
they're empty passwords matters.
When I go to open them, I am prompted for the password (which I
enter), then OO tells me that the document is password-protected and
can't be opened.
Attached is a very simple test case.
== File 1:
trivial-original.pdf a simple PDF file, made by OO PDF export
(opened fine using OO).
== File 2:
trivial-with_password-pw-and_empty_user_password.pdf the same file,
with owner password of 'pw' set, with all features allowed. (opened
fine using OO).
This was created using pdftk:
pdftk trivial-original.pdf output trivial-with_password-pw-
and_empty_user_password.pdf owner_pw pw user_pw '' allow AllFeatures
== File 3:
trivial-with_password-pw-allow_some.pdf the same file, with owner
password set, with no user password set
OO prompts for a password, then says it can't open the file.
This was created with:
pdftk trivial-original.pdf output trivial-with_password-pw-
allow_some.pdf owner_pw pw allow ModifyContents allow CopyContents
allow ModifyAnnotations
== File 4:
trivial-with_password-pw-allow_some_and_printing.pdf the same file,
but with printing allowed too.
OO prompts for a password, then opens the file OK. Made with:
pdftk trivial-original.pdf output trivial-with_password-pw-
allow_some_and_printing.pdf owner_pw pw allow ModifyContents allow
CopyContents allow ModifyAnnotations allow Printing
Acrobat Reader opens all three without problem or prompting.
So it appears that some (undocumented?) combination of permission
flags is causing this problem. Unfortunately, the error message
("encrypted and can't be opened") is not helpful. After all,
encryption by itself isn't the problem. At the very least, a message
that discloses *which* permissions are required would be helpful.
Clearly, from a user's point of view, there is no little reason to
respect the permission flags in the document; if you can decrypt it
far enough to allow displaying or printing the document, then you
should be able to import a copy of the contents. After all, this is
*importing*, not *editing*.
Looking further, it would be helpful if xpdf didn't include checks for
the permission flags.
The patch from Johannes Bauer to remove these flags appears to be
appropriate:
http://www.johannes-bauer.com/xpdf/xpdf-3.02-protection.patch
--
Ned Konz
Seattle, WA
360-629-1091
http://bike-nomad.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]