From 42d292e5cee2fc282a09e7e0b307844deb27f368 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:39:20 +0000 Subject: Also show error for encrypted PDFs git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@435 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../java/at/asit/pdfover/gui/composites/PositioningComposite.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java') 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); -- cgit v1.2.3