You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/08/26 17:28:02 UTC

svn commit: r1865950 - /pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Author: tilman
Date: Mon Aug 26 17:28:02 2019
New Revision: 1865950

URL: http://svn.apache.org/viewvc?rev=1865950&view=rev
Log:
PDFBOX-4637: improve exception message

Modified:
    pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Modified: pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1865950&r1=1865949&r2=1865950&view=diff
==============================================================================
--- pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java (original)
+++ pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java Mon Aug 26 17:28:02 2019
@@ -97,14 +97,24 @@ class AppearanceGeneratorHelper
         this.field = field;
         validateAndEnsureAcroFormResources();
         
-        this.defaultAppearance = field.getDefaultAppearanceString();
+        try
+        {
+            this.defaultAppearance = field.getDefaultAppearanceString();
+        }
+        catch (IOException ex)
+        {
+            throw new IOException("Could not process default appearance string '" +
+                                   field.getDefaultAppearance() + "' for field '" +
+                                   field.getFullyQualifiedName() + "'", ex);
+        }
     }
     
     /*
      * Adobe Reader/Acrobat are adding resources which are at the field/widget level
      * to the AcroForm level. 
      */
-    private void validateAndEnsureAcroFormResources() {
+    private void validateAndEnsureAcroFormResources()
+    {
         // add font resources which might be available at the field 
         // level but are not at the AcroForm level to the AcroForm
         // to match Adobe Reader/Acrobat behavior