pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Chojecki <i...@rayman2200.de>
Subject Re: Fillin forms after signing
Date Wed, 27 May 2015 06:07:36 GMT
Hi Suma,
the saveIncremantal is for signing purpose only. It is current a  
limitation of the writer that only work recursively. If you want to  
save the document with the filled forms, you need to give the writer a  
hint like breadcrumbs, so he knows that you alter the page and filled  
the forms.

Otherwise, you need to fill them before signing and saving it regular  
with the save(...) method.

You can take a look at the PDDocument/COSDocument addSignature method  
to know how it works at the moment for signing and adapt it to your  
purpose.

Maybe in a coming 2.x version of the pdfbox, this will be solved.

Best regards
Thomas

Zitat von Suma Rani <sumasuga18@gmail.com>:

> Sorry. When i do saveIncremental, the signature is valid but the form field
> value is not changed. If I do save, the fiedvalue is correct, but the
> signatures fail.
>
> On Tue, May 26, 2015 at 6:09 PM, Maruan Sahyoun <sahyoun@fileaffairs.de>
> wrote:
>
>> Hi,
>>
>> > Am 26.05.2015 um 12:54 schrieb Suma Rani <sumasuga18@gmail.com>:
>> >
>> > Hello,
>> >
>> > I am trying to change a form after signing. The flow is like this:
>> > 1. add a form to the existing document
>> > 2. Fill some of the fields and sign it
>> > 3. Change the above fields/ fill some other fields and sign it again.
>> >
>> > 1 and 2 are done. no problem with that. But the signature becomes invalid
>> > when I do the 3rd.
>>
>> what do you mean by invalid. Is it that you get a warning sign in Adobe
>> Reader or Acrobat? Or is it that the signature is corrupt ….
>>
>> BR
>> Maruan
>>
>> > Both signatures are invisible and my first signature
>> > allows form fill-in. NO problem when i edit it with adobe reader. This is
>> > the code I am using for the part  3.
>> >
>> > PDSignature signature = new PDSignature();
>> > signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
>> > signature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);
>> > signature.setReason("Signing second time");
>> > signature.setSignDate(Calendar.getInstance());
>> >
>> > PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
>> > PDField field = acroForm.getField("field2");
>> > COSString fieldValue = new COSString("FIELD2");
>> > field.getDictionary().setItem(COSName.V, fieldValue);
>> > doc.addSignature(signature, this);
>> > doc.saveIncremental(fis, fos);// Of course, doc.save() wont work.
>> > doc.close();
>> >
>> > In short, I would like to know how to add form fill-ins by
>> saveincremental
>> >
>> > Thanks
>>
>>
>> ---------------------------------------------------------------------
>> 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


Mime
View raw message