Class PdfSignaturePage

java.lang.Object
se.idsec.signservice.integration.document.pdf.PdfSignaturePage
All Implemented Interfaces:
Serializable, Extensible

public class PdfSignaturePage extends Object implements 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:
  • Field Details

  • Constructor Details

  • 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

      public Extension getExtension()
      Returns the extension parameters for the instance.
      Specified by:
      getExtension in interface Extensible
      Returns:
      the extension, or null if no extensions are set
    • setExtension

      public void setExtension(Extension extension)
      Assigns the extension parameters for the instance.
      Specified by:
      setExtension in interface Extensible
      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 as getRows() timws getColumns().
      Returns:
      the maximum number of PDF signature images this page can contain
    • builder

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public String getId()
      The unique ID for this PDF signature page.
    • setId

      public void setId(String id)
      The unique ID for this PDF signature page.
    • setPdfDocument

      public void setPdfDocument(FileResource pdfDocument)
      The file resource containing the PDF document that holds the PDF signature page.
    • getPdfDocument

      public FileResource getPdfDocument()
      The file resource containing the PDF document that holds the PDF signature page.
    • getRows

      public Integer getRows()
      If it should be possible to add PDF sign images in several rows to this sign page document the rows attribute should assigned to the desired number of rows. The default is 1.
    • setRows

      public void setRows(Integer rows)
      If it should be possible to add PDF sign images in several rows to this sign page document the rows attribute should assigned to the desired number of rows. The default is 1.
    • getColumns

      public Integer getColumns()
      If it should be possible to add PDF sign images in several columns to this sign page document the columns attribute should assigned to the desired number of columns. The default is 1.
    • setColumns

      public void setColumns(Integer columns)
      If it should be possible to add PDF sign images in several columns to this sign page document the columns attribute should assigned to the desired number of columns. The default is 1.
    • getSignatureImageReference

      public String getSignatureImageReference()
      A unique reference of the signature template image that is inserted into this PDF signature page. See PdfSignatureImageTemplate.
      See Also:
    • setSignatureImageReference

      public void setSignatureImageReference(String signatureImageReference)
      A unique reference of the signature template image that is inserted into this PDF signature page. See PdfSignatureImageTemplate.
      See Also:
    • getImagePlacementConfiguration

      public PdfSignaturePage.PdfSignatureImagePlacementConfiguration 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.