Class PDFTemplateStructure
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDFTemplateStructure
-
public class PDFTemplateStructure extends java.lang.Object
Structure of PDF document with visible signature
-
-
Constructor Summary
Constructors Constructor Description PDFTemplateStructure()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDAcroForm
getAcroForm()
Gets AcroformCOSDictionary
getAcroFormDictionary()
Gets Dictionary of AcroForm.java.util.List<PDField>
getAcroFormFields()
Gets acroFormFieldsjava.awt.geom.AffineTransform
getAffineTransform()
Gets AffineTransformPDAppearanceDictionary
getAppearanceDictionary()
Gets AppearanceDictionary That is /AP entry the appearance dictionary.PDRectangle
getFormaterRectangle()
Gets formatter rectanglePDXObjectForm
getHolderForm()
Gets Holder form.PDResources
getHolderFormResources()
Gets Holder form resourcesPDStream
getHolderFormStream()
Sets HolderFormStreamPDXObjectForm
getImageForm()
Gets Image form.java.lang.String
getImageFormName()
Gets image form namePDResources
getImageFormResources()
Gets image form resourcesPDStream
getImageFormStream()
Gets Image form streamjava.lang.String
getImageName()
Gets visible signature image namePDXObjectForm
getInnerForm()
Gets inner form that is in this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{inner name} By default inner form name starts with "n".java.lang.String
getInnerFormName()
Gets name of inner formPDResources
getInnerFormResources()
Gets inner form ResourcePDStream
getInnterFormStream()
Gets Inner form Stream.PDJpeg
getJpedImage()
Gets the image of visible signaturePDPage
getPage()
Returns document page.PDSignature
getPdSignature()
Gets PDSignatureCOSArray
getProcSet()
Gets ProcSet ArrayPDSignatureField
getSignatureField()
Gets Signature fieldPDRectangle
getSingatureRectangle()
Gets SignatureRectanglePDDocument
getTemplate()
Gets PDDocument template.java.io.ByteArrayInputStream
getTemplateAppearanceStream()
Gets AP of the created templateCOSDocument
getVisualSignature()
Gets COSDocument of visible Signature.COSDictionary
getWidgetDictionary()
Gets Widget Dictionary.void
setAcroForm(PDAcroForm acroForm)
Sets Acroformvoid
setAcroFormDictionary(COSDictionary acroFormDictionary)
Acroform have its Dictionary, so we here set the Dictionary which is in this location: AcroForm/DRvoid
setAcroFormFields(java.util.List<PDField> acroFormFields)
Sets acroFormFieldsvoid
setAffineTransform(java.awt.geom.AffineTransform affineTransform)
Sets AffineTransformvoid
setAppearanceDictionary(PDAppearanceDictionary appearanceDictionary)
Sets AppearanceDictionary That is /AP entry the appearance dictionary.void
setFormaterRectangle(PDRectangle formaterRectangle)
Sets formatter rectanglevoid
setHolderForm(PDXObjectForm holderForm)
In the structure, form will be contained by XObject in the AcroForm/DR/void
setHolderFormResources(PDResources holderFormResources)
Sets holder form resourcesvoid
setHolderFormStream(PDStream holderFormStream)
Sets stream of holder form Streamvoid
setImageForm(PDXObjectForm imageForm)
Sets Image form.void
setImageFormName(java.lang.String imageFormName)
Sets image form namevoid
setImageFormResources(PDResources imageFormResources)
Sets image form resourcevoid
setImageFormStream(PDStream imageFormStream)
Sets image form streamvoid
setImageName(java.lang.String imageName)
Sets visible signature image namevoid
setInnerForm(PDXObjectForm innerForm)
sets inner form to this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{destination}void
setInnerFormName(java.lang.String innerFormName)
Sets inner form namevoid
setInnerFormResources(PDResources innerFormResources)
Sets inner form resourcevoid
setInnterFormStream(PDStream innterFormStream)
Sets inner form streamvoid
setJpedImage(PDJpeg jpedImage)
Sets the image of visible signaturevoid
setPage(PDPage page)
Sets document pagevoid
setPdSignature(PDSignature pdSignature)
Sets PDSignaturevoid
setProcSet(COSArray procSet)
Sets ProcSet Arrayvoid
setSignatureField(PDSignatureField signatureField)
Sets signature fieldvoid
setSignatureRectangle(PDRectangle singatureRectangle)
Sets SignatureRectanglevoid
setTemplate(PDDocument template)
Wets PDDocument template.void
setVisualSignature(COSDocument visualSignature)
Sets COSDocument of visible Signature.void
setWidgetDictionary(COSDictionary widgetDictionary)
Sets Widget Dictionary.
-
-
-
Method Detail
-
getPage
public PDPage getPage()
Returns document page.- Returns:
- the document page.
-
setPage
public void setPage(PDPage page)
Sets document page- Parameters:
page
-
-
getTemplate
public PDDocument getTemplate()
Gets PDDocument template. This represents a digital signature that can be attached to a document- Returns:
- the template to be used.
-
setTemplate
public void setTemplate(PDDocument template)
Wets PDDocument template. This represents a digital signature that can be attached to a document- Parameters:
template
-
-
getAcroForm
public PDAcroForm getAcroForm()
Gets Acroform- Returns:
- the documents AcroForm.
-
setAcroForm
public void setAcroForm(PDAcroForm acroForm)
Sets Acroform- Parameters:
acroForm
-
-
getSignatureField
public PDSignatureField getSignatureField()
Gets Signature field- Returns:
- the signature field to be used.
-
setSignatureField
public void setSignatureField(PDSignatureField signatureField)
Sets signature field- Parameters:
signatureField
-
-
getPdSignature
public PDSignature getPdSignature()
Gets PDSignature- Returns:
- the signature object.
-
setPdSignature
public void setPdSignature(PDSignature pdSignature)
Sets PDSignature- Parameters:
pdSignature
-
-
getAcroFormDictionary
public COSDictionary getAcroFormDictionary()
Gets Dictionary of AcroForm. Thats /DR entry in the AcroForm- Returns:
- the AcroForms dictionary object.
-
setAcroFormDictionary
public void setAcroFormDictionary(COSDictionary acroFormDictionary)
Acroform have its Dictionary, so we here set the Dictionary which is in this location: AcroForm/DR- Parameters:
acroFormDictionary
-
-
getSingatureRectangle
public PDRectangle getSingatureRectangle()
Gets SignatureRectangle- Returns:
- the signatures rectangle.
-
setSignatureRectangle
public void setSignatureRectangle(PDRectangle singatureRectangle)
Sets SignatureRectangle- Parameters:
singatureRectangle
-
-
getAffineTransform
public java.awt.geom.AffineTransform getAffineTransform()
Gets AffineTransform- Returns:
- the AffineTransform
-
setAffineTransform
public void setAffineTransform(java.awt.geom.AffineTransform affineTransform)
Sets AffineTransform- Parameters:
affineTransform
-
-
getProcSet
public COSArray getProcSet()
Gets ProcSet Array- Returns:
- the proc set array
-
setProcSet
public void setProcSet(COSArray procSet)
Sets ProcSet Array- Parameters:
procSet
-
-
getJpedImage
public PDJpeg getJpedImage()
Gets the image of visible signature- Returns:
- the image used for a visible signature.
-
setJpedImage
public void setJpedImage(PDJpeg jpedImage)
Sets the image of visible signature- Parameters:
jpedImage
-
-
getFormaterRectangle
public PDRectangle getFormaterRectangle()
Gets formatter rectangle- Returns:
- the rectangle used by the formatter.
-
setFormaterRectangle
public void setFormaterRectangle(PDRectangle formaterRectangle)
Sets formatter rectangle- Parameters:
formaterRectangle
-
-
getHolderFormStream
public PDStream getHolderFormStream()
Sets HolderFormStream- Returns:
- the form stream of the holder.
-
setHolderFormStream
public void setHolderFormStream(PDStream holderFormStream)
Sets stream of holder form Stream- Parameters:
holderFormStream
-
-
getHolderForm
public PDXObjectForm getHolderForm()
Gets Holder form. That form is here AcroForm/DR/XObject/{holder form name} By default, name stars with FRM. We also add number of form to the name.- Returns:
- the holder form
-
setHolderForm
public void setHolderForm(PDXObjectForm holderForm)
In the structure, form will be contained by XObject in the AcroForm/DR/- Parameters:
holderForm
-
-
getHolderFormResources
public PDResources getHolderFormResources()
Gets Holder form resources- Returns:
- the holder forms resources.
-
setHolderFormResources
public void setHolderFormResources(PDResources holderFormResources)
Sets holder form resources- Parameters:
holderFormResources
-
-
getAppearanceDictionary
public PDAppearanceDictionary getAppearanceDictionary()
Gets AppearanceDictionary That is /AP entry the appearance dictionary.- Returns:
- the appearance directory.
-
setAppearanceDictionary
public void setAppearanceDictionary(PDAppearanceDictionary appearanceDictionary)
Sets AppearanceDictionary That is /AP entry the appearance dictionary.- Parameters:
appearanceDictionary
-
-
getInnterFormStream
public PDStream getInnterFormStream()
Gets Inner form Stream.- Returns:
- the inner form's stream.
-
setInnterFormStream
public void setInnterFormStream(PDStream innterFormStream)
Sets inner form stream- Parameters:
innterFormStream
-
-
getInnerFormResources
public PDResources getInnerFormResources()
Gets inner form Resource- Returns:
- the inner form's resources.
-
setInnerFormResources
public void setInnerFormResources(PDResources innerFormResources)
Sets inner form resource- Parameters:
innerFormResources
-
-
getInnerForm
public PDXObjectForm getInnerForm()
Gets inner form that is in this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{inner name} By default inner form name starts with "n". Then we add number of form to the name.- Returns:
- the inner form.
-
setInnerForm
public void setInnerForm(PDXObjectForm innerForm)
sets inner form to this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{destination}- Parameters:
innerForm
-
-
getInnerFormName
public java.lang.String getInnerFormName()
Gets name of inner form- Returns:
- the inner form's name.
-
setInnerFormName
public void setInnerFormName(java.lang.String innerFormName)
Sets inner form name- Parameters:
innerFormName
-
-
getImageFormStream
public PDStream getImageFormStream()
Gets Image form stream- Returns:
- the inner form's stream.
-
setImageFormStream
public void setImageFormStream(PDStream imageFormStream)
Sets image form stream- Parameters:
imageFormStream
-
-
getImageFormResources
public PDResources getImageFormResources()
Gets image form resources- Returns:
- the image form's resources.
-
setImageFormResources
public void setImageFormResources(PDResources imageFormResources)
Sets image form resource- Parameters:
imageFormResources
-
-
getImageForm
public PDXObjectForm getImageForm()
Gets Image form. Image form is in this structure: /AcroForm/DR/{holder form}/Resources/XObject /{inner form} /Resources/XObject/{image form name}.- Returns:
- the image form.
-
setImageForm
public void setImageForm(PDXObjectForm imageForm)
Sets Image form. Image form will be in this structure: /AcroForm/DR/{holder form}/Resources/XObject /{inner form} /Resources/XObject/{image form name}. By default we start image form name with "img". Then we add number of image form to the form name. Sets image form- Parameters:
imageForm
-
-
getImageFormName
public java.lang.String getImageFormName()
Gets image form name- Returns:
- the image form's name.
-
setImageFormName
public void setImageFormName(java.lang.String imageFormName)
Sets image form name- Parameters:
imageFormName
-
-
getImageName
public java.lang.String getImageName()
Gets visible signature image name- Returns:
- the visible signature image's name.
-
setImageName
public void setImageName(java.lang.String imageName)
Sets visible signature image name- Parameters:
imageName
-
-
getVisualSignature
public COSDocument getVisualSignature()
Gets COSDocument of visible Signature.- Returns:
- the document representing the visual signature.
- See Also:
COSDocument
-
setVisualSignature
public void setVisualSignature(COSDocument visualSignature)
Sets COSDocument of visible Signature.- Parameters:
visualSignature
-- See Also:
COSDocument
-
getAcroFormFields
public java.util.List<PDField> getAcroFormFields()
Gets acroFormFields- Returns:
- the fields within the AcroForm.
-
setAcroFormFields
public void setAcroFormFields(java.util.List<PDField> acroFormFields)
Sets acroFormFields- Parameters:
acroFormFields
-
-
getTemplateAppearanceStream
public java.io.ByteArrayInputStream getTemplateAppearanceStream() throws java.io.IOException, COSVisitorException
Gets AP of the created template- Returns:
- the apperance stream of the created template.
- Throws:
java.io.IOException
COSVisitorException
-
getWidgetDictionary
public COSDictionary getWidgetDictionary()
Gets Widget Dictionary.PDField
- Returns:
- the dictionary representing the widget.
- See Also:
PDField.getWidget()
-
setWidgetDictionary
public void setWidgetDictionary(COSDictionary widgetDictionary)
Sets Widget Dictionary.PDField
- Parameters:
widgetDictionary
-- See Also:
PDField.getWidget()
-
-