pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Setting document restrictions and security
Date Sat, 11 Jul 2015 05:48:58 GMT
I just tested myself and ...????!!!!!

But I found the solution:

call
tplDoc.setAllSecurityToBeRemoved(false);

before saving

and it works for me.

(Maybe we should warn about that when calling protec()   )

Tilman

Am 11.07.2015 um 01:01 schrieb Roberto Nibali:
> 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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message