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. Cyril. -----Original Message----- From: Maruan Sahyoun [mailto:sahy...@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.brem...@atos.net<mailto:cyril.brem...@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:thaush...@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:sahy...@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 >>> <sahy...@fileaffairs.de<mailto:sahy...@fileaffairs.de>>: >>> >>> Hi, >>> >>>> Am 11.04.2016 um 18:58 schrieb Tilman Hausherr >>>> <thaush...@t-online.de<mailto:thaush...@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-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> >>>> For additional commands, e-mail: >>>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org> >>>> >>> >>> -------------------------------------------------------------------- >>> - To unsubscribe, e-mail: >>> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> >>> For additional commands, e-mail: >>> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> >> For additional commands, e-mail: >> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> >> For additional commands, e-mail: >> users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> > For additional commands, e-mail: > users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org<mailto:users-unsubscr...@pdfbox.apache.org> For additional commands, e-mail: users-h...@pdfbox.apache.org<mailto:users-h...@pdfbox.apache.org>