aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java b/src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java
index 409a600..6f73739 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/input/correction/InternalCorrector.java
@@ -11,6 +11,8 @@ import at.gv.egiz.pdfas.exceptions.framework.CorrectorException;
import at.gv.egiz.pdfas.framework.input.PdfDataSource;
import at.gv.egiz.pdfas.framework.input.correction.Corrector;
import at.gv.egiz.pdfas.impl.input.ByteArrayPdfDataSourceImpl;
+import at.gv.egiz.pdfas.utils.PDFASUtils;
+import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfReader;
@@ -33,6 +35,7 @@ public class InternalCorrector implements Corrector
{
byte[] pdf = document.getAsByteArray();
PdfReader reader = new PdfReader(pdf);
+ PDFASUtils.checkReaderPermissions(reader);
ByteArrayOutputStream baos = new ByteArrayOutputStream(pdf.length);
@@ -51,7 +54,9 @@ public class InternalCorrector implements Corrector
catch (IOException e)
{
throw new CorrectorException(ErrorCode.CORRECTOR_EXCEPTION, e);
- }
+ } catch (PDFDocumentException e) {
+ throw new CorrectorException(e.getErrorCode(), e);
+ }
}
}