# pdf forms and digital signatures

**URL:** <https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312>\
**Category:** Classic Servoy\
**Created:** [December 11, 2010, 9:57pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312 "2010-12-11T21:57:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 11, 2010, 9:57pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/1 "2010-12-11T21:57:47Z")

</div>

Trying to figure a way of digitally signing pdfs created with the pdf forms plugin. The idea is to fill inthe fom then finalize it, and sign it, and store it. Anybody doing anything like this?

---

<div class="post-metadata">

**Author:** ![Roberto\_Blasco](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Roberto\_Blasco](https://forum.servoy.com/u/Roberto_Blasco)\
**Post date:** [December 12, 2010, 2:18am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/2 "2010-12-12T02:18:05Z")

</div>

Hi msedita.

I’ve done it with iText and Bouncy Castle.

Best regards. Roberto.

---

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 12, 2010, 3:47pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/3 "2010-12-12T15:47:40Z")

</div>

Thanks Roberto. That doesn’t look so easy though, for a non-java guy. I’ll see how far I get with it.

---

<div class="post-metadata">

**Author:** ![Roberto\_Blasco](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Roberto\_Blasco](https://forum.servoy.com/u/Roberto_Blasco)\
**Post date:** [December 12, 2010, 7:36pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/4 "2010-12-12T19:36:30Z")

</div>

I’m close to finish a digital signature plugin with support to Pdf, facturae and XAdES-XL.

Best regards. Roberto Blasco

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 12, 2010, 11:54pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/5 "2010-12-12T23:54:33Z")

</div>

I’ve done it using iText. Java sample here: [http://itextpdf.sourceforge.net/howtosign.html](http://itextpdf.sourceforge.net/howtosign.html)  
I can probably add it to the PDF Pro plugin if you’d like: [http://www.servoyguy.com/servoy\_compone … pro\_plugin](http://www.servoyguy.com/servoy_components/pdf_pro_plugin)

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [December 13, 2010, 12:36am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/6 "2010-12-13T00:36:41Z")

</div>

> Roberto Blasco:  
> I’m close to finish a digital signature plugin with support to Pdf, facturae and XAdES-XL.
> 
> Best regards. Roberto Blasco

Good stuff Roberto! Are we going to see this on ServoyForge soon?

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [December 13, 2010, 12:38am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/7 "2010-12-13T00:38:43Z")

</div>

> goldcougar:  
> I’ve done it using iText. Java sample here: [http://itextpdf.sourceforge.net/howtosign.html](http://itextpdf.sourceforge.net/howtosign.html)  
> I can probably add it to the PDF Pro plugin if you’d like: [http://www.servoyguy.com/servoy\_compone … pro\_plugin](http://www.servoyguy.com/servoy_components/pdf_pro_plugin)

Yes, I suppose that would be a welcome addition!

Which iText version are you linking against BTW? I’m asking this because there are a certain number of plugins already using (and shipping) this one: JasperReports, PdfOutput, VelocityReport and yours…

Perhaps it would be best if we could find a way to harmonize this?

---

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 13, 2010, 2:28pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/8 "2010-12-13T14:28:28Z")

</div>

Thanks folks, I’m not sure the java code in the examples is really what I need, but maybe I’m wrong. Here’s the workflow I have now:

1. Use PDF forms plugin to enter and store forms fields from selected template, revise as needed.
2. When form is complete, use PDF output plugin to create PDF document from form and fields, store PDF doc and thumbnail in table.

As part of step two, I need to be able for the user to add digital signatures to the PDF doc.

I could open the created PDF doc in Acrobat, add signatures, save it as a file, then re-import it into table. But that’s pretty clumsy, and really can;’ be automated. So I’m looking for anything that will make that easier.

BTW - iText 2.1.7 seems to work fine with both jasper and pdf\_output, not sure about velocity…

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [December 13, 2010, 2:33pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/9 "2010-12-13T14:33:46Z")

</div>

VelocityReport is using 2.1.7 as well.  
I was asking about Scott’s PDF Pro plugin and also Roberto about the version he is using for his upcoming plugin…

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 13, 2010, 9:11pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/10 "2010-12-13T21:11:24Z")

</div>

I’ve just always used the one that defaults with the Jasper plugin I think. The digital signature stuff has been in iText for a long time, so its pretty universal.

---

<div class="post-metadata">

**Author:** ![Roberto\_Blasco](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Roberto\_Blasco](https://forum.servoy.com/u/Roberto_Blasco)\
**Post date:** [December 14, 2010, 12:11am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/11 "2010-12-14T00:11:45Z")

</div>

The best iText version for pdf digital signature is 2.1.7, wich includes ocsp and timestamping support.

Best regards. Roberto Blasco.

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [December 14, 2010, 1:41am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/12 "2010-12-14T01:41:08Z")

</div>

Yes, iText 2.1.7 is also the last version which is MPL/LGPL licensed.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 14, 2010, 5:48am UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/13 "2010-12-14T05:48:35Z")

</div>

Hey Mike. So do you have an idea of how you would want to use it if I add it to the PDF Pro plugin? Are you wanting it to run server-side (always) so it signs with the certificate that is on the server, or do you want it client-side, or both?

---

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 14, 2010, 3:01pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/14 "2010-12-14T15:01:14Z")

</div>

Hi Scott. Here is the specific ideal context in which we are hoping to implement it:

I’m a clinician. My patient comes to my desk or I go to visit the patient. I may have seen the patient before, or it may be the first time. I have a record in the staff table. He has a record in the patient table. We create a form attached to his client record. We fill out a form using a template with signature fields. During the process of finalizing the form and converting it to a document, he digitally signs it and I digitally sign and certify it so there are no further changes.

Questions: Using acrobat, the certificates are created on-the-fly. I don’t know if that is possible using a plugin. Looking at the Java sample, I think the certificates have to be created separately. If that is the case, then I would like to find a way the staff person could create them and attach them somehow to the staff and patient records, and the act of signing would only be entering the password associated with the certificate(s). In any case I think the cert would preferably be on the server.

Do you think this all doable, and in a way that would be easy for a non-technical end user? For example, having them use keytool from a command line in order to create the certs I don’t think would work.

I’m welcoming any advice regarding this approach.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 14, 2010, 4:00pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/15 "2010-12-14T16:00:12Z")

</div>

Well, you could supply the certificate for them. So it could be placed on the server. And then you could use the Headless Client plugin to run server side (Or could be part of the plugin), but maybe easier with Headless Client plugin. So the user could click the button so sign, and that would start a Headless Client on the server, which would generate the unsigned pdf. Then it would run a command in the plugin to sign it with the cert on the server, and then stream the file back to the user with the File plugin.

You can get a cert in the pfx format with instructions here: [http://servoyguy.com/knowledge\_base/dep … \_and\_beans](http://servoyguy.com/knowledge_base/deployment/how_do_i_sign_my_servoy_plugins_and_beans)  
It still requires a password to do the signing, which would be in your Servoy solution.

An alternate approach would be to have each client generate their own self signed certl, which would be part of your installation process. You may even be able to automate it.

Note that you don’t need a different certificate for every user/client, etc. You can just use the same one over and over to digitally sign the file. It essentially just creates a hash to keep track that the file hasn’t been modified.

---

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 14, 2010, 5:01pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/16 "2010-12-14T17:01:46Z")

</div>

The thing about the signing, it has to indicate that each patient personally reviewed it and signed it, so I think each one will need a unique certificate.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 14, 2010, 5:20pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/17 "2010-12-14T17:20:30Z")

