org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible

## Interface PDFTemplateBuilder

All Known Implementing Classes:
  PDVisibleSigBuilder

    public interface PDFTemplateBuilder

That class builds visible signature template which will be added in our PDF document.

Author:
  Vakhtang Koroghlishvili

### Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods
`void` `closeTemplate(PDDocument template)` Closes template
`void` `createAcroForm(PDDocument template)` Creates Acro forms in the template.
`void` `createAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField)` Create AcroForm Dictionary.
`void` `createAffineTransform(AffineTransform affineTransform)` In order to create Affine Transform, using parameters.
`void` `createAffineTransform(byte[] params)` Deprecated. use `createAffineTransform(java.awt.geom.AffineTransform)`
`void` `createAppearanceDictionary(PDFormXObject holderForm, PDSignatureField signatureField)` Creates appearance dictionary
`void` `createBackgroundLayerForm(PDResources innerFormResource, PDRectangle formatter)` Creates the background layer form (n0).
`void` `createFormatterRectangle(byte[] params)` Deprecated. use `createFormatterRectangle(int[])`
`void` `createFormatterRectangle(int[] params)` An array of four numbers in the form coordinate system, giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box.
`void` `createHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)` Creates Form
`void` `createHolderFormResources()` Creates resources of form
`void` `createHolderFormStream(PDDocument template)`
`void` `createImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, AffineTransform affineTransform, PDImageXObject img)` Creates Image form
`void` `createImageFormResources()` Create resource of image form
`void` `createImageFormStream(PDDocument template)`
`void` `createInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)`
`void` `createInnerFormResource()` Creates InnerForm
`void` `createInnerFormStream(PDDocument template)`
`void` `createPage(PDVisibleSignDesigner properties)` Creates specified size page.
`void` `createProcSetArray()` Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI.
`void` `createSignature(PDSignatureField pdSignatureField, PDPage page, String signerName)` Creates the signature with the given name and assign it to the signature field parameter and assign the page parameter to the widget.
`void` `createSignatureField(PDAcroForm acroForm)` Creates signature fields.
`void` `createSignatureImage(PDDocument template, BufferedImage image)` Creates signature image.
`void` `createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties)` Creates SignatureRectangle.
`void` `createTemplate(PDPage page)` Creates template using page.
`void` `createVisualSignature(PDDocument template)` just to create visible signature
`void` `createWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources)` adds Widget Dictionary
`PDFTemplateStructure` `getStructure()`
`void` `injectAppearanceStreams(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties)` injects appearance streams
`void` `injectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)` Inject procSetArray
`void` `insertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)`

### Method Detail

#### createAffineTransform

    @Deprecated
    void createAffineTransform(byte[] params)

Deprecated. use `createAffineTransform(java.awt.geom.AffineTransform)`
In order to create Affine Transform, using parameters.

Parameters:
  `params` - parameter values

#### createAffineTransform

    void createAffineTransform(AffineTransform affineTransform)

In order to create Affine Transform, using parameters.

Parameters:
  `affineTransform` - the transformation

#### createPage

    void createPage(PDVisibleSignDesigner properties)

Creates specified size page.

Parameters:
  `properties` - property value

#### createTemplate

    void createTemplate(PDPage page)
                 throws IOException

Creates template using page.

Parameters:
  `page` - the given page
Throws:
  `IOException` - if something went wrong

#### createAcroForm

    void createAcroForm(PDDocument template)

Creates Acro forms in the template.

Parameters:
  `template` - the template document

#### createSignatureField

    void createSignatureField(PDAcroForm acroForm)
                       throws IOException

Creates signature fields.

Parameters:
  `acroForm` - the acroform
Throws:
  `IOException` - if something went wrong

#### createSignature

    void createSignature(PDSignatureField pdSignatureField,
                         PDPage page,
                         String signerName)
                  throws IOException

Creates the signature with the given name and assign it to the signature field parameter and assign the page parameter to the widget.

Parameters:
  `pdSignatureField` - signature filed
  `page` - the given page
  `signerName` - the name of the person or authority signing the document. According to the PDF specification, this value should be used only when it is not possible to extract the name from the signature.
Throws:
  `IOException` - if something went wrong

#### createAcroFormDictionary

    void createAcroFormDictionary(PDAcroForm acroForm,
                                  PDSignatureField signatureField)
                           throws IOException

Create AcroForm Dictionary.

Parameters:
  `acroForm` - the acroform
  `signatureField` - the signature field
Throws:
  `IOException` - if something went wrong

#### createSignatureRectangle

    void createSignatureRectangle(PDSignatureField signatureField,
                                  PDVisibleSignDesigner properties)
                           throws IOException

Creates SignatureRectangle.

Parameters:
  `signatureField` - the signature field
  `properties` - properties
Throws:
  `IOException` - if something went wrong

#### createProcSetArray

    void createProcSetArray()

Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI.

#### createSignatureImage

    void createSignatureImage(PDDocument template,
                              BufferedImage image)
                       throws IOException

Creates signature image.

