Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3547

[Patch] Improved signing of existing signature fields

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.4, 3.0.0 PDFBox
    • Component/s: Signing
    • Labels:
      None
    • Flags:
      Patch

      Description

      Short: The handling of signing existing signature fields must be improved (and this patch is part of that effort).

      Details and background
      The current implementation for visible signatures always adds new signature fields when signing documents.
      In that case for that signature everything has to be definied (field properties, coordinates etc.).

      Another quite common use case is the use of an existing signature field which should be signed.
      There are basically two different roles: The document creator who creates the document with all its texts, graphics and form fields. The creator knows best where everything should be positioned and is even sometimes bound by certain regulations etc. The document creator defines his intend with the "Usage rights" and may add a usage right signature.
      Then later a document user e.g. a customer fills out form fields and signs those predefined signature fields.
      In that case the coordinates and a lot of attributes are alrady defined and there is no need (and sometimes it is even forbidden) to change the physical attributes of those signature fields. The only two things which are of interest is to set the signature dictionary and to recreate the appearance.

      In the current implementation however one needs to define the coordinates of an existing signature field again. But not enough since the screen coordinates in java (and in the PDFBox PDVisibleSigBuilder) and PDF coordinates have a different origin one must convert those existing PDF coordinates to screen coordinates which are later converted to PDF coordinates again. This is cumbersome, error prone and totally unecessary... With the supplied patch there is no conversion of coordinates anymore.

        Attachments

        1. PDDocument.patch
          0.9 kB
          Lonzak
        2. CreateVisibleSignature.patch
          2 kB
          Lonzak

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                TeeWeTee Lonzak
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: