public class PDVisibleSigBuilder extends Object implements PDFTemplateBuilder
PDFTemplateBuilder. This builds the signature PDF but doesn't keep the
elements, these are kept in its PDF template structure.| Constructor and Description |
|---|
PDVisibleSigBuilder()
Constructor, creates PDF template structure.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendRawCommands(OutputStream os,
String commands) |
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 |
createAppearanceDictionary(PDFormXObject holderForml,
PDSignatureField signatureField)
Creates appearance dictionary
|
void |
createBackgroundLayerForm(PDResources innerFormResource,
PDRectangle bbox)
Creates the background layer form (n0).
|
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)
Create a holder for the form stream.
|
void |
createImageForm(PDResources imageFormResources,
PDResources innerFormResource,
PDStream imageFormStream,
PDRectangle bbox,
AffineTransform at,
PDImageXObject img)
Creates Image form
|
void |
createImageFormResources()
Create resource of image form
|
void |
createImageFormStream(PDDocument template)
Create image form stream.
|
void |
createInnerForm(PDResources innerFormResources,
PDStream innerFormStream,
PDRectangle bbox)
Creates InnerForm.
|
void |
createInnerFormResource()
Creates InnerForm
|
void |
createInnerFormStream(PDDocument template)
Create a holder for the inner form stream.
|
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 a PDDocument and adds the page parameter to it and keeps this as a template in the PDF template
Structure.
|
void |
createVisualSignature(PDDocument template)
just to create visible signature
|
void |
createWidgetDictionary(PDSignatureField signatureField,
PDResources holderFormResources)
adds Widget Dictionary
|
PDFTemplateStructure |
getStructure()
Resturns the PDF template Structure
|
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)
Insert given from as inner form.
|
public PDVisibleSigBuilder()
public void createPage(PDVisibleSignDesigner properties)
PDFTemplateBuildercreatePage in interface PDFTemplateBuilderproperties - page propertiespublic void createTemplate(PDPage page) throws IOException
createTemplate in interface PDFTemplateBuilderpage - the page to be addedIOException - if the document could not be createdpublic void createAcroForm(PDDocument template)
PDFTemplateBuildercreateAcroForm in interface PDFTemplateBuildertemplate - the document the acroform is added topublic PDFTemplateStructure getStructure()
PDFTemplateBuildergetStructure in interface PDFTemplateBuilderpublic void createSignatureField(PDAcroForm acroForm) throws IOException
PDFTemplateBuildercreateSignatureField in interface PDFTemplateBuilderacroForm - the acroform the signature is added toIOException - if the signature could not be createdpublic void createSignature(PDSignatureField pdSignatureField, PDPage page, String signerName) throws IOException
PDFTemplateBuildercreateSignature in interface PDFTemplateBuilderpdSignatureField - 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.IOException - if the signature could not be createdpublic void createAcroFormDictionary(PDAcroForm acroForm, PDSignatureField signatureField) throws IOException
PDFTemplateBuildercreateAcroFormDictionary in interface PDFTemplateBuilderacroForm - the acroform the signature field is added tosignatureField - the signature filed to be addedIOException - if the signature field could not be addedpublic void createSignatureRectangle(PDSignatureField signatureField, PDVisibleSignDesigner properties) throws IOException
PDFTemplateBuildercreateSignatureRectangle in interface PDFTemplateBuildersignatureField - the signature field the rectangle is added toproperties - the properties used to create the rectangleIOException - if the rectangle could not be createdpublic void createAffineTransform(AffineTransform affineTransform)
PDFTemplateBuildercreateAffineTransform in interface PDFTemplateBuilderaffineTransform - the affine transformation to be usedpublic void createProcSetArray()
PDFTemplateBuildercreateProcSetArray in interface PDFTemplateBuilderpublic void createSignatureImage(PDDocument template, BufferedImage image) throws IOException
PDFTemplateBuildercreateSignatureImage in interface PDFTemplateBuildertemplate - the document the image is added toimage - to imager to be addedIOException - if the image could not be addedpublic void createFormatterRectangle(int[] params)
PDFTemplateBuildercreateFormatterRectangle in interface PDFTemplateBuilderparams - the parameters of the formatter rectanglepublic void createHolderFormStream(PDDocument template)
PDFTemplateBuildercreateHolderFormStream in interface PDFTemplateBuildertemplate - the document to be used to create the new streampublic void createHolderFormResources()
PDFTemplateBuildercreateHolderFormResources in interface PDFTemplateBuilderpublic void createHolderForm(PDResources holderFormResources, PDStream holderFormStream, PDRectangle bbox)
PDFTemplateBuildercreateHolderForm in interface PDFTemplateBuilderholderFormResources - resources to be used for the form objectholderFormStream - the stream to be used for the form objectbbox - the bounding box of the form objectpublic void createAppearanceDictionary(PDFormXObject holderForml, PDSignatureField signatureField) throws IOException
PDFTemplateBuildercreateAppearanceDictionary in interface PDFTemplateBuilderholderForml - form object to be used for the appearance streamsignatureField - the signature field the appearance stream is added toIOException - if the appearance stream could not be createdpublic void createInnerFormStream(PDDocument template)
PDFTemplateBuildercreateInnerFormStream in interface PDFTemplateBuildertemplate - the document to be used to create the new streampublic void createInnerFormResource()
PDFTemplateBuildercreateInnerFormResource in interface PDFTemplateBuilderpublic void createInnerForm(PDResources innerFormResources, PDStream innerFormStream, PDRectangle bbox)
PDFTemplateBuildercreateInnerForm in interface PDFTemplateBuilderinnerFormResources - 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 objectpublic void insertInnerFormToHolderResources(PDFormXObject innerForm, PDResources holderFormResources)
PDFTemplateBuilderinsertInnerFormToHolderResources in interface PDFTemplateBuilderinnerForm - the form object to be insertedholderFormResources - resources the fomr object is added topublic void createImageFormStream(PDDocument template)
PDFTemplateBuildercreateImageFormStream in interface PDFTemplateBuildertemplate - the document to be used to create the new streampublic void createImageFormResources()
PDFTemplateBuildercreateImageFormResources in interface PDFTemplateBuilderpublic void createImageForm(PDResources imageFormResources, PDResources innerFormResource, PDStream imageFormStream, PDRectangle bbox, AffineTransform at, PDImageXObject img) throws IOException
PDFTemplateBuildercreateImageForm in interface PDFTemplateBuilderimageFormResources - 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 objectat - the matrix of the form objectimg - the image object to be used for the form objectIOException - if the form object could not be createdpublic void createBackgroundLayerForm(PDResources innerFormResource, PDRectangle bbox) throws IOException
PDFTemplateBuildercreateBackgroundLayerForm in interface PDFTemplateBuilderinnerFormResource - resources to be used for the form objectbbox - the bounding box of the form objectIOException - if the form object could not be createdpublic void injectProcSetArray(PDFormXObject innerForm, PDPage page, PDResources innerFormResources, PDResources imageFormResources, PDResources holderFormResources, COSArray procSet)
PDFTemplateBuilderinjectProcSetArray in interface PDFTemplateBuilderinnerForm - 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 addedpublic void injectAppearanceStreams(PDStream holderFormStream, PDStream innerFormStream, PDStream imageFormStream, COSName imageFormName, COSName imageName, COSName innerFormName, PDVisibleSignDesigner properties) throws IOException
PDFTemplateBuilderinjectAppearanceStreams in interface PDFTemplateBuilderholderFormStream - 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 streamIOException - if the appearance stream could not be createdpublic void appendRawCommands(OutputStream os, String commands) throws IOException
IOExceptionpublic void createVisualSignature(PDDocument template)
PDFTemplateBuildercreateVisualSignature in interface PDFTemplateBuildertemplate - the document holding the visible signatuepublic void createWidgetDictionary(PDSignatureField signatureField, PDResources holderFormResources) throws IOException
PDFTemplateBuildercreateWidgetDictionary in interface PDFTemplateBuildersignatureField - the field to be used as widget dictionaryholderFormResources - the resources to be added to the widget dictionaryIOException - if the widget dictionary could not be createdpublic void closeTemplate(PDDocument template) throws IOException
PDFTemplateBuildercloseTemplate in interface PDFTemplateBuildertemplate - the document to be closedIOException - if the document could not be closedCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.