Parameters:
  `template` - template document
  `image` - signature image
Throws:
  `IOException` - if something went wrong

#### createFormatterRectangle

    @Deprecated
    void createFormatterRectangle(byte[] params)

Deprecated. use `createFormatterRectangle(int[])`
An array of four numbers in the form coordinate system, giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box. These boundaries shall be used to clip the form XObject and to determine its size for caching.

Parameters:
  `params` - parameters

#### createFormatterRectangle

    void createFormatterRectangle(int[] params)

An array of four numbers in the form coordinate system, giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box. These boundaries shall be used to clip the form XObject and to determine its size for caching.

Parameters:
  `params` - parameters

#### createHolderFormStream

    void createHolderFormStream(PDDocument template)

Parameters:
  `template` - template document

#### createHolderFormResources

    void createHolderFormResources()

Creates resources of form

#### createHolderForm

    void createHolderForm(PDResources holderFormResources,
                          PDStream holderFormStream,
                          PDRectangle bbox)

Creates Form

Parameters:
  `holderFormResources` - holder form resources
  `holderFormStream` - holder stream
  `bbox` - bounding box

#### createAppearanceDictionary

    void createAppearanceDictionary(PDFormXObject holderForm,
                                    PDSignatureField signatureField)
                             throws IOException

Creates appearance dictionary

Parameters:
  `holderForm` - holder XObject
  `signatureField` - the signature field
Throws:
  `IOException` - if something went wrong

#### createInnerFormStream

    void createInnerFormStream(PDDocument template)

Parameters:
  `template` - template document

#### createInnerFormResource

    void createInnerFormResource()

Creates InnerForm

#### createInnerForm

    void createInnerForm(PDResources innerFormResources,
                         PDStream innerFormStream,
                         PDRectangle bbox)

Parameters:
  `innerFormResources` - inner form resources
  `innerFormStream` - inner form stream
  `bbox` - bounding box

#### insertInnerFormToHolderResources

    void insertInnerFormToHolderResources(PDFormXObject innerForm,
                                          PDResources holderFormResources)

Parameters:
  `innerForm` - inner form XObject
  `holderFormResources` - holder form resources

#### createImageFormStream

    void createImageFormStream(PDDocument template)

Parameters:
  `template` - template document

#### createImageFormResources

    void createImageFormResources()

Create resource of image form

#### createImageForm

    void createImageForm(PDResources imageFormResources,
                         PDResources innerFormResource,
                         PDStream imageFormStream,
                         PDRectangle bbox,
                         AffineTransform affineTransform,
                         PDImageXObject img)
                  throws IOException

Creates Image form

Parameters:
  `imageFormResources` - image form resources
  `innerFormResource` - inner form resources
  `imageFormStream` - image from stream
  `bbox` - bounding box
  `affineTransform` - transformation
  `img` - ImageXObject
Throws:
  `IOException` - if something went wrong

#### createBackgroundLayerForm

    void createBackgroundLayerForm(PDResources innerFormResource,
                                   PDRectangle formatter)
                            throws IOException

Creates the background layer form (n0).

Parameters:
  `innerFormResource` - inner acroform resources
  `formatter` - rectangle of the formatter
Throws:
  `IOException` - if something went wrong

#### injectProcSetArray

    void injectProcSetArray(PDFormXObject innerForm,
                            PDPage page,
                            PDResources innerFormResources,
                            PDResources imageFormResources,
                            PDResources holderFormResources,
                            COSArray procSet)

Inject procSetArray

Parameters:
  `innerForm` - inner form
  `page` - the given page
  `innerFormResources` - inner form resources
  `imageFormResources` - image form resources
  `holderFormResources` - holder form resources
  `procSet` - procset values

#### injectAppearanceStreams

    void injectAppearanceStreams(PDStream holderFormStream,
                                 PDStream innerFormStream,
                                 PDStream imageFormStream,
                                 COSName imageFormName,
                                 COSName imageName,
                                 COSName innerFormName,
                                 PDVisibleSignDesigner properties)
                          throws IOException

injects appearance streams

Parameters:
  `holderFormStream` - holder form stream
  `innerFormStream` - inner form stream
  `imageFormStream` - image form stream
  `imageFormName` - image form name
  `imageName` - image name
  `innerFormName` - inner form name
  `properties` - property values
Throws:
  `IOException` - if something went wrong

#### createVisualSignature

    void createVisualSignature(PDDocument template)

just to create visible signature

Parameters:
  `template` - template document

#### createWidgetDictionary

    void createWidgetDictionary(PDSignatureField signatureField,
                                PDResources holderFormResources)
                         throws IOException

adds Widget Dictionary

Parameters:
  `signatureField` - the signature field
  `holderFormResources` - holder form resources
Throws:
  `IOException` - if something went wrong

#### getStructure

    PDFTemplateStructure getStructure()

Returns:
  - PDF template Structure

#### closeTemplate

    void closeTemplate(PDDocument template)
                throws IOException

Closes template

Parameters:
  `template` - template document
Throws:
  `IOException` - if something went wrong