pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nibali <rnib...@gmail.com>
Subject Re: Setting document restrictions and security
Date Fri, 10 Jul 2015 23:01:57 GMT
Hi

On Sat, Jul 11, 2015 at 12:25 AM, Tilman Hausherr <THausherr@t-online.de>
wrote:

> Am 11.07.2015 um 00:01 schrieb Tilman Hausherr:
>
>> Am 10.07.2015 um 23:50 schrieb Roberto Nibali:
>>
>>> String ownerPassword = "";
>>> String userPassword = "hidden";
>>>
>>
>> Not sure if that is the cause, but it's userPassword that should be empty
>> and owner password set.
>>
>
> To get the restricted permissions, open with the user password (empty).
>

I did this and each possible combination thereof and the result is always
the same: none of the original access permissions get copied over to the
new PDF.


> You opened with the owner password, so you have all permissions.
>

Ok.


> If that doesn't work, look here:
> https://pdfbox.apache.org/1.8/cookbook/encryption.html
>

Almost identical to my code, obviously I added more permission bits, but
otherwise I did exactly what is described there.


> and if that doesn't give a hint, get the source code and look at the file
> TestSymmetricKeyEncryption.java
>
> This is a unit test, i.e. it does something and tests it to make sure that
> all is OK.


I looked at the file and it does essentially the same. One thing I didn't
have was the keylength setting. I added it now, but it's still not working
at all.

The result is still the same like depicted in the two urls beforehand.

Best regards
Roberto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message