pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BREMAUD, CYRIL" <cyril.brem...@atos.net>
Subject RE: Fill an existing visible signature field with visual signature
Date Tue, 12 Apr 2016 13:54:29 GMT
I actually make it happen with 1.8.x. It was a bit dirty because I had to write my own addSignature()
function.

But now with 2.0.0 some setter disappear and the function addSignature() have radically changed.

At this point, I succeed to move and resize the PDRectangle of the visual signature but when
I want to set the correct PDSignatureField an exception occurs.



Exception in thread "main" java.lang.UnsupportedOperationException: not implemented

       at org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField.constructAppearances(PDSignatureField.java:237)

       at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:221)

       at org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField.setValue(PDSignatureField.java:121)

       at org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDVisibleSigBuilder.createSignature(PDVisibleSigBuilder.java:108)



Cyril.



-----Original Message-----

From: Evan Williams [mailto:evan.williams@zapprx.com]

Sent: Tuesday, April 12, 2016 3:17 PM

To: users@pdfbox.apache.org

Subject: Re: Fill an existing visible signature field with visual signature



For what it is worth, I tried and tried. I worked diligently to make this happen for a long
time, and then when 1.8 transitioned to 2.0 I tried again. It never worked. It failed to work
in a variety of different ways but I never got it to work.



For my own purposes I did not actually need a valid digital signature. I only needed the visual
signature. The digital signature was not required it was just a nice to have. So I just use
PDF drawing commands to draw the signature on the right place on the page using the location
of the signature field rectangle as a guide.



That probably fixes no one's problem but my own, but if it does then I am glad to help.



But I can tell you that I put way more hours than I should into making this work and it never
did.



On Tue, Apr 12, 2016 at 7:17 AM, BREMAUD, CYRIL <cyril.bremaud@atos.net>

wrote:



> @Tilman

> You may think about that discussion :

> http://stackoverflow.com/questions/31571055/how-can-i-get-pdvisiblesig

> properties-to-write-the-signature-on-the-3-page-into-t/

>

> Please find attach a sample PDF document with empty visible signatures

> fields.

>

> @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

> 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>:

> >

> > Hi,

> >

> >> Am 11.04.2016 um 18:58 schrieb Tilman Hausherr <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

> >> 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

>

>

>

>

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org

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

>







--

*Evan Williams*

Sr. Software Engineer

evan.williams@zapprx.com



*www.ZappRx.com <http://www.zapprx.com/>*
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message