Class PdfSignatureImageTemplate

java.lang.Object
se.idsec.signservice.integration.document.pdf.PdfSignatureImageTemplate
All Implemented Interfaces:
Serializable, Extensible

public class PdfSignatureImageTemplate extends Object implements Extensible
Representation of a image template that is used for visible PDF signatures.

An image template may have fields in which the SignService Integration Service use to personalize the image. For example the signer name, reason for the signature, date, etc.

Two fields have special meaning with pre-defined field names. They are:

Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
See Also:
  • Field Details

    • SIGNER_NAME_FIELD_NAME

      public static final String SIGNER_NAME_FIELD_NAME
      Constant for the name of the special purpose field "signerName".
      See Also:
    • SIGNING_TIME_FIELD_NAME

      public static final String SIGNING_TIME_FIELD_NAME
      Constant for the name of the special purpose field "signingTime".
      See Also:
  • Constructor Details

    • PdfSignatureImageTemplate

      public PdfSignatureImageTemplate()
    • PdfSignatureImageTemplate

      public PdfSignatureImageTemplate(String reference, FileResource svgImageFile, Integer width, Integer height, boolean includeSignerName, boolean includeSigningTime, Map<String,String> fields, Extension extension)
  • Method Details

    • getReference

      public String getReference()
      Gets the unique reference for this image template.
      Returns:
      the unique reference
    • setReference

      public void setReference(String reference)
      Assigns the unique reference for this image template.
      Parameters:
      reference - the unique reference
    • getImage

      public String getImage()
      Gets the SVG image expressed as an XML string.
      Returns:
      the SVG image expressed as an XML string
    • setImage

      @Deprecated public void setImage(String image)
      Deprecated.
      since 1.1.0. Use setSvgImageFile(FileResource) instead
      Assigns the SVG image.
      Parameters:
      image - the SVG image expressed as an XML string
    • getSvgImageFile

      public FileResource getSvgImageFile()
      Gets the file resource that holds the SVG image file for this template.

      See also getImage() that returns the contents as an XML string directly

      Returns:
      the SVG image file for this template
    • setSvgImageFile

      public void setSvgImageFile(FileResource svgImageFile)
      Assigns the file resource that holds the SVG image file for this template.
      Parameters:
      svgImageFile - the SVG image file for this template
    • getWidth

      public Integer getWidth()
      Gets the width (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).
      Returns:
      the width (in pixels)
    • setWidth

      public void setWidth(Integer width)
      Assigns the width (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).
      Parameters:
      width - the width (in pixels)
    • getHeight

      public Integer getHeight()
      Gets the height (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).
      Returns:
      the height (in pixels)
    • setHeight

      public void setHeight(Integer height)
      Assigns the height (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).
      Parameters:
      height - the height (in pixels)
    • isIncludeSignerName

      public boolean isIncludeSignerName()
      Gets the flag telling whether the signer name will be included in the visible PDF signature.
      Returns:
      tells whether the signer name is included
    • setIncludeSignerName

      public void setIncludeSignerName(boolean includeSignerName)
      Assigns the flag telling whether the signer name will be included in the visible PDF signature. The default is true.
      Parameters:
      includeSignerName - flag telling whether the signer name should be included
    • isIncludeSigningTime

      public boolean isIncludeSigningTime()
      Gets the flag telling whether the signing time will be included in the visible PDF signature.
      Returns:
      tells whether the signing time will be included
    • setIncludeSigningTime

      public void setIncludeSigningTime(boolean includeSigningTime)
      Sets the flag telling whether the signing time will be included in the visible PDF signature.
      Parameters:
      includeSigningTime - flag telling whether the signing time should be included
    • getFields

      public Map<String,String> getFields()
      Gets the map of the field names that are required by the template in the fieldName map in VisiblePdfSignatureRequirement.
      Returns:
      the field names and associated descriptions
    • setFields

      public void setFields(Map<String,String> fields)
      Assigns the map of the field names that are required by the template in the fieldName map in VisiblePdfSignatureRequirement.
      Parameters:
      fields - the field names and associated descriptions
    • getExtension

      public Extension getExtension()
      Returns the extension parameters for the instance.
      Specified by:
      getExtension in interface Extensible
      Returns:
      the extension, or null if no extensions are set
    • setExtension

      public void setExtension(Extension extension)
      Assigns the extension parameters for the instance.
      Specified by:
      setExtension in interface Extensible
      Parameters:
      extension - the extension
    • builder

    • toString

      public String toString()
      Overrides:
      toString in class Object