Class PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder
- All Implemented Interfaces:
ObjectBuilder<PdfSignaturePagePreferences>
- Enclosing class:
- PdfSignaturePagePreferences
PdfSignaturePagePreferences
objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the object.existingSignaturePageNumber
(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.Extensions for the object.failWhenSignPageFull
(boolean failWhenSignPageFull) APdfSignaturePage
has a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()
).insertPageAt
(Integer insertPageAt) Tells where in a PDF document the PDF signature page should be inserted.returnDocumentReference
(Boolean returnDocumentReference) A setting that tells that a document reference (PreparedPdfDocument.getUpdatedPdfDocumentReference()
) should be returned instead of the updated document itself.signaturePage
(PdfSignaturePage signaturePage) As an alternative to specifying asignPageReference
(seePdfSignaturePagePreferences.setSignaturePageReference(String)
) the actual sign page can be provided in the preferences.signaturePageReference
(String signaturePageReference) Reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()
).toString()
visiblePdfSignatureUserInformation
(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) The input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirement
object.
-
Method Details
-
signaturePageReference
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder signaturePageReference(String signaturePageReference) 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
(seePdfSignaturePagePreferences.setSignaturePage(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- Returns:
this
.
-
signaturePage
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder signaturePage(PdfSignaturePage signaturePage) As an alternative to specifying asignPageReference
(seePdfSignaturePagePreferences.setSignaturePageReference(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- Returns:
this
.
-
visiblePdfSignatureUserInformation
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder visiblePdfSignatureUserInformation(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 inPdfSignaturePagePreferences.getSignaturePageReference()
orPdfSignaturePagePreferences.getSignaturePage()
a completeVisiblePdfSignatureRequirement
object can be created.- Parameters:
visiblePdfSignatureUserInformation
- user information input for creating a VisiblePdfSignatureRequirement object- Returns:
this
.
-
failWhenSignPageFull
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder failWhenSignPageFull(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)- Returns:
this
.
-
insertPageAt
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder insertPageAt(Integer insertPageAt) 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- Returns:
this
.
-
existingSignaturePageNumber
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder existingSignaturePageNumber(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. 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
.- Returns:
this
.
-
returnDocumentReference
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder returnDocumentReference(Boolean returnDocumentReference) 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- Returns:
this
.
-
extension
public PdfSignaturePagePreferences.PdfSignaturePagePreferencesBuilder extension(Extension extension) Extensions for the object.- Returns:
this
.
-
build
Description copied from interface:ObjectBuilder
Builds the object.- Specified by:
build
in interfaceObjectBuilder<PdfSignaturePagePreferences>
- Returns:
- the object
-
toString
-