Top Description Methods
org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible

public Interface PDFTemplateBuilder

Known Direct Implementers
org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDVisibleSigBuilder
Imports
java.awt.geom.AffineTransform, java.awt.image.BufferedImage, java.io.IOException, org.apache.pdfbox.cos.COSArray, .COSName, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDResources, org.apache.pdfbox.pdmodel.common.PDRectangle, .PDStream, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, .PDSignatureField

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

Method Summary

Modifier and TypeMethod and Description
public void
closeTemplate(PDDocument
the document to be closed
template
)

Closes template

public void
createAcroForm(PDDocument
the document the acroform is added to
template
)

Creates Acro forms in the template.

public void
createAcroFormDictionary(PDAcroForm
the acroform the signature field is added to
acroForm
,
PDSignatureField
the signature filed to be added
signatureField
)

Create AcroForm Dictionary.

public void
createAffineTransform(AffineTransform
the affine transformation to be used
affineTransform
)

In order to create Affine Transform, using parameters.

public void
createAppearanceDictionary(PDFormXObject
form object to be used for the appearance stream
holderForml
,
PDSignatureField
the signature field the appearance stream is added to
signatureField
)

Creates appearance dictionary

public void
createBackgroundLayerForm(PDResources
resources to be used for the form object
innerFormResource
,
PDRectangle
the bounding box of the form object
bbox
)

Creates the background layer form (n0).

public void
createFormatterRectangle(int[]
the parameters of the formatter rectangle
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.

public void
createHolderForm(PDResources
resources to be used for the form object
holderFormResources
,
PDStream
the stream to be used for the form object
holderFormStream
,
PDRectangle
the bounding box of the form object
bbox
)

Creates Form

public void
createHolderFormResources()

Creates resources of form

public void
createHolderFormStream(PDDocument
the document to be used to create the new stream
template
)

Create a holder for the form stream.

public void
createImageForm(PDResources
the resources of the form object
imageFormResources
,
PDResources
the resources the image object is added
innerFormResource
,
PDStream
the stream of the form object
imageFormStream
,
PDRectangle
the bounding box of the form object
bbox
,
AffineTransform
the matrix of the form object
affineTransform
,
PDImageXObject
the image object to be used for the form object
img
)

Creates Image form

public void
createImageFormResources()

Create resource of image form

public void
createImageFormStream(PDDocument
the document to be used to create the new stream
template
)

Create image form stream.

public void
createInnerForm(PDResources
resources to be used for the inner form object
innerFormResources
,
PDStream
the stream to be used for the inner form object
innerFormStream
,
PDRectangle
the bounding box of the inner form object
bbox
)

Creates InnerForm.

public void
createInnerFormResource()

Creates InnerForm

public void
createInnerFormStream(PDDocument
the document to be used to create the new stream
template
)

Create a holder for the inner form stream.

public void
createPage(PDVisibleSignDesigner
page properties
properties
)

Creates specified size page.

public void
createProcSetArray()

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

public void
createSignature(PDSignatureField
the signature filed the signatur is added to
pdSignatureField
,
PDPage
the page the widgt ist added to
page
,
String
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.
signerName
)

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

public void
createSignatureField(PDAcroForm
the acroform the signature is added to
acroForm
)

Creates signature fields.

public void
createSignatureImage(PDDocument
the document the image is added to
template
,
BufferedImage
to imager to be added
image
)

Creates signature image.

public void
createSignatureRectangle(PDSignatureField
the signature field the rectangle is added to
signatureField
,
PDVisibleSignDesigner
the properties used to create the rectangle
properties
)

Creates SignatureRectangle.

public void
createTemplate(PDPage
page to be added
page
)

Creates template using page.

public void
createVisualSignature(PDDocument
the document holding the visible signatue
template
)

just to create visible signature

public void
createWidgetDictionary(PDSignatureField
the field to be used as widget dictionary
signatureField
,
PDResources
the resources to be added to the widget dictionary
holderFormResources
)

adds Widget Dictionary

public PDFTemplateStructure

Returns:

PDF template Structure
getStructure
()

Resturns the PDF template Structure

public void
injectAppearanceStreams(PDStream
the holder form stream
holderFormStream
,
PDStream
the inner form stream
innerFormStream
,
PDStream
the image form stream
imageFormStream
,
COSName
the name of the form image to be used
imageFormName
,
COSName
the name of the image to be used
imageName
,
COSName
the name of the form object to be used
innerFormName
,
PDVisibleSignDesigner
properties to be used to create the appearance stream
properties
)

injects appearance streams

public void
injectProcSetArray(PDFormXObject
form object the given proc set array is added to
innerForm
,
PDPage
page the given proc set array is added to
page
,
PDResources
inner form resources the given proc set array is added to
innerFormResources
,
PDResources
inner image resources the given proc set array is added to
imageFormResources
,
PDResources
holder form resources the given proc set array is added to
holderFormResources
,
COSArray
the pro set array to be added
procSet
)

Inject procSetArray

public void
insertInnerFormToHolderResources(PDFormXObject
the form object to be inserted
innerForm
,
PDResources
resources the fomr object is added to
holderFormResources
)

Insert given from as inner form.

Method Detail

closeTemplateback to summary
public void closeTemplate(PDDocument template) throws IOException

Closes template

Parameters
template:PDDocument

the document to be closed

Exceptions
IOException:
if the document could not be closed
createAcroFormback to summary
public void createAcroForm(PDDocument template)

Creates Acro forms in the template.

Parameters
template:PDDocument

the document the acroform is added to

createAcroFormDictionaryback to summary
public void createAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField) throws IOException

Create AcroForm Dictionary.

Parameters
acroForm:PDAcroForm

the acroform the signature field is added to

signatureField:PDSignatureField

the signature filed to be added

