From d30ea266a1b0f617e9e90ba233b345490f217b4c Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:39:08 +0000 Subject: Show useful error msg if PDF is password protected git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@434 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../java/at/asit/pdfover/gui/composites/PositioningComposite.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pdf-over-gui/src/main/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 8294c004..c9e14898 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 @@ -52,6 +52,7 @@ import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.SignaturePosition; import com.sun.pdfview.PDFFile; +import com.sun.pdfview.decrypt.PDFAuthenticationFailureException; /** * Composite which allows to position the signature on a preview of the document @@ -180,6 +181,9 @@ public class PositioningComposite extends StateComposite { { this.pdf = new PDFFile(buf); } + catch (PDFAuthenticationFailureException e) { + throw new IOException(Messages.getString("error.PDFProtected"), e); //$NON-NLS-1$ + } catch (IOException e) { throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); //$NON-NLS-1$ } -- cgit v1.2.3