diff options
author | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-26 12:02:47 +0000 |
---|---|---|
committer | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-11-26 12:02:47 +0000 |
commit | 06b900642342afb680aab3b36fba9247e1e29aa9 (patch) | |
tree | b4d34d008b7d736c034caa81614a448c31af8fca /src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java | |
parent | 1b337e50a9edb280aea49879f901613e1fe17b55 (diff) | |
download | pdf-as-3-06b900642342afb680aab3b36fba9247e1e29aa9.tar.gz pdf-as-3-06b900642342afb680aab3b36fba9247e1e29aa9.tar.bz2 pdf-as-3-06b900642342afb680aab3b36fba9247e1e29aa9.zip |
Placeholder-image handling
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@613 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java b/src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java index 9841779..f25e668 100644 --- a/src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java +++ b/src/main/java/at/gv/egiz/pdfas/utils/PDFASUtils.java @@ -7,6 +7,8 @@ import java.io.FileOutputStream; import java.io.IOException;
import java.io.InputStream;
+import org.apache.pdfbox.pdmodel.PDDocument;
+
import at.gv.egiz.pdfas.exceptions.ErrorCode;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
@@ -16,6 +18,7 @@ import com.lowagie.text.pdf.PdfReader; * @author tknall
*/
public class PDFASUtils {
+//23.11.2010 changed by exthex - added checkDocumentPermissions(PDDocument doc)
private PDFASUtils() {
}
@@ -56,5 +59,11 @@ public class PDFASUtils { }
return result;
}
+
+ public static void checkDocumentPermissions(PDDocument doc) throws PDFDocumentException {
+ if (doc.isEncrypted()) {
+ throw new PDFDocumentException(ErrorCode.DOCUMENT_IS_PROTECTED, "Document is encrypted.");
+ }
+ }
}
|