Class PdfSignaturePagePreferences
- All Implemented Interfaces:
Serializable
,Extensible
PdfSignaturePage
. See
ExtendedSignServiceIntegrationService.preparePdfSignaturePage(String, byte[], PdfSignaturePagePreferences)
.
Note: If
ExtendedSignServiceIntegrationService.preparePdfSignaturePage(String, byte[], PdfSignaturePagePreferences)
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
Modifier and TypeClassDescriptionstatic class
Builder forPdfSignaturePagePreferences
objects. -
Constructor Summary
ConstructorDescriptionPdfSignaturePagePreferences
(String signaturePageReference, PdfSignaturePage signaturePage, VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation, boolean failWhenSignPageFull, Integer insertPageAt, Integer existingSignaturePageNumber, Boolean returnDocumentReference, Extension extension) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
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.Returns the extension parameters for the instance.Tells where in a PDF document the PDF signature page should be inserted.A setting that tells that a document reference (PreparedPdfDocument.getUpdatedPdfDocumentReference()
) should be returned instead of the updated document itself.As an alternative to specifying asignPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences.Reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
).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) A setting that tells that a document reference (PreparedPdfDocument.getUpdatedPdfDocumentReference()
) should be returned instead of the updated document itself.void
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) Reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
).void
setVisiblePdfSignatureUserInformation
(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) The input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface se.idsec.signservice.integration.core.Extensible
addExtensionValue, getExtensionValue
-
Constructor Details
-
PdfSignaturePagePreferences
public PdfSignaturePagePreferences() -
PdfSignaturePagePreferences
public PdfSignaturePagePreferences(String signaturePageReference, PdfSignaturePage signaturePage, VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation, boolean failWhenSignPageFull, Integer insertPageAt, Integer existingSignaturePageNumber, Boolean returnDocumentReference, Extension extension)
-
-
Method Details
-
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
-
builder
-
toBuilder
-
toString
-
getSignaturePageReference
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.- Returns:
- a reference of the PDF signature page to be inserted
-
setSignaturePageReference
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
As an alternative to specifying asignPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences.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.- Returns:
- the PDF signature page to add
-
setSignaturePage
As an alternative to specifying asignPageReference
(seesetSignaturePageReference(String)
) the actual sign page can be provided in the preferences.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
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.- Returns:
- user information input for creating a VisiblePdfSignatureRequirement object
-
setVisiblePdfSignatureUserInformation
public void setVisiblePdfSignatureUserInformation(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) 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()
). IfExtendedSignServiceIntegrationService.preparePdfSignaturePage(String, byte[], PdfSignaturePagePreferences)
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()
).- 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.preparePdfSignaturePage(String, byte[], PdfSignaturePagePreferences)
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.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.- 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.If not set, the Sign Service support service will have to calculate the page number based on the
insertPageAt
property andsignaturePageReference
/signaturePage
. -
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
. -
getReturnDocumentReference
A setting that tells that a document reference (PreparedPdfDocument.getUpdatedPdfDocumentReference()
) should be returned instead of the updated document itself. Later when the document is passed in a call toSignServiceIntegrationService.createSignRequest(se.idsec.signservice.integration.SignRequestInput)
theTbsDocument.setContentReference(String)
is used instead of adding the entire document. This way a potentially large document only has to be "uploaded" once.A document reference is only returned in the cases when the current SignService Integration policy profile is running in "stateful" mode. It is an error to request a document reference if the policy is stateless.
The default behaviour is that
returnDocumentReference
istrue
if the current policy is stateful andfalse
if it is stateless.- Returns:
- whether document references instead of a completely updated document should be returned
-
setReturnDocumentReference
A setting that tells that a document reference (PreparedPdfDocument.getUpdatedPdfDocumentReference()
) should be returned instead of the updated document itself. Later when the document is passed in a call toSignServiceIntegrationService.createSignRequest(se.idsec.signservice.integration.SignRequestInput)
theTbsDocument.setContentReference(String)
is used instead of adding the entire document. This way a potentially large document only has to be "uploaded" once.A document reference is only returned in the cases when the current SignService Integration policy profile is running in "stateful" mode. It is an error to request a document reference if the policy is stateless.
The default behaviour is that
returnDocumentReference
istrue
if the current policy is stateful andfalse
if it is stateless.- Parameters:
returnDocumentReference
- whether document references should be returned
-