CreateSignature
| Modifier and Type | Field and Description |
|---|---|
| private PDDocument | |
| private boolean | |
| private SignatureOptions | |
| private RandomAccessStreamCache. | |
| private final PDVisibleSigProperties | |
| private PDVisibleSignDesigner |
| Access | Constructor and Description |
|---|---|
| public | CreateVisibleSignature(KeyStore
is a pkcs12 keystore. keystore, char[] is the pin for the keystore / private key pin)Initialize the signature creator with a keystore (pkcs12) and pin that should be used for the signature. |
| Modifier and Type | Method and Description |
|---|---|
| private PDSignature | |
| public RandomAccessStreamCache. | Returns: the function to be used to create an instance of the choosen stream cacheGet the function to be used to create an instance of the choosen stream cache. |
| public boolean | |
| public static void | |
| public void | |
| public void | setStreamCacheCreateFunction(RandomAccessStreamCache.
the function to be used to create an instance of the choosen stream cache streamCacheSet the function to be used to create an instance of the choosen stream cache. |
| public void | setVisibleSignatureProperties(String name, String location, String reason, int preferredSize, int
the signature should be placed on (1-based) page, boolean visualSignEnabled)Set visible signature properties for new signature fields. |
| public void | setVisibleSignatureProperties(String name, String location, String reason, boolean visualSignEnabled)
Set visible signature properties for existing signature fields. |
| public void | setVisibleSignDesigner(String
path of the PDF file filename, int position of the signature field x, int position of the signature field y, int increase (positive value) or decrease (negative value) image with x percent. zoomPercent, InputStream input stream of an image. imageStream, int the signature should be placed on (1-based) page)Open the PDF, create and set the visible signature designer for a new signature field. |
| public void | setVisibleSignDesigner(int
increase (positive value) or decrease (negative value) image with x percent. zoomPercent, InputStream input stream of an image. imageStream)Set visible signature designer for an existing signature field. |
| public void | |
| public void | signPDF(File
The source pdf document file. It will be opened if it hasn't been opened
before in inputFile, File setVisibleSignDesigner(java..The file to be signed. signedFile, String optional TSA url tsaUrl, String optional name of an existing (unsigned) signature field signatureFieldName)Sign pdf file and create new file that ends with "_signed.pdf". |
| private static void |
| doc | back to summary |
|---|---|
| private PDDocument doc | |
| lateExternalSigning | back to summary |
|---|---|
| private boolean lateExternalSigning | |
| signatureOptions | back to summary |
|---|---|
| private SignatureOptions signatureOptions | |
| streamCache | back to summary |
|---|---|
| private RandomAccessStreamCache. | |
| visibleSignatureProperties | back to summary |
|---|---|
| private final PDVisibleSigProperties visibleSignatureProperties | |
| visibleSignDesigner | back to summary |
|---|---|
| private PDVisibleSignDesigner visibleSignDesigner | |
| CreateVisibleSignature | back to summary |
|---|---|
| public CreateVisibleSignature(KeyStore keystore, char[] pin) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, CertificateException Initialize the signature creator with a keystore (pkcs12) and pin that should be used for the signature.
| |
| findExistingSignature | back to summary |
|---|---|
| private PDSignature findExistingSignature(PDDocument doc, String sigFieldName) | |
| getStreamCacheCreateFunction | back to summary |
|---|---|
| public RandomAccessStreamCache. Get the function to be used to create an instance of the choosen stream cache.
| |
| isLateExternalSigning | back to summary |
|---|---|
| public boolean isLateExternalSigning() | |
| main | back to summary |
|---|---|
| public static void main(String[] args) throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException Arguments are [0] key store [1] pin [2] document that will be signed [3] image of visible signature | |
| setLateExternalSigning | back to summary |
|---|---|
| public void setLateExternalSigning(boolean lateExternalSigning) Set late external signing. Enable this if you want to activate the demo code where the signature is kept and added in an extra step without using PDFBox methods. This is disabled by default. | |
| setStreamCacheCreateFunction | back to summary |
|---|---|
| public void setStreamCacheCreateFunction(RandomAccessStreamCache. Set the function to be used to create an instance of the choosen stream cache.
| |
| setVisibleSignatureProperties | back to summary |
|---|---|
| public void setVisibleSignatureProperties(String name, String location, String reason, int preferredSize, int page, boolean visualSignEnabled) Set visible signature properties for new signature fields.
| |
| setVisibleSignatureProperties | back to summary |
|---|---|
| public void setVisibleSignatureProperties(String name, String location, String reason, boolean visualSignEnabled) Set visible signature properties for existing signature fields. | |
| setVisibleSignDesigner | back to summary |
|---|---|
| public void setVisibleSignDesigner(String filename, int x, int y, int zoomPercent, InputStream imageStream, int page) throws IOException Open the PDF, create and set the visible signature designer for a new signature field.
| |
| setVisibleSignDesigner | back to summary |
|---|---|
| public void setVisibleSignDesigner(int zoomPercent, InputStream imageStream) throws IOException Set visible signature designer for an existing signature field.
| |
| signPDF | back to summary |
|---|---|
| public void signPDF(File inputFile, File signedFile, String tsaUrl) throws IOException Sign pdf file and create new file that ends with "_signed.pdf". | |
| signPDF | back to summary |
|---|---|
| public void signPDF(File inputFile, File signedFile, String tsaUrl, String signatureFieldName) throws IOException Sign pdf file and create new file that ends with "_signed.pdf".
| |
| usage | back to summary |
|---|---|
| private static void usage() This will print the usage for this program. | |