You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Damaji Kalunge <da...@technogise.com> on 2022/08/01 04:37:47 UTC

RE: Re: Preserve encryption after filling out the editable PDF.

Hello Team,

  Is there any way to get the original encryption algorithm and password via code ?

Thanks
Damaji 

On 2022/07/26 18:39:36 Tilman Hausherr wrote:
> Am 26.07.2022 um 12:22 schrieb Damaji Kalunge:
> > Hi Team,
> >       We have encrypted Editable PDF and our requirement is to fill that
> > editable pdf by preserving the same encryption.
> >   Approach :
> >
> >   Step 1:
> >
> >
> >     - Read PDF File .
> >        - if encrypted  remove encryption
> >
> >
> >>     -    pDDocument.setAllSecurityToBeRemoved(true);
> >>
> >>
> >     -  Fill the editable PDF using  *PDAcroForm*
> >        -  Save *filled editable  PDF*
> >     -  Step 2:
> >        - Read Filled editable PDF file.
> >        -
> > *Want add encryption/permission  same as original PDF  *
> >        - *save filled editable PDF with original *
> >
> > *encryption/permission . *
> >
> >    Can you please help out with this using Apache PDFBOX ?
> 
> 
> You need to know what the original encryption was, and reuse the 
> passwords (user and owner).
> 
> An alternative would be to use incremental saving, but this is tricky as 
> it requires some knowledge of the COS model.
> 
> See the testSaveIncrementalAfterSign method in TestCreateSignature.java 
> in the source code download.
> 
> Tilman
> 
> 
> 
> > Thanks
> > Damaji
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 
> 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Preserve encryption after filling out the editable PDF.

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 01.08.2022 um 06:37 schrieb Damaji Kalunge:
> Hello Team,
>
>    Is there any way to get the original encryption algorithm and password via code ?

The encryption algorithm used depends on the settings in the encryption 
directory (see the PDF specification). To get the password you'll have 
to use a password cracker. Don't do it if it is illegal in your country, 
and be aware that this type of software is sometimes malicious.

Tilman


>
> Thanks
> Damaji
>
> On 2022/07/26 18:39:36 Tilman Hausherr wrote:
>> Am 26.07.2022 um 12:22 schrieb Damaji Kalunge:
>>> Hi Team,
>>>        We have encrypted Editable PDF and our requirement is to fill that
>>> editable pdf by preserving the same encryption.
>>>    Approach :
>>>
>>>    Step 1:
>>>
>>>
>>>      - Read PDF File .
>>>         - if encrypted  remove encryption
>>>
>>>
>>>>      -    pDDocument.setAllSecurityToBeRemoved(true);
>>>>
>>>>
>>>      -  Fill the editable PDF using  *PDAcroForm*
>>>         -  Save *filled editable  PDF*
>>>      -  Step 2:
>>>         - Read Filled editable PDF file.
>>>         -
>>> *Want add encryption/permission  same as original PDF  *
>>>         - *save filled editable PDF with original *
>>>
>>> *encryption/permission . *
>>>
>>>     Can you please help out with this using Apache PDFBOX ?
>>
>> You need to know what the original encryption was, and reuse the
>> passwords (user and owner).
>>
>> An alternative would be to use incremental saving, but this is tricky as
>> it requires some knowledge of the COS model.
>>
>> See the testSaveIncrementalAfterSign method in TestCreateSignature.java
>> in the source code download.
>>
>> Tilman
>>
>>
>>
>>> Thanks
>>> Damaji
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


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