Print Page | Close Window

Sign PDF with Certificates

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=437
Printed Date: 29 Sep 24 at 8:34AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Sign PDF with Certificates
Posted By: jabaltie
Subject: Sign PDF with Certificates
Date Posted: 12 Jun 06 at 3:34PM
We generate our PDFs from our http server, which already has a Certificate. I mean, it is a httpS Server.

Using QuickPDF can I add a certificate to the generated PDF, so that one can verify it's authenticity ?

I saw something similar, if I'm not wrong, on ActivePDF Toolkit.

Thanks in advance for your support !

BTW, does anyone has a PFD with a certificate, so that I can "see" how it is ? Can you post here (or tell us how to get it online?).




Replies:
Posted By: Michel_K17
Date Posted: 17 Jun 06 at 10:49AM
Hi,

   A long time ago, the makers of QuickPDF had on their roadmap plans to add digital signature (I think by using certificates), but that never happened. Therefore, I am fairly certain that QuickPDF, as it is today, will not allow you to sign a PDF.

   You mentioned ActivePDF. You can also look at using DynaPDF Professional which also supports digital signatures. The list of features and functions is available [ http://www.exp-systems.com/DynaPDF/Features.htm - here ].

   Here is the fine print (so that you know): I am a reseller of the DynaPDF library. The web site of the DynaPDF library is [ http://www.dynaforms.com - here ]. The only advantage of buying through me is the price reduction you get.

Michel


Posted By: jabaltie
Date Posted: 19 Jun 06 at 7:03AM
Hello Michel

Thank you so much 4 your attention !

Nevertheless, I dont think I could justify DynaPDF purchasing because of it's price. If you compare QuickPDF price with DynaPDF you'll see the difference.

Sorry, I dont wanna be unpolite with this, OK ?

The fact is that our University is going through a huge financial crisis and, the pressure to adopt free software is very high.

Anyway, if you could attach a sample of a signed PDF, it would be nice. I never saw one like that !

Thanks again !


Posted By: jabaltie
Date Posted: 19 Jun 06 at 10:30AM
Michel:

I wonder if you could be so kind to answer me some more questions about DynaPDF :

1) Can I use it to "stuff" data into PDF templates ? For me, PDF templates are PDF with empty form fields. Get a sample here :

http://www.DES.online.unimep.br/au/pub/temp.pdf

Also need to flatten those form fields as well.

2) Also, I need to add pictures on-the-fly. For instance, I have the pictures (JPG files) of all of our 16K students. Also from our teachers and employees (exactly like this picture of mine at this page). I need something to add these pictures to the PDF files as well. Can DynaPDF do it ?

3) Finally, of course : can DynaPDF use my httpS (SSL) server certificate to sign these PDFs ? Provided that they are ALWAYS created at the server, of course ?

4) Discounts for universities ?

5) I have heard that you were planning to offer all brazilians a copy of DynaPFD once they win FIFA World Cup Games 2006 ? Is it true ?


Posted By: chicks
Date Posted: 19 Jun 06 at 12:58PM
You can sign PDFs with the open-source iText library (java):

http://itextpdf.sourceforge.net/howtosign.html

It also supports form field filling and flattening, and just about everything else QuickPDF does (and much more) except rendering for display and printing.

I have compiled the form-filling (using an fdf) class into a Windows DLL here:

http://www.savefile.com/files.php?fid=9411235

With an Invoice example here:

http://www.savefile.com/files.php?fid=5312447