Exceptions
IOException:
if the signature field could not be added
createAffineTransformback to summary
public void createAffineTransform(AffineTransform affineTransform)

In order to create Affine Transform, using parameters.

Parameters
affineTransform:AffineTransform

the affine transformation to be used

createAppearanceDictionaryback to summary
public void createAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField) throws IOException

Creates appearance dictionary

Parameters
holderForml:PDFormXObject

form object to be used for the appearance stream

signatureField:PDSignatureField

the signature field the appearance stream is added to

Exceptions
IOException:
if the appearance stream could not be created
createBackgroundLayerFormback to summary
public void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws IOException

Creates the background layer form (n0).

Parameters
innerFormResource:PDResources

resources to be used for the form object

bbox:PDRectangle

the bounding box of the form object

Exceptions
IOException:
if the form object could not be created
createFormatterRectangleback to summary
public 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:int[]

the parameters of the formatter rectangle

createHolderFormback to summary
public void createHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)

Creates Form

Parameters
holderFormResources:PDResources

resources to be used for the form object

holderFormStream:PDStream

the stream to be used for the form object

bbox:PDRectangle

the bounding box of the form object

createHolderFormResourcesback to summary
public void createHolderFormResources()

Creates resources of form

createHolderFormStreamback to summary
public void createHolderFormStream(PDDocument template)

Create a holder for the form stream.

Parameters
template:PDDocument

the document to be used to create the new stream

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

Creates Image form

Parameters
imageFormResources:PDResources

the resources of the form object

innerFormResource:PDResources

the resources the image object is added

imageFormStream:PDStream

the stream of the form object

bbox:PDRectangle

the bounding box of the form object

affineTransform:AffineTransform

the matrix of the form object

img:PDImageXObject

the image object to be used for the form object

Exceptions
IOException:
if the form object could not be created
createImageFormResourcesback to summary
public void createImageFormResources()

Create resource of image form

createImageFormStreamback to summary
public void createImageFormStream(PDDocument template)

Create image form stream.

Parameters
template:PDDocument

the document to be used to create the new stream

createInnerFormback to summary
public void createInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)

Creates InnerForm.

Parameters
innerFormResources:PDResources

resources to be used for the inner form object

innerFormStream:PDStream

the stream to be used for the inner form object

bbox:PDRectangle

the bounding box of the inner form object

createInnerFormResourceback to summary
public void createInnerFormResource()

Creates InnerForm

createInnerFormStreamback to summary
public void createInnerFormStream(PDDocument template)

Create a holder for the inner form stream.

Parameters
template:PDDocument

the document to be used to create the new stream

createPageback to summary
public void createPage(PDVisibleSignDesigner properties)

Creates specified size page.

Parameters
properties:PDVisibleSignDesigner

page properties

createProcSetArrayback to summary
public void createProcSetArray()

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

createSignatureback to summary
public 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:PDSignatureField

the signature filed the signatur is added to

page:PDPage

the page the widgt ist added to

signerName:String

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.

Exceptions
IOException:
if the signature could not be created
createSignatureFieldback to summary
public void createSignatureField(PDAcroForm acroForm) throws IOException

Creates signature fields.

Parameters
acroForm:PDAcroForm

the acroform the signature is added to

Exceptions
IOException:
if the signature could not be created
createSignatureImageback to summary
public void createSignatureImage(PDDocument template, BufferedImage image) throws IOException

Creates signature image.

Parameters
template:PDDocument

the document the image is added to

image:BufferedImage

to imager to be added

Exceptions
IOException:
if the image could not be added
createSignatureRectangleback to summary
public void createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties) throws IOException

Creates SignatureRectangle.

Parameters
signatureField:PDSignatureField

the signature field the rectangle is added to

properties:PDVisibleSignDesigner

the properties used to create the rectangle

Exceptions
IOException:
if the rectangle could not be created
createTemplateback to summary
public void createTemplate(PDPage page) throws IOException

Creates template using page.

Parameters
page:PDPage

page to be added

Exceptions
IOException:
if the template could not be created
createVisualSignatureback to summary
public void createVisualSignature(PDDocument template)

just to create visible signature

Parameters
template:PDDocument

the document holding the visible signatue

createWidgetDictionaryback to summary
public void createWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources) throws IOException

adds Widget Dictionary

Parameters
signatureField:PDSignatureField

the field to be used as widget dictionary

holderFormResources:PDResources

the resources to be added to the widget dictionary

Exceptions
IOException:
if the widget dictionary could not be created
getStructureback to summary
public PDFTemplateStructure getStructure()

Resturns the PDF template Structure

Returns:PDFTemplateStructure

PDF template Structure

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

injects appearance streams

Parameters
holderFormStream:PDStream

the holder form stream

innerFormStream:PDStream

the inner form stream

imageFormStream:PDStream

the image form stream

imageFormName:COSName

the name of the form image to be used

imageName:COSName

the name of the image to be used

innerFormName:COSName

the name of the form object to be used

properties:PDVisibleSignDesigner

properties to be used to create the appearance stream

Exceptions
IOException:
if the appearance stream could not be created
injectProcSetArrayback to summary
public void injectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)

Inject procSetArray

Parameters
innerForm:PDFormXObject

form object the given proc set array is added to

page:PDPage

page the given proc set array is added to

innerFormResources:PDResources

inner form resources the given proc set array is added to

imageFormResources:PDResources

inner image resources the given proc set array is added to

holderFormResources:PDResources

holder form resources the given proc set array is added to

procSet:COSArray

the pro set array to be added

insertInnerFormToHolderResourcesback to summary
public void insertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)

Insert given from as inner form.

Parameters
innerForm:PDFormXObject

the form object to be inserted

holderFormResources:PDResources

resources the fomr object is added to