Class PdfSignatureImageTemplate
java.lang.Object
se.idsec.signservice.integration.document.pdf.PdfSignatureImageTemplate
- All Implemented Interfaces:
Serializable
,Extensible
Representation of an 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:
- signerName - Displays the signer name information in the visible PDF signature. The caller does not
specify the name directly in the request. Instead the user attribute names that will hold these values after user
authentication is given. See
VisiblePdfSignatureUserInformation.setSignerName(se.idsec.signservice.integration.document.pdf.VisiblePdfSignatureUserInformation.SignerName)
. - signingTime - Includes a time stamp telling when the document was signed in the PDF. The caller does not
provide this information. Instead the SignService Integration Service includes this information if the
isIncludeSigningTime()
is set.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder forPdfSignatureImageTemplate
objects. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the Java date format to use for signing time strings.Returns the extension parameters for the instance.Gets the map of the field names that are required by the template in the fieldName map inVisiblePdfSignatureRequirement
.Gets the height (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).getImage()
Gets the SVG image expressed as an XML string.Gets the unique reference for this image template.Gets the file resource that holds the SVG image file for this template.Gets the identifier for the time zone associated with this template.getWidth()
Gets the width (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).boolean
Gets the flag telling whether the signer name will be included in the visible PDF signature.boolean
Gets the flag telling whether the signing time will be included in the visible PDF signature.void
setDateFormat
(String dateFormat) Assigns the date format to use for signing time strings.void
setExtension
(Extension extension) Assigns the extension parameters for the instance.void
Assigns the map of the field names that are required by the template in the fieldName map inVisiblePdfSignatureRequirement
.void
Assigns the height (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).void
Deprecated.since 1.1.0.void
setIncludeSignerName
(boolean includeSignerName) Assigns the flag telling whether the signer name will be included in the visible PDF signature.void
setIncludeSigningTime
(boolean includeSigningTime) Sets the flag telling whether the signing time will be included in the visible PDF signature.void
setReference
(String reference) Assigns the unique reference for this image template.void
setSvgImageFile
(FileResource svgImageFile) Assigns the file resource that holds the SVG image file for this template.void
setTimeZoneId
(String timeZoneId) Assigns the time zone identifier for this template.void
Assigns the width (in pixels) for the pixel image that is generated from the template (and inserted into the PDF visible signature flow).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.idsec.signservice.integration.core.Extensible
addExtensionValue, getExtensionValue
-
Field Details
-
SIGNER_NAME_FIELD_NAME
Constant for the name of the special purpose field "signerName".- See Also:
-
SIGNING_TIME_FIELD_NAME
Constant for the name of the special purpose field "signingTime".- See Also:
-
-
Constructor Details
-
PdfSignatureImageTemplate
public PdfSignatureImageTemplate()
-
-
Method Details
-
getReference
Gets the unique reference for this image template.- Returns:
- the unique reference
-
setReference
Assigns the unique reference for this image template.- Parameters:
reference
- the unique reference
-
getImage
Gets the SVG image expressed as an XML string.- Returns:
- the SVG image expressed as an XML string
-
setImage
Deprecated.since 1.1.0. UsesetSvgImageFile(FileResource)
insteadAssigns the SVG image.- Parameters:
image
- the SVG image expressed as an XML string
-
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
Assigns the file resource that holds the SVG image file for this template.- Parameters:
svgImageFile
- the SVG image file for this template
-
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
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
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
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 istrue
.- 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
Gets the map of the field names that are required by the template in the fieldName map inVisiblePdfSignatureRequirement
.- Returns:
- the field names and associated descriptions
-
setFields
Assigns the map of the field names that are required by the template in the fieldName map inVisiblePdfSignatureRequirement
.- Parameters:
fields
- the field names and associated descriptions
-
getExtension
Returns the extension parameters for the instance.- Specified by:
getExtension
in interfaceExtensible
- Returns:
- the extension, or
null
if no extensions are set
-
setExtension
Assigns the extension parameters for the instance.- Specified by:
setExtension
in interfaceExtensible
- Parameters:
extension
- the extension
-
getTimeZoneId
Gets the identifier for the time zone associated with this template.- Returns:
- the time zone identifier
-
setTimeZoneId
Assigns the time zone identifier for this template. The default isTimeZone.getDefault()
.- Parameters:
timeZoneId
- the time zone identifier- Throws:
IllegalArgumentException
- for invalid input
-
getDateFormat
Gets the Java date format to use for signing time strings. SeeSimpleDateFormat
for valid formats. The default isyyyy-MM-dd HH:mm z
.- Returns:
- date format string, or
null
if not assigned
-
setDateFormat
Assigns the date format to use for signing time strings.- Parameters:
dateFormat
- the date format- Throws:
IllegalArgumentException
- for invalid input
-