From d16a7c27a77399806d1e2c6ae082e98d456c3baf Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 21 Oct 2014 10:28:54 +0200 Subject: PDF API update to ouput signed documents via output stream --- .../java/at/gv/egiz/pdfas/cli/test/SignaturProfileTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'pdf-as-cli/src/test/java/at/gv') diff --git a/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturProfileTest.java b/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturProfileTest.java index 6b1eeaa9..75f19c71 100644 --- a/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturProfileTest.java +++ b/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturProfileTest.java @@ -98,17 +98,16 @@ public class SignaturProfileTest { System.out.println("Testing " + profile); DataSource source = new ByteArrayDataSource(input); - + + FileOutputStream fos = new FileOutputStream(targetFolder + profile + ".pdf"); SignParameter signParameter = PdfAsFactory.createSignParameter( - config, source); + config, source, fos); signParameter.setPlainSigner(signer); signParameter.setSignatureProfileId(profile); SignResult result = pdfas.sign(signParameter); - FileOutputStream fos = new FileOutputStream(targetFolder + profile + ".pdf"); - IOUtils.copy(result.getOutputDocument(), fos); fos.close(); } @@ -120,17 +119,15 @@ public class SignaturProfileTest { System.out.println("Testing " + profile); DataSource source = new ByteArrayDataSource(inputPDFA); - + FileOutputStream fos = new FileOutputStream(targetFolder + "PDFA_" + profile + ".pdf"); SignParameter signParameter = PdfAsFactory.createSignParameter( - config, source); + config, source, fos); signParameter.setPlainSigner(signer); signParameter.setSignatureProfileId(profile); SignResult result = pdfas.sign(signParameter); - FileOutputStream fos = new FileOutputStream(targetFolder + "PDFA_" + profile + ".pdf"); - IOUtils.copy(result.getOutputDocument(), fos); fos.close(); } } catch (Throwable e) { -- cgit v1.2.3