summaryrefslogtreecommitdiff
path: root/pdf-over-gui
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:39:08 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:39:08 +0000
commitd30ea266a1b0f617e9e90ba233b345490f217b4c (patch)
treee1a31539881536ef33bb3302f2bdf0732e114d20 /pdf-over-gui
parent0596b077bdb07db40ebb067cdcda749f14cf6a9c (diff)
downloadpdf-over-d30ea266a1b0f617e9e90ba233b345490f217b4c.tar.gz
pdf-over-d30ea266a1b0f617e9e90ba233b345490f217b4c.tar.bz2
pdf-over-d30ea266a1b0f617e9e90ba233b345490f217b4c.zip
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
Diffstat (limited to 'pdf-over-gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java4
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties3
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties3
3 files changed, 8 insertions, 2 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 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$
}
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
index 6fa3f705..d713a009 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
@@ -77,7 +77,8 @@ error.InvalidPhoneNumber=Given phone number is invalid! Example: +43664123456789
error.InvalidSettings=Invalid settings are still present. Please check your input.
error.IOError=Input/Output Error
error.LocalBKU=Please check if a local CCE (citizen card environment) is running\n\nYou need a CCE to access your citizen card. Further information under www.buergerkarte.at
-error.MayNotBeAPDF=This may not be a PDF File
+error.MayNotBeAPDF=This may not be a PDF file
+error.PDFProtected=This PDF file is password protected
error.PositioningNotPossible=Manual positioning currently not possible due to a Java Bug. Using automatic positioning.
error.PrepareDocument=Failed to prepare document for signature.
error.Retry=Retry
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
index f255a349..8c46bb2c 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
@@ -77,7 +77,8 @@ error.InvalidPhoneNumber=Telefonnummer ungültig! Beispiel: +43664123456789
error.InvalidSettings=Ungültige Einstellungen vorhanden. Bitte überprüfen.
error.IOError=Ein-/Ausgabe-Fehler
error.LocalBKU=Bitte prüfen sie, ob Ihre lokale BKU (Bürgerkartenumgebung) läuft\n\nSie benötigen eine BKU, um auf Ihre Bürgerkarte zuzugreifen. Weitere Informationen unter www.buergerkarte.at
-error.MayNotBeAPDF=Dies ist möglicherweise keine PDF Datei
+error.MayNotBeAPDF=Dies ist möglicherweise keine PDF-Datei
+error.PDFProtected=Diese PDF-Datei ist Passwortgeschützt
error.PositioningNotPossible=Positionsauswahl ist im Moment nicht verfügbar wegen eines Java Fehlers. Die Position wird automatisch bestimmt.
error.PrepareDocument=Konnte Dokument nicht zur Signatur vorbereiten.
error.Retry=Wiederholen