Interface PDFTemplateBuilder
-
- All Known Implementing Classes:
PDVisibleSigBuilder
public interface PDFTemplateBuilderThat class builds visible signature template which will be added in our PDF document.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcloseTemplate(PDDocument template)Closes templatevoidcreateAcroForm(PDDocument template)Creates Acro forms in the template.voidcreateAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField)Create AcroForm Dictionary.voidcreateAffineTransform(java.awt.geom.AffineTransform affineTransform)In order to create Affine Transform, using parameters.voidcreateAppearanceDictionary(PDFormXObject holderForm, PDSignatureField signatureField)Creates appearance dictionaryvoidcreateBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox)Creates the background layer form (n0).voidcreateFormatterRectangle(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.voidcreateHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)Creates FormvoidcreateHolderFormResources()Creates resources of formvoidcreateHolderFormStream(PDDocument template)Create a holder for the form stream.voidcreateImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, java.awt.geom.AffineTransform affineTransform, PDImageXObject img)Creates Image formvoidcreateImageFormResources()Create resource of image formvoidcreateImageFormStream(PDDocument template)Create image form stream.voidcreateInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)Creates InnerForm.voidcreateInnerFormResource()Creates InnerFormvoidcreateInnerFormStream(PDDocument template)Create a holder for the inner form stream.voidcreatePage(PDVisibleSignDesigner properties)Creates specified size page.voidcreateProcSetArray()Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI.voidcreateSignature(PDSignatureField pdSignatureField, PDPage page, java.lang.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.voidcreateSignatureField(PDAcroForm acroForm)Creates signature fields.voidcreateSignatureImage(PDDocument template, java.awt.image.BufferedImage image)Creates signature image.voidcreateSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties)Creates SignatureRectangle.voidcreateTemplate(PDPage page)Creates template using page.voidcreateVisualSignature(PDDocument template)just to create visible signaturevoidcreateWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources)adds Widget DictionaryPDFTemplateStructuregetStructure()Returns the PDF template StructurevoidinjectAppearanceStreams(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties)injects appearance streamsvoidinjectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)Inject procSetArrayvoidinsertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)Insert given from as inner form.
-
-
-
Method Detail
-
createAffineTransform
void createAffineTransform(java.awt.geom.AffineTransform affineTransform)
In order to create Affine Transform, using parameters.- Parameters:
affineTransform- the affine transformation to be used
-
createPage
void createPage(PDVisibleSignDesigner properties)
Creates specified size page.- Parameters:
properties- page properties
-
createTemplate
void createTemplate(PDPage page) throws java.io.IOException
Creates template using page.- Parameters:
page- page to be added- Throws:
java.io.IOException- if the template could not be created
-
createAcroForm
void createAcroForm(PDDocument template)
Creates Acro forms in the template.- Parameters:
template- the document the acroform is added to
-
createSignatureField
void createSignatureField(PDAcroForm acroForm) throws java.io.IOException
Creates signature fields.- Parameters:
acroForm- the acroform the signature is added to- Throws:
java.io.IOException- if the signature could not be created
-
createSignature
void createSignature(PDSignatureField pdSignatureField, PDPage page, java.lang.String signerName) throws java.io.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- the signature filed the signatur is added topage- the page the widgt ist added tosignerName- 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:
java.io.IOException- if the signature could not be created
-
createAcroFormDictionary
void createAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField) throws java.io.IOException
Create AcroForm Dictionary.- Parameters:
acroForm- the acroform the signature field is added tosignatureField- the signature filed to be added- Throws:
java.io.IOException- if the signature field could not be added
-
createSignatureRectangle
void createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties) throws java.io.IOException
Creates SignatureRectangle.- Parameters:
signatureField- the signature field the rectangle is added toproperties- the properties used to create the rectangle- Throws:
java.io.IOException- if the rectangle could not be created
-
createProcSetArray
void createProcSetArray()
Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI.
-
createSignatureImage
void createSignatureImage(PDDocument template, java.awt.image.BufferedImage image) throws java.io.IOException
Creates signature image.- Parameters:
template- the document the image is added toimage- to imager to be added- Throws:
java.io.IOException- if the image could not be added
-
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- the parameters of the formatter rectangle
-
createHolderFormStream
void createHolderFormStream(PDDocument template)
Create a holder for the form stream.- Parameters:
template- the document to be used to create the new stream
-
createHolderFormResources
void createHolderFormResources()
Creates resources of form
-
createHolderForm
void createHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)
Creates Form- Parameters:
holderFormResources- resources to be used for the form objectholderFormStream- the stream to be used for the form objectbbox- the bounding box of the form object
-
createAppearanceDictionary
void createAppearanceDictionary(PDFormXObject holderForm, PDSignatureField signatureField) throws java.io.IOException
Creates appearance dictionary- Parameters:
holderForm- form object to be used for the appearance streamsignatureField- the signature field the appearance stream is added to- Throws:
java.io.IOException- if the appearance stream could not be created
-
createInnerFormStream
void createInnerFormStream(PDDocument template)
Create a holder for the inner form stream.- Parameters:
template- the document to be used to create the new stream
-
createInnerFormResource
void createInnerFormResource()
Creates InnerForm
-
createInnerForm
void createInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)
Creates InnerForm.- Parameters:
innerFormResources- resources to be used for the inner form objectinnerFormStream- the stream to be used for the inner form objectbbox- the bounding box of the inner form object
-
insertInnerFormToHolderResources
void insertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)
Insert given from as inner form.- Parameters:
innerForm- the form object to be insertedholderFormResources- resources the form object is added to
-
createImageFormStream
void createImageFormStream(PDDocument template)
Create image form stream.- Parameters:
template- the document to be used to create the new stream
-
createImageFormResources
void createImageFormResources()
Create resource of image form
-
createImageForm
void createImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, java.awt.geom.AffineTransform affineTransform, PDImageXObject img) throws java.io.IOException
Creates Image form- Parameters:
imageFormResources- the resources of the form objectinnerFormResource- the resources the image object is addedimageFormStream- the stream of the form objectbbox- the bounding box of the form objectaffineTransform- the matrix of the form objectimg- the image object to be used for the form object- Throws:
java.io.IOException- if the form object could not be created
-
createBackgroundLayerForm
void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws java.io.IOException
Creates the background layer form (n0).- Parameters:
innerFormResource- resources to be used for the form objectbbox- the bounding box of the form object- Throws:
java.io.IOException- if the form object could not be created
-
injectProcSetArray
void injectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)
Inject procSetArray- Parameters:
innerForm- form object the given proc set array is added topage- page the given proc set array is added toinnerFormResources- inner form resources the given proc set array is added toimageFormResources- inner image resources the given proc set array is added toholderFormResources- holder form resources the given proc set array is added toprocSet- the pro set array to be added
-
injectAppearanceStreams
void injectAppearanceStreams(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties) throws java.io.IOException
injects appearance streams- Parameters:
holderFormStream- the holder form streaminnerFormStream- the inner form streamimageFormStream- the image form streamimageFormName- the name of the form image to be usedimageName- the name of the image to be usedinnerFormName- the name of the form object to be usedproperties- properties to be used to create the appearance stream- Throws:
java.io.IOException- if the appearance stream could not be created
-
createVisualSignature
void createVisualSignature(PDDocument template)
just to create visible signature- Parameters:
template- the document holding the visible signature
-
createWidgetDictionary
void createWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources) throws java.io.IOException
adds Widget Dictionary- Parameters:
signatureField- the field to be used as widget dictionaryholderFormResources- the resources to be added to the widget dictionary- Throws:
java.io.IOException- if the widget dictionary could not be created
-
getStructure
PDFTemplateStructure getStructure()
Returns the PDF template Structure- Returns:
- PDF template Structure
-
closeTemplate
void closeTemplate(PDDocument template) throws java.io.IOException
Closes template- Parameters:
template- the document to be closed- Throws:
java.io.IOException- if the document could not be closed
-
-