From 701ee11d3414bdb712ede023b0a5b567abd8a1bf Mon Sep 17 00:00:00 2001 From: wprinz Date: Fri, 30 May 2008 10:03:33 +0000 Subject: CR Unsichtbare Felder git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@270 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../pdfas/impl/signator/textual/TextualSignator_1_0_0.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/at/gv/egiz/pdfas/impl/signator/textual/TextualSignator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/signator/textual/TextualSignator_1_0_0.java index b49803c..a5f0131 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/signator/textual/TextualSignator_1_0_0.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/signator/textual/TextualSignator_1_0_0.java @@ -17,6 +17,7 @@ */ package at.gv.egiz.pdfas.impl.signator.textual; +import at.gv.egiz.pdfas.exceptions.ErrorCode; import at.gv.egiz.pdfas.exceptions.framework.SignatorException; import at.gv.egiz.pdfas.framework.input.DataSource; import at.gv.egiz.pdfas.framework.input.PdfDataSource; @@ -34,6 +35,8 @@ import at.knowcenter.wag.egov.egiz.pdf.PositioningInstruction; import at.knowcenter.wag.egov.egiz.pdf.TablePos; import at.knowcenter.wag.egov.egiz.sig.SignatureDataImpl; import at.knowcenter.wag.egov.egiz.sig.SignatureObject; +import at.knowcenter.wag.egov.egiz.sig.SignatureTypeDefinition; +import at.knowcenter.wag.egov.egiz.sig.SignatureTypes; import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper; import com.lowagie.text.pdf.PdfPTable; @@ -87,6 +90,12 @@ public class TextualSignator_1_0_0 implements Signator { try { + SignatureTypeDefinition std = SignatureTypes.getInstance().getSignatureTypeDefinition(profile); + if (!std.isTextExtractable()) + { + throw new SignatorException(ErrorCode.PROFILE_NOT_USABLE_FOR_TEXT, "The signature profile " + profile + " is not text extractable and thereby cannot be used for textual signature."); + } + TextualSignatorInformation tsi = new TextualSignatorInformation(); tsi.originalDocument = pdfDataSource; tsi.profile = profile; @@ -128,7 +137,7 @@ public class TextualSignator_1_0_0 implements Signator PositioningInstruction pi = PdfAS.determineTablePositioning(tsi.pos, tsi.profile, tsi.originalDocument, pdf_table); - IncrementalUpdateInformation iui = IncrementalUpdateHelper.writeIncrementalUpdateToDataSink(tsi.originalDocument, dataSink, pdf_table, pi); + IncrementalUpdateInformation iui = IncrementalUpdateHelper.writeIncrementalUpdateToDataSink(tsi.originalDocument, dataSink, pdf_table, tsi.profile, pi); tsi.atp = iui.actualTablePos; // OutputStream os = dataSink.createOutputStream(PdfAS.PDF_MIME_TYPE); -- cgit v1.2.3