aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag
diff options
context:
space:
mode:
authornetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-12-07 10:47:04 +0000
committernetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-12-07 10:47:04 +0000
commit6009309445cbab4de8042c8c62184892683b5898 (patch)
tree8a641d944a9ab1a031544ac2f9869eddf3c158b1 /src/main/java/at/knowcenter/wag
parentb1d8a770cb4236de638f744e883c076bc9b1fd2d (diff)
downloadpdf-as-3-6009309445cbab4de8042c8c62184892683b5898.tar.gz
pdf-as-3-6009309445cbab4de8042c8c62184892683b5898.tar.bz2
pdf-as-3-6009309445cbab4de8042c8c62184892683b5898.zip
neu: CaptionNotFoundException 701 in BinarySignature wenn zuwinig Platz, verbessertes Ex Handling
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@235 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/BinarySignature.java11
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);