diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/impl/signator/textual/TextualSignator_1_0_0.java | 11 |
1 files changed, 10 insertions, 1 deletions
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);
|