summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:39:20 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:39:20 +0000
commit42d292e5cee2fc282a09e7e0b307844deb27f368 (patch)
tree74b73a6e470bb589b034f29e8a8abe7f1c321bea /pdf-over-gui/src/main/java/at/asit
parentd30ea266a1b0f617e9e90ba233b345490f217b4c (diff)
downloadpdf-over-42d292e5cee2fc282a09e7e0b307844deb27f368.tar.gz
pdf-over-42d292e5cee2fc282a09e7e0b307844deb27f368.tar.bz2
pdf-over-42d292e5cee2fc282a09e7e0b307844deb27f368.zip
Also show error for encrypted PDFs
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@435 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index c9e14898..8eb31752 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -182,11 +182,14 @@ public class PositioningComposite extends StateComposite {
this.pdf = new PDFFile(buf);
}
catch (PDFAuthenticationFailureException e) {
- throw new IOException(Messages.getString("error.PDFProtected"), e); //$NON-NLS-1$
+ throw new IOException(Messages.getString("error.PDFPwdProtected"), e); //$NON-NLS-1$
}
catch (IOException e) {
throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); //$NON-NLS-1$
}
+ if (this.pdf.getDefaultDecrypter().isEncryptionPresent())
+ throw new IOException(Messages.getString("error.PDFProtected")); //$NON-NLS-1$
+
if (this.viewer == null) {
this.viewer = new SignaturePanel(this.pdf);
this.frame.add(this.viewer, BorderLayout.CENTER);