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
Modifier and TypeMethodDescriptionvoid
closeTemplate
(PDDocument template) Closes templatevoid
createAcroForm
(PDDocument template) Creates Acro forms in the template.void
createAcroFormDictionary
(PDAcroForm acroForm, PDSignatureField signatureField) Create AcroForm Dictionary.void
createAffineTransform
(byte[] params) Deprecated.void
createAffineTransform
(AffineTransform affineTransform) In order to create Affine Transform, using parameters.void
createAppearanceDictionary
(PDFormXObject holderForml, PDSignatureField signatureField) Creates appearance dictionaryvoid
createBackgroundLayerForm
(PDResources innerFormResource, PDRectangle formatter) Creates the background layer form (n0).void
createFormatterRectangle
(byte[] params) Deprecated.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 Formvoid
Creates resources of formvoid
createHolderFormStream
(PDDocument template) void
createImageForm
(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, AffineTransform affineTransform, PDImageXObject img) Creates Image formvoid
Create resource of image formvoid
createImageFormStream
(PDDocument template) void
createInnerForm
(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox) void
Creates InnerFormvoid
createInnerFormStream
(PDDocument template) void
createPage
(PDVisibleSignDesigner properties) Creates specified size page.void
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 signaturevoid
createWidgetDictionary
(PDSignatureField signatureField, PDResources holderFormResources) adds Widget Dictionaryvoid
injectAppearanceStreams
(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties) injects appearance streamsvoid
injectProcSetArray
(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet) Inject procSetArrayvoid
insertInnerFormToHolderResources
(PDFormXObject innerForm, PDResources holderFormResources)
-
Method Details
-
createAffineTransform
Deprecated.In order to create Affine Transform, using parameters.- Parameters:
params
- parameter values
-
createAffineTransform
In order to create Affine Transform, using parameters.- Parameters:
affineTransform
- the transformation
-
createPage
Creates specified size page.- Parameters:
properties
- property value
-
createTemplate
Creates template using page.- Parameters:
page
- the given page- Throws:
IOException
- if something went wrong
-
createAcroForm
Creates Acro forms in the template.- Parameters:
template
- the template document
-
createSignatureField
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 filedpage
- the given pagesignerName
- 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 acroformsignatureField
- the signature field- Throws:
IOException
- if something went wrong
-
createSignatureRectangle
void createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties) throws IOException Creates SignatureRectangle.- Parameters:
signatureField
- the signature fieldproperties
- properties- Throws:
IOException
- if something went wrong
-
createProcSetArray
void createProcSetArray()Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI. -
createSignatureImage
Creates signature image.- Parameters:
template
- template documentimage
- signature image- Throws:
IOException
- if something went wrong
-
createFormatterRectangle
Deprecated.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
- Parameters:
template
- template document
-
createHolderFormResources
void createHolderFormResources()Creates resources of form -
createHolderForm
Creates Form- Parameters:
holderFormResources
- holder form resourcesholderFormStream
- holder streambbox
- bounding box
-
createAppearanceDictionary
void createAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField) throws IOException Creates appearance dictionary- Parameters:
holderForml
- holder XObjectsignatureField
- the signature field- Throws:
IOException
- if something went wrong
-
createInnerFormStream
- Parameters:
template
- template document
-
createInnerFormResource
void createInnerFormResource()Creates InnerForm -
createInnerForm
- Parameters:
innerFormResources
- inner form resourcesinnerFormStream
- inner form streambbox
- bounding box
-
insertInnerFormToHolderResources
- Parameters:
innerForm
- inner form XObjectholderFormResources
- holder form resources
-
createImageFormStream
- 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 resourcesinnerFormResource
- inner form resourcesimageFormStream
- image from streambbox
- bounding boxaffineTransform
- transformationimg
- 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 resourcesformatter
- 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 formpage
- the given pageinnerFormResources
- inner form resourcesimageFormResources
- image form resourcesholderFormResources
- holder form resourcesprocSet
- 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 streaminnerFormStream
- inner form streamimageFormStream
- image form streamimageFormName
- image form nameimageName
- image nameinnerFormName
- inner form nameproperties
- property values- Throws:
IOException
- if something went wrong
-
createVisualSignature
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 fieldholderFormResources
- holder form resources- Throws:
IOException
- if something went wrong
-
getStructure
PDFTemplateStructure getStructure()- Returns:
- - PDF template Structure
-
closeTemplate
Closes template- Parameters:
template
- template document- Throws:
IOException
- if something went wrong
-
createAffineTransform(java.awt.geom.AffineTransform)