diff options
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java index 7a5af6b..44a13a4 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java @@ -37,6 +37,7 @@ import java.util.Iterator; import java.util.List;
import at.gv.egiz.pdfas.exceptions.ErrorCode;
+import at.gv.egiz.pdfas.exceptions.pdf.CaptionNotFoundException;
import at.gv.egiz.pdfas.exceptions.pdf.KZSettingNotFoundException;
import at.gv.egiz.pdfas.framework.input.PdfDataSource;
import at.gv.egiz.pdfas.framework.output.DataSink;
@@ -829,9 +830,10 @@ public abstract class BinarySignature * The field definitions.
* @throws IOException
* @throws SettingNotFoundException
+ * @throws CaptionNotFoundException
*/
protected static void createEgizDict(PdfStamper stamper, PdfTemplate table_template, IncrementalUpdateInformation iui, List variable_field_definitions, List all_field_definitions)
- throws IOException, SettingNotFoundException
+ throws IOException, SettingNotFoundException, CaptionNotFoundException
{
// iui.temp_ir = table_template.getIndirectReference();
iui.temp_ir_number = table_template.getIndirectReference().getNumber();
@@ -1314,8 +1316,9 @@ public abstract class BinarySignature * where varaible strings are.
* @return Returns the list of ReplaceInfo objects specifying the variable
* areas.
+ * @throws CaptionNotFoundException
*/
- protected static List determineReplacesInContentStream(final byte[] pdf, int begin, int end, List field_definitions)
+ protected static List determineReplacesInContentStream(final byte[] pdf, int begin, int end, List field_definitions) throws CaptionNotFoundException
{
List replaces = new ArrayList();
try
@@ -1336,6 +1339,10 @@ public abstract class BinarySignature byte[] caption = sfd.caption.getBytes("ISO-8859-1");
int caption_index = findIndex(strings, caption);
+ if (caption_index < 0)
+ {
+ throw new CaptionNotFoundException(sfd.caption);
+ }
int start_index = skipStrings(strings, caption_index, caption);
int next_index = findFirstNotPlaceholder(strings, start_index);
|