|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faceless.pdf2.viewer2.ViewerFeature
org.faceless.pdf2.viewer2.AnnotationComponentFactory
org.faceless.pdf2.viewer2.feature.FormBlankSignatureWidgetFactory
public class FormBlankSignatureWidgetFactory
Create annotations to handle WidgetAnnotation objects belonging to unsigned FormSignature
fields. As supplied, this class will prompt the user for a KeyStore and and then to select the
alias and password required to sign the PDF, but it's possible to create an instance of this factory that
has any one of these fields pre-set. Then just remove the default FormBlankSignatureWidgetFactory
from the features passed in to the PDFViewer constructor and replace it with that new instance.
The name of this feature is "FormBlankSignatureWidgetFactory".
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
| Constructor Summary | |
|---|---|
FormBlankSignatureWidgetFactory()
Create a new FormBlankSignatureWidgetFactory |
|
| Method Summary | |
|---|---|
JComponent |
createComponent(PagePanel pagepanel,
PDFAnnotation annot)
Return a JComponent that will visually represent the specified PDFAnnotation. |
void |
initialize(PDFViewer viewer)
Called when the feature is first added to a viewer |
boolean |
matches(PDFAnnotation annot)
Return true if this AnnotationComponentFactory could create a JComponent
for the specified PDFAnnotation. |
void |
setAlias(String alias,
char[] password)
Set the alias to use from the KeyStore. |
void |
setCertificationType(int type)
Set the certification type |
void |
setKeyStoreManager(KeyStoreManager manager)
Set the KeyStoreManager |
void |
setLocation(String location)
Set the location of the signing, which may be null. |
void |
setName(String name)
Set the name of the individual applying the signature. |
void |
setReason(String reason)
Set the reason for signing, which may be null. |
void |
setSignatureHandlerFactory(SignatureHandlerFactory factory)
Set the SignatureHandlerFactory to be used to sign this PDF. |
void |
sign(FormSignature field,
DocumentPanel panel)
Sign the field. |
| Methods inherited from class org.faceless.pdf2.viewer2.AnnotationComponentFactory |
|---|
bindComponentLocation, bindComponentLocation, bindComponentLocation, createEditComponent, createNewAnnotation, getAnnotationType, paintComponent, toString |
| Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature |
|---|
getAllFeatures, getName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FormBlankSignatureWidgetFactory()
| Method Detail |
|---|
public void initialize(PDFViewer viewer)
ViewerFeature
initialize in class ViewerFeaturepublic boolean matches(PDFAnnotation annot)
AnnotationComponentFactoryJComponent
for the specified PDFAnnotation.
matches in class AnnotationComponentFactory
public JComponent createComponent(PagePanel pagepanel,
PDFAnnotation annot)
AnnotationComponentFactory
createComponent in class AnnotationComponentFactorypagepanel - the panel the JComponent will be added toannot - the annotationpublic void setReason(String reason)
reason - the signing reasonpublic void setLocation(String location)
location - the signers locationpublic void setName(String name)
name - the signers namepublic void setCertificationType(int type)
type - one of FormSignature.CERTIFICATION_UNCERTIFIED, FormSignature.CERTIFICATION_NOCHANGES, FormSignature.CERTIFICATION_ALLOWFORMS or FormSignature.CERTIFICATION_ALLOWCOMMENTS
public void setAlias(String alias,
char[] password)
alias - the aliaspassword - the password to use to extract the keypublic void setKeyStoreManager(KeyStoreManager manager)
KeyStoreManager
manager - the KeyStoreManager to usepublic void setSignatureHandlerFactory(SignatureHandlerFactory factory)
SignatureHandlerFactory to be used to sign this PDF. This
can be used to set custom features like key size, TimeStamp server and
more. If not set a default AcrobatSignatureHandlerFactory is used.
factory - the factory
public void sign(FormSignature field,
DocumentPanel panel)
throws IOException,
GeneralSecurityException
field - the Signature Field to signpanel - the panel
IOException
GeneralSecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||