3 days in trying to learn PDFBox 1.8.10 source code examples. I think I finally got it to run, CreateVisibleSignatures.java. The output was the following indicating I need to pass in some arguments:
java org.apache.pdfbox.examples.signature.CreateVisibleSignature <pkcs12-keystore-file> <pin> <input-pdf> <sign-image> Questions 1. Do you folks have example keystore/pdf/sign-images (just so I can rule out issues with my files)? 2. Where do the keystore/pdf/sign-images need to be put? 3. How does this class know which signature field to use for each certificate based signature? My form has 8 signature lines, but there is no PDSignatureField argument for this function so I don't see how this could work. -----Original Message----- From: Tilman Hausherr <thaush...@t-online.de> Sent: December 10, 2019 3:09 PM To: users@pdfbox.apache.org Subject: Re: PDFBox 1.8.10 Question Use this: <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>jbig2-imageio</artifactId> <version>3.0.2</version> </dependency> or (older with some bugs, and I doubt you'll need it for signing anyway) <dependency> <groupId>com.levigo.jbig2</groupId> <artifactId>levigo-jbig2-imageio</artifactId> <version>1.6.5</version> </dependency> Tilman Am 10.12.2019 um 20:31 schrieb Wade Polk: > Thanks for the advice, both these messages clarify a ton of stuff! > > > > I was having issues setting up pdfbox-1.8.10 in IntelliJ Idea but I > think I almost have it working except for one dependency below seems > to be unattainable, any ideas? > > > > <*dependency*> > <*groupId*>com.levigo.jbig2</*groupId*> > <*artifactId*>levigo-jbig2-imageio</*artifactId*> > <*version*>1.6.2</*version*> > <*scope*>test</*scope*> > </*dependency*> > > > > -----Original Message----- > From: Tilman Hausherr <thaush...@t-online.de> > Sent: December 10, 2019 8:50 AM > To: users@pdfbox.apache.org > Subject: AW: Re: PDFBox 1.8.10 Question > > > > or download the sources for that version and search for > CreateVisibleSignature.java and first get it to run with your > certificate / pin / keystore / PKI device etc. > > > > Tilman > > > > > > ---------------------------------------------------------------------- > -- > > Gesendet mit der Telekom Mail App > > < > https://kommunikationsdienste.t-online.de/redirects/email_app_android_ > sendmail_footer > > > > > > > --- Original-Nachricht --- > > Von: Waldemar Dick > > Betreff: Re: PDFBox 1.8.10 Question > > Datum: 10.12.2019, 14:45 Uhr > > An: users@pdfbox.apache.org > > > > > > > > > > Hello Wade, > > > > The documentation is sparse, because PDFBox gives you all objects > according to the PDF specification. > > The naming convention is matching or very close to the names used in > the PDF specification. > > Take a look here: https://www.adobe.com/devnet/pdf/pdf_reference.html > > <https://www.adobe.com/devnet/pdf/pdf_reference.html> < > https://www.adobe.com/devnet/pdf/pdf_reference.html> > > <https://www.adobe.com/devnet/pdf/pdf_reference.html>> ; > > > > Chapter 12.8 Digital Signatures explains the signature process in PDF. > > > > PDFBox has a lot of very good examples here: > > https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/ > apache/pdfbox/examples/signature > > < > https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/ > apache/pdfbox/examples/signature > / < > > https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/ > apache/pdfbox/examples/signature/ > < > https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/ > apache/pdfbox/examples/signature/ > ; > > > > > >> PDSignature.setContents <http://PDSignature.setContents> () > > > This will take the CMS signature, that you have to create outside of > the PDF. Take a look at the examples above. > > > > The visual part of a signature has nothing to do with the digital > signature. > > The visual part is a widget annotation. > > Take a look at chapter 12.5.6.19 <http://12.5.6.19> Widget Annotations. > > > > > > > > > > Regards, > > Waldemar > > > > > >> On 10. 12 2019, at 13:58, Wade Polk <winthrop.p...@mddv.com > <mailto:winthrop.p...@mddv.com <winthrop.p...@mddv.com>> > wrote: > >> Hello Mailing List, >> Please forgive me if I’m doing this wrong, I’ve never actually used a > mailing list for support like this but a developer said this was the > best > > thing to do so here I am. > >> Long story short, I am attempting to use an older version of PDFBox > (1.8.10) to fill out and sign a PDF form. All form fields and > signature > > lines will be on the document long before this. It needs to be signed > with > > a certificate and it needs to operate very much like it does in > acrobat, > > were you see a picture and can click on it for signature details. I’ve > > attached my short code to keep this simple… my biggest issue has been > > related to understanding the object hierarchies and purpose… > documentation > > is sparse so it confuses me (e.g. PDSignature.setContents > > <http://PDSignature.setContents> : “Sets the contents.” … doesn’t > really > > tell me much, I’m guessing this is for setting the img or perhaps the > > actual certificate). > >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > <mailto:users-unsubscr...@pdfbox.apache.org > <users-unsubscr...@pdfbox.apache.org>> > >> For additional commands, e-mail: users-h...@pdfbox.apache.org > <mailto:users-h...@pdfbox.apache.org <users-h...@pdfbox.apache.org>> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org