Class PDFTemplateStructure
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDFTemplateStructure
Structure of PDF document with visible signature.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PDAcroForm
private COSDictionary
private AffineTransform
private PDAppearanceDictionary
private PDRectangle
private PDFormXObject
private PDResources
private PDStream
private PDImageXObject
private PDFormXObject
private COSName
private PDResources
private PDStream
private COSName
private PDFormXObject
private COSName
private PDResources
private PDStream
private PDPage
private PDSignature
private COSArray
private PDSignatureField
private PDRectangle
private PDDocument
private COSDocument
private COSDictionary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets AcroFormGets Dictionary of AcroForm.Gets acroFormFieldsGets AffineTransformGets AppearanceDictionary That is /AP entry the appearance dictionary.Gets formatter rectangleGets Holder form.Gets Holder form resourcesSets HolderFormStreamgetImage()
Gets the image of visible signatureGets Image form.Gets image form nameGets image form resourcesGets Image form streamGets visible signature image nameGets 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".Gets name of inner formGets inner form ResourceGets Inner form Stream.getPage()
Returns document page.Gets PDSignatureGets ProcSet ArrayGets Signature fieldGets SignatureRectangleGets PDDocument template.Deprecated.This will be removed in 2.1 because the method name is misleading and confusing, and the work done rather belongs into the calling class:Gets COSDocument of visible Signature.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
(List<PDField> acroFormFields) Sets acroFormFieldsvoid
setAffineTransform
(AffineTransform affineTransform) Sets AffineTransformvoid
setAppearanceDictionary
(PDAppearanceDictionary appearanceDictionary) Sets AppearanceDictionary That is /AP entry the appearance dictionary.void
setFormatterRectangle
(PDRectangle formatterRectangle) Sets formatter rectanglevoid
setHolderForm
(PDFormXObject 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
setImage
(PDImageXObject image) Sets the image of visible signaturevoid
setImageForm
(PDFormXObject imageForm) Sets Image form.void
setImageFormName
(COSName imageFormName) Sets image form namevoid
setImageFormResources
(PDResources imageFormResources) Sets image form resourcevoid
setImageFormStream
(PDStream imageFormStream) Sets image form streamvoid
setImageName
(COSName imageName) Sets visible signature image namevoid
setInnerForm
(PDFormXObject innerForm) sets inner form to this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{destination}void
setInnerFormName
(COSName innerFormName) Sets inner form namevoid
setInnerFormResources
(PDResources innerFormResources) Sets inner form resourcevoid
setInnterFormStream
(PDStream innerFormStream) Sets inner form streamvoid
Sets document pagevoid
setPdSignature
(PDSignature pdSignature) Sets PDSignatureFieldvoid
setProcSet
(COSArray procSet) Sets ProcSet Arrayvoid
setSignatureField
(PDSignatureField signatureField) Sets signature fieldvoid
setSignatureRectangle
(PDRectangle signatureRectangle) Sets SignatureRectanglevoid
setTemplate
(PDDocument template) Wets PDDocument template.void
setVisualSignature
(COSDocument visualSignature) Sets COSDocument of visible Signature.void
setWidgetDictionary
(COSDictionary widgetDictionary) Sets Widget Dictionary.
-
Field Details
-
page
-
template
-
acroForm
-
signatureField
-
pdSignature
-
acroFormDictionary
-
signatureRectangle
-
affineTransform
-
procSet
-
image
-
formatterRectangle
-
holderFormStream
-
holderFormResources
-
holderForm
-
appearanceDictionary
-
innerFormStream
-
innerFormResources
-
innerForm
-
imageFormStream
-
imageFormResources
-
acroFormFields
-
innerFormName
-
imageFormName
-
imageName
-
visualSignature
-
imageForm
-
widgetDictionary
-
-
Constructor Details
-
PDFTemplateStructure
public PDFTemplateStructure()
-
-
Method Details
-
getPage
Returns document page.- Returns:
- the page
-
setPage
Sets document page- Parameters:
page
-
-
getTemplate
Gets PDDocument template. This represents a digital signature that can be attached to a document- Returns:
- the template
-
setTemplate
Wets PDDocument template. This represents a digital signature that can be attached to a document- Parameters:
template
-
-
getAcroForm
Gets AcroForm- Returns:
- the AcroForm
-
setAcroForm
Sets AcroForm- Parameters:
acroForm
-
-
getSignatureField
Gets Signature field- Returns:
- the signature field
-
setSignatureField
Sets signature field- Parameters:
signatureField
-
-
getPdSignature
Gets PDSignature- Returns:
- the signature
-
setPdSignature
Sets PDSignatureField- Parameters:
pdSignature
-
-
getAcroFormDictionary
Gets Dictionary of AcroForm. That's /DR entry in the AcroForm- Returns:
- the AcroForm's dictionary
-
setAcroFormDictionary
Acroform have its Dictionary, so we here set the Dictionary which is in this location: AcroForm/DR- Parameters:
acroFormDictionary
-
-
getSignatureRectangle
Gets SignatureRectangle- Returns:
- the rectangle for the signature
-
setSignatureRectangle
Sets SignatureRectangle- Parameters:
signatureRectangle
-
-
getAffineTransform
Gets AffineTransform- Returns:
- the AffineTransform
-
setAffineTransform
Sets AffineTransform- Parameters:
affineTransform
-
-
getProcSet
Gets ProcSet Array- Returns:
- the PorocSet array
-
setProcSet
Sets ProcSet Array- Parameters:
procSet
-
-
getImage
Gets the image of visible signature- Returns:
- the image making up the visible signature
-
setImage
Sets the image of visible signature- Parameters:
image
- Image XObject
-
getFormatterRectangle
Gets formatter rectangle- Returns:
- the formatter rectangle
-
setFormatterRectangle
Sets formatter rectangle- Parameters:
formatterRectangle
-
-
getHolderFormStream
Sets HolderFormStream- Returns:
- the holder form stream
-
setHolderFormStream
Sets stream of holder form Stream- Parameters:
holderFormStream
-
-
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
In the structure, form will be contained by XObject in the AcroForm/DR/- Parameters:
holderForm
-
-
getHolderFormResources
Gets Holder form resources- Returns:
- the holder form's resources
-
setHolderFormResources
Sets holder form resources- Parameters:
holderFormResources
-
-
getAppearanceDictionary
Gets AppearanceDictionary That is /AP entry the appearance dictionary.- Returns:
- the Appearance Dictionary
-
setAppearanceDictionary
Sets AppearanceDictionary That is /AP entry the appearance dictionary.- Parameters:
appearanceDictionary
-
-
getInnerFormStream
Gets Inner form Stream.- Returns:
- the inner form stream
-
setInnterFormStream
Sets inner form stream- Parameters:
innerFormStream
-
-
getInnerFormResources
Gets inner form Resource- Returns:
- the inner form's resources
-
setInnerFormResources
Sets inner form resource- Parameters:
innerFormResources
-
-
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
sets inner form to this location: AcroForm/DR/XObject/{holder form name}/Resources/XObject/{destination}- Parameters:
innerForm
-
-
getInnerFormName
Gets name of inner form- Returns:
- the inner forms's name
-
setInnerFormName
Sets inner form name- Parameters:
innerFormName
-
-
getImageFormStream
Gets Image form stream- Returns:
- the image form's stream
-
setImageFormStream
Sets image form stream- Parameters:
imageFormStream
-
-
getImageFormResources
Gets image form resources- Returns:
- the image form's resources
-
setImageFormResources
Sets image form resource- Parameters:
imageFormResources
-
-
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
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
Gets image form name- Returns:
- the image form's name
-
setImageFormName
Sets image form name- Parameters:
imageFormName
-
-
getImageName
Gets visible signature image name- Returns:
- the visible signature's image name
-
setImageName
Sets visible signature image name- Parameters:
imageName
-
-
getVisualSignature
Gets COSDocument of visible Signature.- Returns:
- the visual signature
- See Also:
-
setVisualSignature
Sets COSDocument of visible Signature.- Parameters:
visualSignature
-- See Also:
-
getAcroFormFields
Gets acroFormFields- Returns:
- the AcroForm fields
-
setAcroFormFields
Sets acroFormFields- Parameters:
acroFormFields
-
-
getTemplateAppearanceStream
Deprecated.This will be removed in 2.1 because the method name is misleading and confusing, and the work done rather belongs into the calling class:COSDocument visualSignature = structure.getVisualSignature(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); COSWriter writer = new COSWriter(baos); writer.write(visualSignature); writer.close(); structure.getTemplate().close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
Returns the visual signature COSDocument as a stream and closes the template field PDDocument.- Returns:
- the visual signature COSDocument as a stream
- Throws:
IOException
-
getWidgetDictionary
Gets Widget Dictionary.- Returns:
- the widget dictionary
-
setWidgetDictionary
Sets Widget Dictionary.- Parameters:
widgetDictionary
-
-