Class PdfSignaturePagePreferences
- All Implemented Interfaces:
Serializable
,Extensible
PdfSignaturePage
. See
ExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
.
Note: If
ExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
is called several times for the same document, i.e., when the document is signed more than once, the values
for signaturePageReference
/signaturePage
and insertPageAt
must be equal to those values used
in the first invocation.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder forPdfSignaturePagePreferences
objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIn the cases where a PDF document already has been signed and a signature page has been inserted, and another signature image is to be added to this page, the caller may use theexistingSignaturePageNumber
property to inform the Sign Service support service about the document page number of the sign page.Returns the extension parameters for the instance.Tells where in a PDF document the PDF signature page should be inserted.Deprecated, for removal: This API element is subject to removal in a future version.Gets the signature page.Gets the reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
).Gets the input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object.boolean
APdfSignaturePage
has a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()
).void
setExistingSignaturePageNumber
(Integer existingSignaturePageNumber) In the cases where a PDF document already has been signed and a signature page has been inserted, and another signature image is to be added to this page, the caller may use theexistingSignaturePageNumber
property to inform the Sign Service support service about the document page number of the sign page.void
setExtension
(Extension extension) Assigns the extension parameters for the instance.void
setFailWhenSignPageFull
(boolean failWhenSignPageFull) APdfSignaturePage
has a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()
).void
setInsertPageAt
(Integer insertPageAt) Tells where in a PDF document the PDF signature page should be inserted.void
setReturnDocumentReference
(Boolean returnDocumentReference) Deprecated, for removal: This API element is subject to removal in a future version.assign thereturnDocumentReference
parameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
method insteadvoid
setSignaturePage
(PdfSignaturePage signaturePage) As an alternative to specifying asignPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences.void
setSignaturePageReference
(String signaturePageReference) Assigns a reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
).void
setVisiblePdfSignatureUserInformation
(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) Assigns the input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object.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
-
Constructor Details
-
PdfSignaturePagePreferences
public PdfSignaturePagePreferences()
-
-
Method Details
-
getSignaturePageReference
Gets the reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
). This signature page must be configured within the current policy. As an alternative to giving the reference an entirePdfSignaturePage
(seesetSignaturePage(PdfSignaturePage)
).- Returns:
- a reference of the PDF signature page to be inserted
-
setSignaturePageReference
Assigns a reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
). This signature page must be configured within the current policy. As an alternative to giving the reference an entirePdfSignaturePage
(seesetSignaturePage(PdfSignaturePage)
).It is an error to specify both
signaturePageReference
andsignaturePage
. If neithersignaturePageReference
orsignaturePage
is given, the default signature page for the policy will be used, and if no signature page has been configured for the policy an error is reported.- Parameters:
signaturePageReference
- the reference of the PDF signature page to be inserted
-
getSignaturePage
Gets the signature page.As an alternative to specifying a
signPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences.- Returns:
- the PDF signature page to add, or
null
-
setSignaturePage
As an alternative to specifying asignPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences. This method adds this page.It is an error to specify both
signaturePageReference
andsignaturePage
. If neithersignaturePageReference
orsignaturePage
is given, the default signature page for the policy will be used, and if no signature page has been configured for the policy an error is reported.- Parameters:
signaturePage
- the PDF signature page to add
-
getVisiblePdfSignatureUserInformation
Gets the input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object.- Returns:
- user information input for creating a VisiblePdfSignatureRequirement object
-
setVisiblePdfSignatureUserInformation
public void setVisiblePdfSignatureUserInformation(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) Assigns the input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object. Using the object's values (signer name and other field values) and combining with information regarding the PDF signature image found ingetSignaturePageReference()
orgetSignaturePage()
a completeVisiblePdfSignatureRequirement
object can be created.- Parameters:
visiblePdfSignatureUserInformation
- user information input for creating a VisiblePdfSignatureRequirement object
-
isFailWhenSignPageFull
public boolean isFailWhenSignPageFull()APdfSignaturePage
has a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()
). This method tells whether we should fail (or ignore) when another image is added that does not fit.- Returns:
- whether processing should fail or not when the PDF signature page does not have room for any more sign images
-
setFailWhenSignPageFull
public void setFailWhenSignPageFull(boolean failWhenSignPageFull) APdfSignaturePage
has a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()
). IfExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
is invoked with a PDF document that contains a number of signature that equals or exceeds the maximum number of allowed signature images (PdfSignaturePage.getMaxSignatureImages()
) for the current PDF signature page thefailWhenSignPageFull
property tells whetherpreparePdfSignaturePage
should fail (PdfSignaturePageFullException
) or whether it should allow proceeding with the signature operation where no PDF signature image is inserted (in that case the resultingPreparedPdfDocument
) will contain a "null"VisiblePdfSignatureRequirement
(seeVisiblePdfSignatureRequirement.createNullVisiblePdfSignatureRequirement()
).- Parameters:
failWhenSignPageFull
- whether processing should fail or not when the PDF signature page does not have room for any more sign images (the default is true)
-
getInsertPageAt
Tells where in a PDF document the PDF signature page should be inserted. A value of 1 represents the first page and a value of 0 (ornull
) represents the last page. The last page is the default.- Returns:
- the page number in a PDF document where the PDF signature page should be inserted
-
setInsertPageAt
Tells where in a PDF document the PDF signature page should be inserted. A value of 1 represents the first page and a value of 0 (ornull
) represents the last page. The last page is the default.Note: If more than one signature image is added to the sign page and
existingSignaturePageNumber
is not set, the value ofinsertPageAt
MUST be the same between all calls. Thus, the value refers to the page number in the original document, before the sign page was added.- Parameters:
insertPageAt
- the page number in a PDF document where the PDF signature page should be inserted
-
getExistingSignaturePageNumber
In the cases where a PDF document already has been signed and a signature page has been inserted, and another signature image is to be added to this page, the caller may use theexistingSignaturePageNumber
property to inform the Sign Service support service about the document page number of the sign page. This page number corresponds to theVisiblePdfSignatureRequirement.getPage()
property from the initial call.- Returns:
- the existing page number
-
setExistingSignaturePageNumber
In the cases where a PDF document already has been signed and a signature page has been inserted, and another signature image is to be added to this page, the caller may use theexistingSignaturePageNumber
property to inform the Sign Service support service about the document page number of the sign page. This page number corresponds to theVisiblePdfSignatureRequirement.getPage()
property from the initial call.If not set, the Sign Service support service will have to calculate the page number based on the
insertPageAt
property andsignaturePageReference
/signaturePage
.- Parameters:
existingSignaturePageNumber
- the existing page number
-
getReturnDocumentReference
Deprecated, for removal: This API element is subject to removal in a future version.assign thereturnDocumentReference
parameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
method insteadDeprecated.- Returns:
- whether document references instead of a completely updated document should be returned
-
setReturnDocumentReference
@Deprecated(forRemoval=true) public void setReturnDocumentReference(Boolean returnDocumentReference) Deprecated, for removal: This API element is subject to removal in a future version.assign thereturnDocumentReference
parameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
method insteadDeprecated.- Parameters:
returnDocumentReference
- whether document references should be returned
-
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
-
returnDocumentReference
parameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)
method instead