@@ -148,46 +148,36 @@ public void setAmdProperty(TextType amd)
148148
149149 /**
150150 * Set the PDF/A conformance level
151- *
152- * @param value
153- * The conformance level value to set
154- * @throws BadFieldValueException
155- * If Conformance Value not 'A', 'B' or 'U' (PDF/A-2 and PDF/A-3)
151+ *
152+ * @param value The conformance level value to set
153+ * @throws BadFieldValueException If conformance value not 'A', 'B', 'U' (PDF/A-2 and PDF/A-3),
154+ * 'e', 'f' (PDF/A-4)
156155 */
157156 public void setConformance (String value ) throws BadFieldValueException
158157 {
159- if (value .equals ("A" ) || value .equals ("B" ) || value .equals ("U" ))
160- {
161- TextType conf = createTextType (CONFORMANCE , value );
162- addProperty (conf );
163-
164- }
165- else
166- {
167- throw new BadFieldValueException (
168- "The property given not seems to be a PDF/A conformance level (must be A, B or U)" );
169- }
158+ TextType conf = createTextType (CONFORMANCE , value );
159+ setConformanceProperty (conf );
170160 }
171161
172162 /**
173163 * Set the PDF/A conformance level
174- *
175- * @param conf
176- * The conformance level property to set
177- * @throws BadFieldValueException
178- * If Conformance Value not 'A', 'B' or 'U' (PDF/A-2 and PDF/A-3)
164+ *
165+ * @param conf The conformance level property to set
166+ * @throws BadFieldValueException If conformance value not 'A', 'B', 'U' (PDF/A-2 and PDF/A-3),
167+ * 'e', 'f' (PDF/A-4)
179168 */
180169 public void setConformanceProperty (TextType conf ) throws BadFieldValueException
181170 {
182171 String value = conf .getStringValue ();
183- if (value .equals ("A" ) || value .equals ("B" ) || value .equals ("U" ))
172+ if (value .equals ("A" ) || value .equals ("B" ) || value .equals ("U" ) ||
173+ value .equals ("e" ) || value .equals ("f" ))
184174 {
185175 addProperty (conf );
186176 }
187177 else
188178 {
189179 throw new BadFieldValueException (
190- "The property given not seems to be a PDF/A conformance level (must be A, B or U )" );
180+ "The value '" + value + "' isn't a valid PDF/A conformance level (must be A, B, U, e or f )" );
191181 }
192182 }
193183
0 commit comments