Class PdfSignaturePage
java.lang.Object
se.idsec.signservice.integration.document.pdf.PdfSignaturePage
- All Implemented Interfaces:
Serializable,Extensible
Representation of a "PDF signature page".
A signature page may be used when signing PDF documents together with "PDF visible signatures" (see
PdfSignatureImageTemplate). In those cases a customized "signature page" may be added to the PDF document
before it is signed. This page will then hold the PDF signature image, or images if the document is signed multiple
times.
The reason for using a PDF signature page is that we can sign any type of PDF document and still be sure that the PDF signature image ends up in the correct place. If no PDF signature page is used we have to have prior knowledge about the PDF document that is about to be signed so that we know where to place the PDF signature image.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresentation of the configuration of where in a PDF signature page PDF signature images should be inserted.static classBuilder forPdfSignPagePreferencesobjects. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringA unique reference of the signature template image that is inserted into this PDF signature page. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf it should be possible to add PDF sign images in several columns to this sign page document thecolumnsattribute should be assigned to the desired number of columns.byte[]A utility method that can be used to get the raw bytes of the PDF document holding the PDF signature page.Returns the extension parameters for the instance.getId()Gets the unique ID for this PDF signature page.Gets the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.intTells how many PDF signature images that may be displayed in the PDF signature page.Gets the file resource containing the PDF document that holds the PDF signature page.getRows()If it should be possible to add PDF sign images in several rows to this sign page document therowsattribute should be assigned to the desired number of rows.Gets the unique reference of the signature template image that is inserted into this PDF signature page.voidsetColumns(Integer columns) If it should be possible to add PDF sign images in several columns to this sign page document thecolumnsattribute should be assigned to the desired number of columns.voidsetExtension(Extension extension) Assigns the extension parameters for the instance.voidAssigns the unique ID for this PDF signature pagevoidsetImagePlacementConfiguration(PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration) Assigns the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.voidsetPdfDocument(FileResource pdfDocument) Assigns the file resource containing the PDF document that holds the PDF signature page.voidIf it should be possible to add PDF sign images in several rows to this sign page document therowsattribute should be assigned to the desired number of rows.voidsetSignatureImageReference(String signatureImageReference) Assigns the unique reference of the signature template image that is inserted into this PDF signature page.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
-
Field Details
-
signatureImageReference
A unique reference of the signature template image that is inserted into this PDF signature page.
-
-
Constructor Details
-
PdfSignaturePage
public PdfSignaturePage()
-
-
Method Details
-
getId
Gets the unique ID for this PDF signature page.- Returns:
- the unique ID for this PDF signature page
-
setId
Assigns the unique ID for this PDF signature page- Parameters:
id- the unique ID for this PDF signature page
-
getPdfDocument
Gets the file resource containing the PDF document that holds the PDF signature page.- Returns:
- the file resource containing the PDF document that holds the PDF signature page
-
setPdfDocument
Assigns the file resource containing the PDF document that holds the PDF signature page.- Parameters:
pdfDocument- the file resource containing the PDF document that holds the PDF signature page
-
getRows
If it should be possible to add PDF sign images in several rows to this sign page document therowsattribute should be assigned to the desired number of rows. The default is1.- Returns:
- the number of rows
-
setRows
If it should be possible to add PDF sign images in several rows to this sign page document therowsattribute should be assigned to the desired number of rows.- Parameters:
rows- the number of rows
-
getColumns
If it should be possible to add PDF sign images in several columns to this sign page document thecolumnsattribute should be assigned to the desired number of columns. The default is1.- Returns:
- the number of columns
-
setColumns
If it should be possible to add PDF sign images in several columns to this sign page document thecolumnsattribute should be assigned to the desired number of columns.- Parameters:
columns- the number of columns
-
getSignatureImageReference
Gets the unique reference of the signature template image that is inserted into this PDF signature page.- Returns:
- the unique reference of the signature template image
- See Also:
-
setSignatureImageReference
Assigns the unique reference of the signature template image that is inserted into this PDF signature page.- Parameters:
signatureImageReference- the unique reference of the signature template image- See Also:
-
getImagePlacementConfiguration
Gets the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.- Returns:
- the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted
-
setImagePlacementConfiguration
public void setImagePlacementConfiguration(PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration) Assigns the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.- Parameters:
imagePlacementConfiguration- the configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.
-
getContents
public byte[] getContents()A utility method that can be used to get the raw bytes of the PDF document holding the PDF signature page.See also
getPdfDocument().- Returns:
- the bytes of the PDF document, or null if no document is available
-
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
-
getMaxSignatureImages
public int getMaxSignatureImages()Tells how many PDF signature images that may be displayed in the PDF signature page. This is calculated asgetRows()timwsgetColumns().- Returns:
- the maximum number of PDF signature images this page can contain
-