There is a .NET port of iText, which should also support digital signatures (don't know for sure).


Posted By: jabaltie
Date Posted: 19 Jun 06 at 1:29PM
Hello Chicks

Sorry about the dumb question but :

Can you use this iText with VBScript ?

As a matter of fact the language I work with is XBase++, which is ActiveX compatible.

So, if only it works with VBScript, I think it will work with XBase++ as well.

Thanks again.




Posted By: chicks
Date Posted: 19 Jun 06 at 1:52PM
No, it's Java.

However, see this thread with a discussion I had with another XBase user, who was able to use my DLL wrapper for libharu:

http://sourceforge.net/forum/forum.php?thread_id=1496825&forum_id=283687

libharu is strictly for PDF generation - it can't read and/or modify existing PDFs. It is very well written, and fairly easy to use, though, and is free. It has a good number of functions for PDF creation, and a very unrestrictive license.

You should be able to use my compiled iText DLL from XBase for filling forms, as well. Exposing all the classes and methods of iText in a DLL would be a huge undertaking that I certainly won't be tackling.

However, I might find time to expose the ability to stamp images and do digital signatures from the DLL. We'll see whether there's any other interest.

The catch is that, while iText has a very unrestrictive license, I need to use some GPL libs during the compilation process, which adds the GPL "virus" to the DLL, meaning it would be very difficult to use it in a commercial environment. Would be fine for non-commercial use, though.

Keep in mind that a lot of PDF workflows involve commandline tools - it would be very easy to integrate a commandline java digital signature tool into your workflow, as well.


Posted By: jabaltie
Date Posted: 19 Jun 06 at 2:23PM
Hello Chicks

Thanks again 4 your support !

Originally posted by chicks chicks wrote:

No, it's Java.

However, see this thread with a discussion I had with another XBase user, who was able to use my DLL wrapper for libharu:

http://sourceforge.net/forum/forum.php?thread_id=1496825&forum_id=283687



He's doying a wrapper which is payable. See his posting at XBase++ News Group :

news://news.alaska-software.com:119/579fbed6$1a13d4cf$79a51@news.alaska-software.com

Originally posted by chicks chicks wrote:



libharu is strictly for PDF generation - it can't read and/or modify existing PDFs. It is very well written, and fairly easy to use, though, and is free. It has a good number of functions for PDF creation, and a very unrestrictive license.



Does it work with form fields ?

Originally posted by chicks chicks wrote:



You should be able to use my compiled iText DLL from XBase for filling forms, as well. Exposing all the classes and methods of iText in a DLL would be a huge undertaking that I certainly won't be tackling.



Dont take your time to do it.

Originally posted by chicks chicks wrote:



However, I might find time to expose the ability to stamp images and do digital signatures from the DLL. We'll see whether there's any other interest.



Let's listen to that.

Originally posted by chicks chicks wrote:



The catch is that, while iText has a very unrestrictive license, I need to use some GPL libs during the compilation process, which adds the GPL "virus" to the DLL, meaning it would be very difficult to use it in a commercial environment. Would be fine for non-commercial use, though.



I dont know cause the use of that will be for administrative purposes. For instance, I may publish a receipt for my students which is signed. This is a comercial use, in my point of view.

Even though our University has no comercial purposes (Methodist).

Originally posted by chicks chicks wrote:



Keep in mind that a lot of PDF workflows involve commandline tools - it would be very easy to integrate a commandline java digital signature tool into your workflow, as well.


I can go on with CMD Line. Of course XBase++ has a "system()" call wish is called RunShell. However, this is cumbersome approach, I think. Also very bad for perfomance.

On the other hand, where are the iSedQuickPDF guys ?

Cant we QuickPDF users have it on our lib ?

Where's the project ?

Has iSedQuickPDF became iSedDroppedPDF ?



Posted By: chicks
Date Posted: 19 Jun 06 at 2:31PM
I wrote the DLL wrapper for libharu, and I am definitely not charging for it.

No, libharu can't fill form fields, since it can't read existing PDFs. The iText DLL can fill form fields, though.

"Commercial use" means you are profiting from the sale of your product. Don't think it will ever apply in your case.

There are other ActiveX tools out there that can digitally sign documents. Here's one that runs $149. Can't vouch for its quality.

http://www.chilkatsoft.com/crypt-activex.asp




Posted By: jabaltie
Date Posted: 19 Jun 06 at 2:43PM
What about PDFTK ?

http://www.accesspdf.com/index.php?topic=pdftk



Posted By: chicks
Date Posted: 19 Jun 06 at 2:59PM
Originally posted by jabaltie jabaltie wrote:

What about PDFTK ?


I use it every day - it's based on iText, compiled to native executable.

It can't digitally sign PDFs, but it can fill form fields using an fdf (no image stamping), and many other things at the commandline.




Posted By: chicks
Date Posted: 19 Jun 06 at 3:18PM
Originally posted by jabaltie jabaltie wrote:


He's doying a wrapper which is payable. See his posting at XBase++ News Group :


I see what you mean. He was using the ancient Panda PDF library for his first version, now he's converted to libharu (using my DLL wrapper). He is adding some nice high-level methods, like pie, line and bar charts.


Posted By: Michel_K17
Date Posted: 19 Jun 06 at 8:10PM
Hi,

   Good luck to the Brazilian team at FIFA! Personally, I'm enjoying that the Edmonton Oilers are in the Stanley Cup finals (hockey).

   I have not used the "form" functions of DynaPDF. I agree with you that nothing beats QuickPDF for price.

   I can ask for a University discount, but I believe that Dynaforms do not offer such a discount.

   Cheers!

Michel


Posted By: jabaltie
Date Posted: 20 Jun 06 at 6:41AM
Originally posted by Michel_K17 Michel_K17 wrote:

Hi,

   Good luck to the Brazilian team at FIFA! Personally, I'm enjoying that the Edmonton Oilers are in the Stanley Cup finals (hockey).


OK. I'm not that fanatic about football too. But here in Brazil this is taken so seriously that you would not believe it. Anyway, back to our point...

Originally posted by Michel_K17 Michel_K17 wrote:



   I have not used the "form" functions of DynaPDF. I agree with you that nothing beats QuickPDF for price.

   I can ask for a University discount, but I believe that Dynaforms do not offer such a discount.

   Cheers!

Michel


Hold on about this discount. I'm still around in order to find a library that is *complete* about PDF.

My plan is :

1) Find a way to sign my PDFs right now, even if it is something cumbersome.

2) Do a presentation of the project.

