Class VisibleSignatureImage

java.lang.Object
se.idsec.signservice.security.sign.pdf.document.VisibleSignatureImage

public class VisibleSignatureImage extends Object
Data object holding the parameters necessary to provide a signature image to a PDF document.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Field Details

    • DEFAULT_DATE_FORMAT

      public static final String DEFAULT_DATE_FORMAT
      Default date format.
      See Also:
    • DEFAULT_TIMEZONE

      public static final TimeZone DEFAULT_TIMEZONE
    • FIRST_PAGE

      public static final int FIRST_PAGE
      Constant representing "first page" (1).
      See Also:
    • LAST_PAGE

      public static final int LAST_PAGE
      Contants representing "last page" (0).
      See Also:
  • Constructor Details

    • VisibleSignatureImage

      public VisibleSignatureImage()
  • Method Details

    • getVisibleSignatureOptions

      public org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions getVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime) throws IOException
      Generates PDFBox signature options that includes the visible signature.

      Invokes getVisibleSignatureOptions(PDDocument, Date, int) with signatureSize set to 0.

      Parameters:
      doc - the PDF document where the visible signature will be added
      signTime - the time when this signature is claimed to be created
      Returns:
      a signature options object with visible signature
      Throws:
      IOException - for errors creating the signature options
    • setDateFormat

      public void setDateFormat(String dateFormat) throws IllegalArgumentException
      Assigns the date format to use.
      Parameters:
      dateFormat - the date format
      Throws:
      IllegalArgumentException - for invalid input
    • setTimeZoneId

      public void setTimeZoneId(String timeZoneId) throws IllegalArgumentException
      Assigns the time zone ID.
      Parameters:
      timeZoneId - the time zone ID, for example "Europe/Stockholm"
      Throws:
      IllegalArgumentException - for invalid input
    • getVisibleSignatureOptions

      public org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions getVisibleSignatureOptions(org.apache.pdfbox.pdmodel.PDDocument doc, Date signTime, int signatureSize) throws IOException
      Generates PDFBox signature options that includes the visible signature.
      Parameters:
      doc - the PDF document where the visible signature will be added
      signTime - the time when this signature is claimed to be created
      signatureSize - the preferred size of the signature data content (0 will use default size)
      Returns:
      a signature options object with visible signature
      Throws:
      IOException - for errors creating the signature options
    • createDateFormatter

      public SimpleDateFormat createDateFormatter()
      Creates a date formatter given the settings of the bean
      Returns:
      a SimpleDateFormat