pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Fill an existing visible signature field with visual signature
Date Wed, 13 Apr 2016 14:52:49 GMT
Hi,

> Am 13.04.2016 um 16:26 schrieb BREMAUD, CYRIL <cyril.bremaud@atos.net>:
> 
> Hi,
> 
> 
> 
> Yeah it working like a charm ! I just add those lines just before calling doc.addSignature(signature,
this, options);
> 
> 
> 
> for(PDField pdField : doc.getDocumentCatalog().getAcroForm().getFields()) {
>   if (pdField instanceof PDSignatureField) {
>        if (pdField.getPartialName().equals("Zone de Signature 3")) {
>            pdField.getWidgets().get(0).setHidden(true);
>            ( (PDSignatureField)pdField ).setValue(signature);
>            pdField.getWidgets().get(0).setHidden(false);
>            break;
>        }
>    }
> }
> 
> doc.addSignature(signature, this, options);
> 
> I used setHidden() in order to fool the PDSignatureField.constructAppearances() function
and avoid the NotImplementedException. I think it's working because the appearances is already
build so there is no needs to build it again.
> 
> If you want to try this, just put those lines in the CreateVisibleSignature.java example
class.
> I also wrote my own buildSignature() function in order to put the visible signature field
where and with the size I need.

congratulations - great to hear that you found a solution.

BR
Maruan

> 
> 
> Cyril.
> 
> 
> -----Original Message-----
> From: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de]
> Sent: Wednesday, April 13, 2016 3:23 PM
> To: users@pdfbox.apache.org
> Subject: Re: Fill an existing visible signature field with visual signature
> 
> 
> 
> Hi,
> 
> 
> 
>> Am 13.04.2016 um 14:45 schrieb BREMAUD, CYRIL <cyril.bremaud@atos.net<mailto:cyril.bremaud@atos.net>>:
> 
>> 
> 
>>> These don't go through, you have to upload them somewhere.
> 
>> 
> 
>> Ok, I remember this PDF file was already upload on a different issue :
> 
>> https://issues.apache.org/jira/secure/attachment/12663611/documentSign
> 
>> able.pdf_signaturePAdESVisualSignatureDemo.pdf
> 
>> 
> 
>>> Yes indeed. But I read the comments again, these are quite depressing. I doubt
that this will be fixed soon.
> 
>> 
> 
>> I succeed to fill an existing signature field with PDFBox 1.8.x so there should be
a way with 2.0.0. I'm still working on it.
> 
> 
> 
> if you are looking for specific setters/getters/methods please let me know. I might be
able to point you to the 2.0 alternative.
> 
> 
> 
> BR
> 
> Maruan
> 
> 
> 
>> 
> 
>> Cyril.
> 
>> 
> 
>> -----Original Message-----
> 
>> From: Tilman Hausherr [mailto:THausherr@t-online.de]
> 
>> Sent: Tuesday, April 12, 2016 6:44 PM
> 
>> To: users@pdfbox.apache.org<mailto:users@pdfbox.apache.org>
> 
>> Subject: Re: Fill an existing visible signature field with visual
> 
>> signature
> 
>> 
> 
>> Am 12.04.2016 um 13:17 schrieb BREMAUD, CYRIL:
> 
>>> @Tilman
> 
>>> You may think about that discussion :
> 
>>> http://stackoverflow.com/questions/31571055/how-can-i-get-pdvisiblesi
> 
>>> g properties-to-write-the-signature-on-the-3-page-into-t/
> 
>> 
> 
>> Yes indeed. But I read the comments again, these are quite depressing. I doubt that
this will be fixed soon.
> 
>> 
> 
>>> 
> 
>>> Please find attach a sample PDF document with empty visible signatures fields.
> 
>> 
> 
>> These don't go through, you have to upload them somewhere.
> 
>> 
> 
>> Tilman
> 
>> 
> 
>> 
> 
>>> @Maruan
> 
>>> I succeed to set a new PDRectangle for my visible signature by writing a function
based on PDFTemplateCreator.buildPDF(). But I'm still working on filling an empty already
existing visible signature field.
> 
>>> 
> 
>>> Thank you.
> 
>>> 
> 
>>> Cyril.
> 
>>> 
> 
>>> -----Original Message-----
> 
>>> From: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de]
> 
>>> Sent: Monday, April 11, 2016 7:12 PM
> 
>>> To: users@pdfbox.apache.org<mailto:users@pdfbox.apache.org>
> 
>>> Subject: Re: Fill an existing visible signature field with visual
> 
>>> signature
> 
>>> 
> 
>>> Hi,
> 
>>> 
> 
>>>> Am 11.04.2016 um 19:05 schrieb Maruan Sahyoun <sahyoun@fileaffairs.de<mailto:sahyoun@fileaffairs.de>>:
> 
>>>> 
> 
>>>> Hi,
> 
>>>> 
> 
>>>>> Am 11.04.2016 um 18:58 schrieb Tilman Hausherr <THausherr@t-online.de<mailto:THausherr@t-online.de>>:
> 
>>>>> 
> 
>>>>> Am 11.04.2016 um 13:17 schrieb BREMAUD, CYRIL:
> 
>>>>>> Hello,
> 
>>>>>> I am trying to sign a PDF document with an existing visible signature
field. I wonder if this is possible to achieve that with PDFBox 2.0.0.
> 
>>>>>> I also want to define the size of the visible signature generate
with PDFBox.
> 
>>> the size of the signature can be set using the fields rectangle. As written before
you would be on your own to generate a matching appearance stream.
> 
>>> 
> 
>>> BR
> 
>>> Maruan
> 
>>> 
> 
>>>>>> Thank you.
> 
>>>>>> Cyril Bremaud.
> 
>>>>>> 
> 
>>>>>> 
> 
>>>>> I suspect it isn't possible. I remember that this was discussed in stackoverflow,
but I can't find the link. Can you share a file?
> 
>>>> correct - there is currently no regeneration of the appearance stream based
on the updated information.
> 
>>>> 
> 
>>>> Maruan
> 
>>>> 
> 
>>>>> Tilman
> 
>>>>> 
> 
>>>>> -------------------------------------------------------------------
> 
>>>>> -
> 
>>>>> - To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto:users-help@pdfbox.apache.org>
> 
>>>>> 
> 
>>>> 
> 
>>>> --------------------------------------------------------------------
> 
>>>> - To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto:users-help@pdfbox.apache.org>
> 
>>>> 
> 
>>> 
> 
>>> ---------------------------------------------------------------------
> 
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
>>> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto:users-help@pdfbox.apache.org>
> 
>>> 
> 
>>> 
> 
>>> 
> 
>>> 
> 
>>> ---------------------------------------------------------------------
> 
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
>>> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto:users-help@pdfbox.apache.org>
> 
>> 
> 
>> 
> 
>> ---------------------------------------------------------------------
> 
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
>> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto:users-help@pdfbox.apache.org>
> 
>> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org<mailto:users-unsubscribe@pdfbox.apache.org>
> 
> For additional commands, e-mail: users-help@pdfbox.apache.org<mailto: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