3) Ask money for products (tools).

So, maybe in the future !

Thanks again 4 your Dinamic support !


Posted By: chicks
Date Posted: 20 Jun 06 at 11:12AM
I looked at a couple of things -

1. You can create signature fields with iSEDQuickPDF. Use fieldtype=6 with NewFormField(). There doesn't seem to be any way to sign with iSEDQuickPDF, but the signature field can be signed with NitroPDF or Acrobat (not Reader, though).

2. I was able to sign a PDF with iText, using both a regular and a self-sign cert. Very easy to do, if you know any java.

3. These folks have a very low cost signature tool:

   http://www.pdf995.com/

   I don't know anything about it, other than it's very low cost.


Posted By: jabaltie
Date Posted: 20 Jun 06 at 1:04PM
As a matter of fact, they have an independent tool to sign PDF documents. It's called Signature995. And, it is free, although it imposes some delay (advertisements).

On my local machine, I've been able to sign a document. I dont have a digital certificate but, at least signing I can.

However, at the server, where I have a certificate, I cant sign.

Don't know what's wrong...

- Server is W2K whereas I'm XP
- Signature995 runs OK at server side but, when I open the file under Adobe Professional, it complains that it is not a valid PDF file

Are you being able to sign with it ?

If so, do you enter into Signature995 a pdf file with no signature fields or with a blank one ?

After signing, can you open and SEE the signature on Adobe ?

Thanks again !


Posted By: chicks
Date Posted: 20 Jun 06 at 3:35PM
I haven't tried any of the 995 products, so can't help you there.

Here's an example of a self-signed PDF using the iText java example, in visible mode:

http://www.geocities.com/sea_sbs/files/signed.pdf



Posted By: ossweb
Date Posted: 15 Jun 08 at 5:23AM

You can try the winnovative http://www.winnovative-software.com/pdf-creator.aspx - html to pdf converter from http://www.winnovative-software.com - http://www.winnovative-software.com . You can perform HTML to PDF conversion with 2 lines of code:

PdfConverter pdfConverter = new PdfConverter();
byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(MyURL);       



Posted By: DELBEKE
Date Posted: 15 Jul 08 at 10:47AM

Hello

I've found a free tool for signing pdf, it is Itext based and is a jar file

http://www.tbs-certificats.com/fom-serve/cache/316.html - http://www.tbs-certificats.com/fom-serve/cache/316.html

The problem, it's in french
I've used it from Vb6 and it  work fine


Posted By: lcarrere
Date Posted: 16 Jul 08 at 2:39AM
excellent !

I was looking for this kind of tool.

If anybody needs a simple traduction tell me it. I'm french.

Best regards,

Loïc


Posted By: DELBEKE
Date Posted: 17 Jul 08 at 4:17AM
Here is the module i've used
 
Option Explicit
Public Function SignPdf(FileName As String, Certificat As String, CertificatKey As String) As Boolean
  'Input :
  ' FileName = the name of the PDF to sign
  ' Certificat = the name of the Certificat file (Extension pfx)
  ' CertificatKey = the password for the certificat
  'Output :
  ' True if the pdf as been signed correctly, otherwise false
  '
  'remark :
  ' A temp file is generated during the process : signed.pdf
  Dim strTemp As String
  Dim RepFile As String
  RepFile = FileNamePath(FileName)
  'gen the command line
  strTemp = "java -jar " & Chr(34) & App.Path & "\TBSSignaturePDFInvisble.jar" & Chr(34) & " "
  strTemp = strTemp & "-in " & Chr(34) & FileName & Chr(34) & " "
  strTemp = strTemp & "-pkcs12 " & Chr(34) & Certificat & Chr(34) & " "
  strTemp = strTemp & "-passwd " & CertificatKey & " "
  'kill the old temp file if any
  On Error Resume Next
  Kill RepFile & "signed.pdf"
  On Error GoTo 0
  'synchronized shell , use your own function to replace the following SyncShell function
  SyncShell strTemp, , , True
  'control if we got the signed.pdf
  If Dir(RepFile & "signed.pdf") <> "" Then
    ' signing is ok
    SignPdf = True
    'copy the temp file , overwriting the original pdf
    Kill FileName
    Name RepFile & "signed.pdf" As FileName
  Else
    ' signing has failed
    SignPdf = False
  End If
End Function
Private Function FileNamePath(FileName As String) As String
  'return the path of a file
  Dim iPosit As Integer
  iPosit = InStrRev(FileName, "\")
  If iPosit Then
    FileNamePath = Left(FileName, iPosit)
  Else
    FileNamePath = ""
  End If
End Function
 
it should be easy to translate in others languages


Posted By: dlakhin
Date Posted: 20 Apr 10 at 10:00AM
Here is another free tool called DigiSigner to sign pdf with certificates at http://digisigner.com - http://digisigner.com . You can start it from your browser. It supports X.509 certificates, PFX key stores and produces Adobe Reader compliant digital signatures. There are also desktop versions on the site for Windows and Mac.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk