diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-05-08 14:11:55 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-05-08 14:11:55 +0200 |
commit | 1d5e1f5f429d225e14f4ce9e6e82a403eac10b6b (patch) | |
tree | ec2abe98cc365bcd170fcf420ed45288cbfb7e72 /pdf-as-lib/src/main/java | |
parent | 5e65a0aa96300e24a6dc7d4be64cf6745f325fc5 (diff) | |
download | pdf-as-4-1d5e1f5f429d225e14f4ce9e6e82a403eac10b6b.tar.gz pdf-as-4-1d5e1f5f429d225e14f4ce9e6e82a403eac10b6b.tar.bz2 pdf-as-4-1d5e1f5f429d225e14f4ce9e6e82a403eac10b6b.zip |
Performance Test, Web Options
Diffstat (limited to 'pdf-as-lib/src/main/java')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java index 68257861..44919b1c 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java @@ -94,7 +94,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { String fisTmpFile = null; TempFileHelper helper = pdfObject.getStatus().getTempFileHelper(); - + PDDocument doc = null; try { fisTmpFile = helper.getStaticFilename(); @@ -104,7 +104,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { FileInputStream fis = new FileInputStream(new File(fisTmpFile)); - PDDocument doc = pdfObject.getDocument(); + doc = pdfObject.getDocument(); PDSignature signature = new PDSignature(); signature.setFilter(COSName.getPDFName(signer.getPDFFilter())); // default @@ -402,6 +402,14 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { logger.error(MessageResolver.resolveMessage("error.pdf.sig.01"), e); throw new PdfAsException("error.pdf.sig.01", e); } finally { + if(doc != null) { + try { + doc.close(); + } catch (IOException e) { + logger.debug("Failed to close COS Doc!", e); + // Ignore + } + } logger.info("Signature done!"); } |