</div>

Hmm. well thats not exactly what digitally signing a PDF means. It just means the PDF hasn’t been modified since it was digitally signed. It has nothing to do with a manual signature or anything like that. When a file gets signed, in the metadata it shows the date and time of last modification, and if you use a official SSL cert (not a self-signed), then it is something that can be trusted and verified.  
So, once it has been manually signed with a written signature from both parties, you then digitally sign it with the SSL cert, locking the file. If anyone tampers with the file, when you open it you’ll get an error message alerting the file has been tampered with.

---

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [December 14, 2010, 6:32pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/18 "2010-12-14T18:32:30Z")

</div>

OK, I’m no expert, but I think by creating unique digital IDs for all the patients and staff, and controlling access to them, we can be reasonably sure who signed the documents, in addition to knowing they haven’t been tampered with.

---

<div class="post-metadata">

**Author:** ![Roberto\_Blasco](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Roberto\_Blasco](https://forum.servoy.com/u/Roberto_Blasco)\
**Post date:** [January 9, 2011, 7:12pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/19 "2011-01-09T19:12:24Z")

</div>

Hi All!

How can I create a new project in ServoyForge?

Best Regards. Roberto Blasco.

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [January 9, 2011, 8:51pm UTC](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312/20 "2011-01-09T20:51:32Z")

</div>

> Roberto Blasco:  
> How can I create a new project in ServoyForge?

I believe the ServoyForge homepage explains this with the following line:

> Check the [ServoyForge Wiki](http://www.servoyforge.net/projects/servoyforge/wiki) for more information on how to register, how to create a project, and anything related to the ServoyForge use.

[Next page](https://forum.servoy.com/t/pdf-forms-and-digital-signatures/13312.md?page=2)
