pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1657896 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
Date Fri, 06 Feb 2015 16:53:26 GMT
Author: msahyoun
Date: Fri Feb  6 16:53:25 2015
New Revision: 1657896

URL: http://svn.apache.org/r1657896
Log:
PDFBOX-2045 allow to test for XFA content and kind

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java?rev=1657896&r1=1657895&r2=1657896&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
Fri Feb  6 16:53:25 2015
@@ -410,6 +410,27 @@ public final class PDAcroForm implements
     }
 
     /**
+     * This will tell if the AcroForm has XFA content.
+     *
+     * @return true if the AcroForm is an XFA form
+     */
+    public boolean hasXFA()
+    {
+        return acroForm.containsKey(COSName.XFA);
+    }
+
+    /**
+     * This will tell if the AcroForm is a dynamic XFA form.
+     *
+     * @return true if the AcroForm is a dynamic XFA form
+     */
+    public boolean xfaIsDynamic()
+    {
+        return hasXFA() && getFields().isEmpty();
+    }
+    
+    
+    /**
      * Get the XFA resource, the XFA resource is only used for PDF 1.5+ forms.
      *
      * @return The xfa resource or null if it does not exist.



Mime
View raw message