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 classBuilder forPdfSignaturePagePreferencesobjects. - 
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 theexistingSignaturePageNumberproperty 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 aVisiblePdfSignatureRequirementobject.booleanAPdfSignaturePagehas a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()).voidsetExistingSignaturePageNumber(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 theexistingSignaturePageNumberproperty to inform the Sign Service support service about the document page number of the sign page.voidsetExtension(Extension extension) Assigns the extension parameters for the instance.voidsetFailWhenSignPageFull(boolean failWhenSignPageFull) APdfSignaturePagehas a limit on how many PDF signature images it can hold (seePdfSignaturePage.getMaxSignatureImages()).voidsetInsertPageAt(Integer insertPageAt) Tells where in a PDF document the PDF signature page should be inserted.voidsetReturnDocumentReference(Boolean returnDocumentReference) Deprecated, for removal: This API element is subject to removal in a future version.assign thereturnDocumentReferenceparameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)method insteadvoidsetSignaturePage(PdfSignaturePage signaturePage) As an alternative to specifying asignPageReference(seesetSignaturePageReference(String)) the actual sign page can be provided in the preferences.voidsetSignaturePageReference(String signaturePageReference) Assigns a reference to a PDF signature page to be inserted (seePdfSignaturePage.getId()).voidsetVisiblePdfSignatureUserInformation(VisiblePdfSignatureUserInformation visiblePdfSignatureUserInformation) Assigns the input regarding the user information that is to be used when generating aVisiblePdfSignatureRequirementobject.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
signaturePageReferenceandsignaturePage. If neithersignaturePageReferenceorsignaturePageis 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
signaturePageReferenceandsignaturePage. If neithersignaturePageReferenceorsignaturePageis 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 aVisiblePdfSignatureRequirementobject.- 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 aVisiblePdfSignatureRequirementobject. Using the object's values (signer name and other field values) and combining with information regarding the PDF signature image found ingetSignaturePageReference()orgetSignaturePage()a completeVisiblePdfSignatureRequirementobject can be created.- Parameters:
 visiblePdfSignatureUserInformation- user information input for creating a VisiblePdfSignatureRequirement object
 - 
isFailWhenSignPageFull
public boolean isFailWhenSignPageFull()APdfSignaturePagehas 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) APdfSignaturePagehas 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 thefailWhenSignPageFullproperty tells whetherpreparePdfSignaturePageshould 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
existingSignaturePageNumberis not set, the value ofinsertPageAtMUST 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 theexistingSignaturePageNumberproperty 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 theexistingSignaturePageNumberproperty 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
insertPageAtproperty andsignaturePageReference/signaturePage.- Parameters:
 existingSignaturePageNumber- the existing page number
 - 
getReturnDocumentReference
Deprecated, for removal: This API element is subject to removal in a future version.assign thereturnDocumentReferenceparameter 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 thereturnDocumentReferenceparameter 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:
 getExtensionin interfaceExtensible- Returns:
 - the extension, or 
nullif no extensions are set 
 - 
setExtension
Assigns the extension parameters for the instance.- Specified by:
 setExtensionin interfaceExtensible- Parameters:
 extension- the extension
 
 - 
 
returnDocumentReferenceparameter of theExtendedSignServiceIntegrationService.preparePdfDocument(String, byte[], PdfSignaturePagePreferences, Boolean, String)method instead