AckerApple / pdfbox-cli-wrap

A wrapper for making PDFBox CLI commands
MIT License
5 stars 5 forks source link

Embed timstamp signature #1

Open sourabhsparkala opened 7 years ago

sourabhsparkala commented 7 years ago

Hello,

Is there a way to sign a single field in the form, rather than signing the entire pdf document?

Could you please share an example? Or maybe advice on a way to sign just a PDSignatureField.

Thanks Sourabh

AckerApple commented 7 years ago

I think you are asking me about adding a hand signature image overlay. A time stamp signature is something else.

To add a hand signature, here's how we do it:

That's how we do it. Read form, fill form with img config, save to encrypted file with the other topic of digital timestamp signtaures.

Please provide feedback. This conversation will essentially go into the docs for this topic.

sourabhsparkala commented 7 years ago

Hello Acker,

Thank you for the reply.

The idea here is that I want "a specific signature field" to be signed by a certified and trusted user. When I do read the pdf with pdfboxCliWrap.getFormFields(readablePdf), I get the Type of the field as org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField and the value to be inserted is of type org.apache.pdfbox.pdmodel.interactive.form.PDSignature.

A screen shot is provide below for more information.

Hence, I need is to insert a PDSignature object into the form filling.

  1. I have a trusted keystore test.pfx
  2. The password of the keystore.
  3. I want to create an instance of the PDSignature with the same and pass the object to the field of the pdf.

image

Please let me know, if this is possible.

Regards Sourabh

AckerApple commented 7 years ago

We are currerntly not utilizing PDSignature fields. Would need some PDFBOX examples to add to this package. Pull request with test would most likely be accepted.