Project Description
Command line tool to sign pdf files using a signing certificate in pkcs12 format.
code is in c# language.

**basic .net commandline tool to sign pdf files **

This project uses the itextsharp library for the actual signing process. .net runtime 4.0 is required for using this program.

available options on the command line:

pdfsign v1.2.0, © 2011 icomedias GmbH Martin Bene
powered by iTextSharp Copyright © 1999-2011 by Bruno Lowagie and Paulo Soares
Usage: pdfsign [OPTIONS]
Sign a PDF file using a signing certificate provided in PKCS12 format.

  -i, --infile=VALUE         PDF input file
  -o, --outfile=VALUE        output file for signed PDF
  -c, --certfile=VALUE       PKCS12 signing certificate
  -p, --password=VALUE       import password for signing certificate
  -r, --reason=VALUE         signature reason (gets embedded in signature)
  -l, --location=VALUE       signature location (gets embedded in signature)
  -t, --contact=VALUE        signature contact (gets embedded in signature)
  -s, --show                 show signature (signature field visible), on: -
                               s+ off: -s-, default on
      --tsa_url=VALUE        time stamping authority URL
      --tsa_account=VALUE    time stamping authority account
      --tsa_password=VALUE   time stamping authority password
      --width=VALUE          signature width, default 180
      --height=VALUE         signature height, default 80
      --hsep=VALUE           horizontal seperation of signatures, default 10
      --vsep=VALUE           vertical seperation of signatures, default 10
      --hoffset=VALUE        horizontal offset of signatures, default 350
      --voffset=VALUE        vertical offset of signatures, default 5
      --cols=VALUE           number of signature columns, default 1
  -m, --multi                allow multiple signatures, on: -m+, off: -m-,
                               default on
  -h, -?, --help             show this help message and exit
Return Values:
         0: Success
        -1: Bad Command Line Option(s)
        -2: Error processing signing certificate
        -3: Error getting secret key
        -4: Error getting certificate chain
        -5: Error processing input file
        -6: Error opening output file
        -7: Error generating signature
        -8: Error requesting timestamp

Multiple signatures are supported; if you leave signature visibility turned on, additional signatures get seperate signature field names (Signature, Signature1, Signature2...) and are automatically positioned as a grid with --cols columns from left to right and bottom to top.

here's a sample for signing three times with visible signatures and parameters
--cols=3 --hoffset=20


Last edited Dec 2, 2011 at 2:31 PM by mabene, version 6