Class PDVisibleSigBuilder
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.digitalsignature.visible.PDVisibleSigBuilder
-
- All Implemented Interfaces:
PDFTemplateBuilder
public class PDVisibleSigBuilder extends Object implements PDFTemplateBuilder
Implementation ofPDFTemplateBuilder. This builds the signature PDF but doesn't keep the elements, these are kept in its PDF template structure.
-
-
Constructor Summary
Constructors Constructor Description PDVisibleSigBuilder()Constructor, creates PDF template structure.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidappendRawCommands(OutputStream os, String commands)voidcloseTemplate(PDDocument template)Closes templatevoidcreateAcroForm(PDDocument template)Creates Acro forms in the template.voidcreateAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField)Create AcroForm Dictionary.voidcreateAffineTransform(byte[] params)voidcreateAffineTransform(AffineTransform affineTransform)In order to create Affine Transform, using parameters.voidcreateAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField)Creates appearance dictionaryvoidcreateBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox)Creates the background layer form (n0).voidcreateFormatterRectangle(byte[] params)Deprecated.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)voidcreateImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, AffineTransform at, PDImageXObject img)Creates Image formvoidcreateImageFormResources()Create resource of image formvoidcreateImageFormStream(PDDocument template)voidcreateInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)voidcreateInnerFormResource()Creates InnerFormvoidcreateInnerFormStream(PDDocument template)voidcreatePage(PDVisibleSignDesigner properties)Creates specified size page.voidcreateProcSetArray()Creates procSetArray of PDF,Text,ImageB,ImageC,ImageI.voidcreateSignature(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.voidcreateSignatureField(PDAcroForm acroForm)Creates signature fields.voidcreateSignatureImage(PDDocument template, Bitmap image)Creates signature image.voidcreateSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties)Creates SignatureRectangle.voidcreateTemplate(PDPage page)Creates a PDDocument and adds the page parameter to it and keeps this as a template in the PDF template Structure.voidcreateVisualSignature(PDDocument template)just to create visible signaturevoidcreateWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources)adds Widget DictionaryPDFTemplateStructuregetStructure()voidinjectAppearanceStreams(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)
-
-
-
Method Detail
-
createPage
public void createPage(PDVisibleSignDesigner properties)
Description copied from interface:PDFTemplateBuilderCreates specified size page.- Specified by:
createPagein interfacePDFTemplateBuilder- Parameters:
properties- property value
-
createTemplate
public void createTemplate(PDPage page) throws IOException
Creates a PDDocument and adds the page parameter to it and keeps this as a template in the PDF template Structure.- Specified by:
createTemplatein interfacePDFTemplateBuilder- Parameters:
page-- Throws:
IOException
-
createAcroForm
public void createAcroForm(PDDocument template)
Description copied from interface:PDFTemplateBuilderCreates Acro forms in the template.- Specified by:
createAcroFormin interfacePDFTemplateBuilder- Parameters:
template- the template document
-
getStructure
public PDFTemplateStructure getStructure()
- Specified by:
getStructurein interfacePDFTemplateBuilder- Returns:
- - PDF template Structure
-
createSignatureField
public void createSignatureField(PDAcroForm acroForm) throws IOException
Description copied from interface:PDFTemplateBuilderCreates signature fields.- Specified by:
createSignatureFieldin interfacePDFTemplateBuilder- Parameters:
acroForm- the acroform- Throws:
IOException- if something went wrong
-
createSignature
public void createSignature(PDSignatureField pdSignatureField, PDPage page, String signerName) throws IOException
Description copied from interface:PDFTemplateBuilderCreates the signature with the given name and assign it to the signature field parameter and assign the page parameter to the widget.- Specified by:
createSignaturein interfacePDFTemplateBuilder- 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
public void createAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField) throws IOException
Description copied from interface:PDFTemplateBuilderCreate AcroForm Dictionary.- Specified by:
createAcroFormDictionaryin interfacePDFTemplateBuilder- Parameters:
acroForm- the acroformsignatureField- the signature field- Throws:
IOException- if something went wrong
-
createSignatureRectangle
public void createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties) throws IOException
Description copied from interface:PDFTemplateBuilderCreates SignatureRectangle.- Specified by:
createSignatureRectanglein interfacePDFTemplateBuilder- Parameters:
signatureField- the signature fieldproperties- properties- Throws:
IOException- if something went wrong
-
createAffineTransform
@Deprecated public void createAffineTransform(byte[] params)
In order to create Affine Transform, using parameters.- Specified by:
createAffineTransformin interfacePDFTemplateBuilder- Parameters:
params- parameter values
-
createAffineTransform
public void createAffineTransform(AffineTransform affineTransform)
Description copied from interface:PDFTemplateBuilderIn order to create Affine Transform, using parameters.- Specified by:
createAffineTransformin interfacePDFTemplateBuilder- Parameters:
affineTransform- the transformation
-
createProcSetArray
public void createProcSetArray()
Description copied from interface:PDFTemplateBuilderCreates procSetArray of PDF,Text,ImageB,ImageC,ImageI.- Specified by:
createProcSetArrayin interfacePDFTemplateBuilder
-
createSignatureImage
public void createSignatureImage(PDDocument template, Bitmap image) throws IOException
Description copied from interface:PDFTemplateBuilderCreates signature image.- Specified by:
createSignatureImagein interfacePDFTemplateBuilder- Parameters:
template- template documentimage- signature image- Throws:
IOException- if something went wrong
-
createFormatterRectangle
@Deprecated public void createFormatterRectangle(byte[] params)
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.- Specified by:
createFormatterRectanglein interfacePDFTemplateBuilder- Parameters:
params- parameters
-
createFormatterRectangle
public void createFormatterRectangle(int[] params)
Description copied from interface:PDFTemplateBuilderAn 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.- Specified by:
createFormatterRectanglein interfacePDFTemplateBuilder- Parameters:
params- parameters
-
createHolderFormStream
public void createHolderFormStream(PDDocument template)
- Specified by:
createHolderFormStreamin interfacePDFTemplateBuilder- Parameters:
template- template document
-
createHolderFormResources
public void createHolderFormResources()
Description copied from interface:PDFTemplateBuilderCreates resources of form- Specified by:
createHolderFormResourcesin interfacePDFTemplateBuilder
-
createHolderForm
public void createHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)
Description copied from interface:PDFTemplateBuilderCreates Form- Specified by:
createHolderFormin interfacePDFTemplateBuilder- Parameters:
holderFormResources- holder form resourcesholderFormStream- holder streambbox- bounding box
-
createAppearanceDictionary
public void createAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField) throws IOException
Description copied from interface:PDFTemplateBuilderCreates appearance dictionary- Specified by:
createAppearanceDictionaryin interfacePDFTemplateBuilder- Parameters:
holderForml- holder XObjectsignatureField- the signature field- Throws:
IOException- if something went wrong
-
createInnerFormStream
public void createInnerFormStream(PDDocument template)
- Specified by:
createInnerFormStreamin interfacePDFTemplateBuilder- Parameters:
template- template document
-
createInnerFormResource
public void createInnerFormResource()
Description copied from interface:PDFTemplateBuilderCreates InnerForm- Specified by:
createInnerFormResourcein interfacePDFTemplateBuilder
-
createInnerForm
public void createInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)
- Specified by:
createInnerFormin interfacePDFTemplateBuilder- Parameters:
innerFormResources- inner form resourcesinnerFormStream- inner form streambbox- bounding box
-
insertInnerFormToHolderResources
public void insertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)
- Specified by:
insertInnerFormToHolderResourcesin interfacePDFTemplateBuilder- Parameters:
innerForm- inner form XObjectholderFormResources- holder form resources
-
createImageFormStream
public void createImageFormStream(PDDocument template)
- Specified by:
createImageFormStreamin interfacePDFTemplateBuilder- Parameters:
template- template document
-
createImageFormResources
public void createImageFormResources()
Description copied from interface:PDFTemplateBuilderCreate resource of image form- Specified by:
createImageFormResourcesin interfacePDFTemplateBuilder
-
createImageForm
public void createImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, AffineTransform at, PDImageXObject img) throws IOException
Description copied from interface:PDFTemplateBuilderCreates Image form- Specified by:
createImageFormin interfacePDFTemplateBuilder- Parameters:
imageFormResources- image form resourcesinnerFormResource- inner form resourcesimageFormStream- image from streambbox- bounding boxat- transformationimg- ImageXObject- Throws:
IOException- if something went wrong
-
createBackgroundLayerForm
public void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws IOException
Description copied from interface:PDFTemplateBuilderCreates the background layer form (n0).- Specified by:
createBackgroundLayerFormin interfacePDFTemplateBuilder- Parameters:
innerFormResource- inner acroform resourcesbbox- rectangle of the formatter- Throws:
IOException- if something went wrong
-
injectProcSetArray
public void injectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)
Description copied from interface:PDFTemplateBuilderInject procSetArray- Specified by:
injectProcSetArrayin interfacePDFTemplateBuilder- Parameters:
innerForm- inner formpage- the given pageinnerFormResources- inner form resourcesimageFormResources- image form resourcesholderFormResources- holder form resourcesprocSet- procset values
-
injectAppearanceStreams
public void injectAppearanceStreams(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties) throws IOException
Description copied from interface:PDFTemplateBuilderinjects appearance streams- Specified by:
injectAppearanceStreamsin interfacePDFTemplateBuilder- 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
-
appendRawCommands
public void appendRawCommands(OutputStream os, String commands) throws IOException
- Throws:
IOException
-
createVisualSignature
public void createVisualSignature(PDDocument template)
Description copied from interface:PDFTemplateBuilderjust to create visible signature- Specified by:
createVisualSignaturein interfacePDFTemplateBuilder- Parameters:
template- template document
-
createWidgetDictionary
public void createWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources) throws IOException
Description copied from interface:PDFTemplateBuilderadds Widget Dictionary- Specified by:
createWidgetDictionaryin interfacePDFTemplateBuilder- Parameters:
signatureField- the signature fieldholderFormResources- holder form resources- Throws:
IOException- if something went wrong
-
closeTemplate
public void closeTemplate(PDDocument template) throws IOException
Description copied from interface:PDFTemplateBuilderCloses template- Specified by:
closeTemplatein interfacePDFTemplateBuilder- Parameters:
template- template document- Throws:
IOException- if something went wrong
-
-