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
Modifier and TypeClassDescriptionstatic class
Representation of the configuration of where in a PDF signature page PDF signature images should be inserted.static class
Builder forPdfSignPagePreferences
objects. -
Field Summary
Modifier and TypeFieldDescriptionprotected String
A unique reference of the signature template image that is inserted into this PDF signature page. -
Constructor Summary
ConstructorDescriptionPdfSignaturePage
(String id, FileResource pdfDocument, Integer rows, Integer columns, String signatureImageReference, PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration, Extension extension) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
If it should be possible to add PDF sign images in several columns to this sign page document thecolumns
attribute should 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()
The unique ID for this PDF signature page.Configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.int
Tells how many PDF signature images that may be displayed in the PDF signature page.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 therows
attribute should assigned to the desired number of rows.A unique reference of the signature template image that is inserted into this PDF signature page.void
setColumns
(Integer columns) If it should be possible to add PDF sign images in several columns to this sign page document thecolumns
attribute should assigned to the desired number of columns.void
setExtension
(Extension extension) Assigns the extension parameters for the instance.void
The unique ID for this PDF signature page.void
setImagePlacementConfiguration
(PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration) Configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.void
setPdfDocument
(FileResource pdfDocument) The file resource containing the PDF document that holds the PDF signature page.void
If it should be possible to add PDF sign images in several rows to this sign page document therows
attribute should assigned to the desired number of rows.void
setSignatureImageReference
(String signatureImageReference) A unique reference of the signature template image that is inserted into this PDF signature page.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
-
Field Details
-
signatureImageReference
A unique reference of the signature template image that is inserted into this PDF signature page. SeePdfSignatureImageTemplate
.
-
-
Constructor Details
-
PdfSignaturePage
public PdfSignaturePage() -
PdfSignaturePage
public PdfSignaturePage(String id, FileResource pdfDocument, Integer rows, Integer columns, String signatureImageReference, PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration, Extension extension)
-
-
Method Details
-
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:
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
-
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
-
builder
-
toString
-
getId
The unique ID for this PDF signature page. -
setId
The unique ID for this PDF signature page. -
setPdfDocument
The file resource containing the PDF document that holds the PDF signature page. -
getPdfDocument
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 therows
attribute should assigned to the desired number of rows. The default is1
. -
setRows
If it should be possible to add PDF sign images in several rows to this sign page document therows
attribute should assigned to the desired number of rows. The default is1
. -
getColumns
If it should be possible to add PDF sign images in several columns to this sign page document thecolumns
attribute should assigned to the desired number of columns. The default is1
. -
setColumns
If it should be possible to add PDF sign images in several columns to this sign page document thecolumns
attribute should assigned to the desired number of columns. The default is1
. -
getSignatureImageReference
A unique reference of the signature template image that is inserted into this PDF signature page. SeePdfSignatureImageTemplate
. -
setSignatureImageReference
A unique reference of the signature template image that is inserted into this PDF signature page. SeePdfSignatureImageTemplate
. -
getImagePlacementConfiguration
Configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted. -
setImagePlacementConfiguration
public void setImagePlacementConfiguration(PdfSignaturePage.PdfSignatureImagePlacementConfiguration imagePlacementConfiguration) Configuration that tells where in the PDF signature page the PDF signature image(s) should be inserted.
-