You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2011/07/24 16:02:33 UTC

svn commit: r1150373 [2/12] - in /pdfbox/trunk/preflight: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/padaf/ src/main/java/org/apache/padaf/preflight/ src/main/java/org/apache/padaf/preflight/a...

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationConstants.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationConstants.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationConstants.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationConstants.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,869 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight;
+
+/**
+ * This interface provide a set of constants which identify validation error.
+ */
+public interface ValidationConstants {
+
+  // -----------------------------------------------------------
+  // ---- CONSTANTS
+  // -----------------------------------------------------------
+  static int EDOC_TOKEN_MGR_ERROR = 255;
+  static String EDOC_TOKEN_MGR_ERROR_TAG = " ERROR_CODE: ";
+  static int MAX_DICT_ENTRIES = 4095;
+  static int MAX_ARRAY_ELEMENTS = 8191;
+  static int MAX_NAME_SIZE = 127;
+  static int MAX_STRING_LENGTH = 65535;
+  static int MAX_INDIRECT_OBJ = 8388607;
+  static int MAX_CID = 65535;
+  static int MAX_GRAPHIC_STATES = 28;
+  static int MAX_DEVICE_N_LIMIT = 8;
+  static float MAX_POSITIVE_FLOAT = 32767f;
+  static float MAX_NEGATIVE_FLOAT = -32767f;
+
+  static String TRAILER_DICTIONARY_KEY_ID = "ID";
+  static String TRAILER_DICTIONARY_KEY_SIZE = "Size";
+  static String TRAILER_DICTIONARY_KEY_PREV = "Prev";
+  static String TRAILER_DICTIONARY_KEY_ROOT = "Root";
+  static String TRAILER_DICTIONARY_KEY_INFO = "Info";
+  static String TRAILER_DICTIONARY_KEY_ENCRYPT = "Encrypt";
+
+  static String DICTIONARY_KEY_ACTION = "A";
+  static String DICTIONARY_KEY_DESTINATION = "Dest";
+  static String DICTIONARY_KEY_ADDITIONAL_ACTION = "AA";
+  static String DICTIONARY_KEY_OPEN_ACTION = "OpenAction";
+
+  static String DOCUMENT_DICTIONARY_KEY_OUTPUT_INTENTS = "OutputIntents";
+  static String DOCUMENT_DICTIONARY_KEY_OPTIONAL_CONTENTS = "OCProperties";
+
+  static String OUTPUT_INTENT_DICTIONARY_KEY_S = "S";
+  static String OUTPUT_INTENT_DICTIONARY_KEY_INFO = "Info";
+  static String OUTPUT_INTENT_DICTIONARY_VALUE_GTS_PDFA1 = "GTS_PDFA1";
+  static String OUTPUT_INTENT_DICTIONARY_KEY_DEST_OUTPUT_PROFILE = "DestOutputProfile";
+  static String OUTPUT_INTENT_DICTIONARY_KEY_OUTPUT_CONDITION_IDENTIFIER = "OutputConditionIdentifier";
+  static String OUTPUT_INTENT_DICTIONARY_VALUE_OUTPUT_CONDITION_IDENTIFIER_CUSTOM = "Custom";
+
+  static String TRANPARENCY_DICTIONARY_KEY_EXTGSTATE = "ExtGState";
+  static String TRANPARENCY_DICTIONARY_KEY_EXTGSTATE_ENTRY_REGEX = "(GS|gs)([0-9])+";
+
+  static String TRANSPARENCY_DICTIONARY_KEY_BLEND_MODE = "BM";
+  static String TRANSPARENCY_DICTIONARY_KEY_UPPER_CA = "CA";
+  static String TRANSPARENCY_DICTIONARY_KEY_LOWER_CA = "ca";
+  static String TRANSPARENCY_DICTIONARY_KEY_SOFT_MASK = "SMask";
+  static String TRANSPARENCY_DICTIONARY_VALUE_SOFT_MASK_NONE = "None";
+  static String TRANSPARENCY_DICTIONARY_VALUE_BM_NORMAL = "Normal";
+  static String TRANSPARENCY_DICTIONARY_VALUE_BM_COMPATIBLE = "Compatible";
+
+  static String DICTIONARY_KEY_LINEARIZED = "Linearized";
+  static String DICTIONARY_KEY_LINEARIZED_L = "L";
+  static String DICTIONARY_KEY_LINEARIZED_H = "H";
+  static String DICTIONARY_KEY_LINEARIZED_O = "O";
+  static String DICTIONARY_KEY_LINEARIZED_E = "E";
+  static String DICTIONARY_KEY_LINEARIZED_N = "N";
+  static String DICTIONARY_KEY_LINEARIZED_T = "T";
+  static String DICTIONARY_KEY_TYPE = "Type";
+  static String DICTIONARY_KEY_SUBTYPE = "Subtype";
+
+  static String DICTIONARY_KEY_XOBJECT = "XObject";
+  static String DICTIONARY_KEY_PATTERN = "Pattern";
+  static String DICTIONARY_KEY_FONT = "Font";
+
+  static String DICTIONARY_KEY_PATTERN_TYPE = "PatternType";
+  static int DICTIONARY_PATTERN_TILING = 1;
+  static int DICTIONARY_PATTERN_SHADING = 2;
+
+  static String PATTERN_KEY_PAINT_TYPE = "PaintType";
+  static String PATTERN_KEY_TILING_TYPE = "TilingType";
+  static String PATTERN_KEY_BBOX = "BBox";
+  static String PATTERN_KEY_XSTEP = "XStep";
+  static String PATTERN_KEY_YSTEP = "YStep";
+  static String PATTERN_KEY_SHADING = "Shading";
+  static String PATTERN_KEY_SHADING_TYPE = "ShadingType";
+
+  static String XOBJECT_DICTIONARY_VALUE_SUBTYPE_IMG = "Image";
+  static String XOBJECT_DICTIONARY_VALUE_SUBTYPE_FORM = "Form";
+  static String XOBJECT_DICTIONARY_KEY_COLOR_SPACE = "ColorSpace";
+  static final String XOBJECT_DICTIONARY_VALUE_SUBTYPE_POSTSCRIPT = "PS";
+  static String XOBJECT_DICTIONARY_KEY_BBOX = "BBox";
+  static String XOBJECT_DICTIONARY_KEY_GROUP = "Group";
+  static String XOBJECT_DICTIONARY_KEY_GROUP_S = "S";
+  static String XOBJECT_DICTIONARY_VALUE_S_TRANSPARENCY = "Transparency";
+
+  static String FONT_DICTIONARY_VALUE_FONT = "Font";
+  static String FONT_DICTIONARY_VALUE_COMPOSITE = "Type0";
+  static String FONT_DICTIONARY_VALUE_TRUETYPE = "TrueType";
+  static String FONT_DICTIONARY_VALUE_TYPE1 = "Type1";
+  static String FONT_DICTIONARY_VALUE_TYPE1C = "Type1C";
+  static String FONT_DICTIONARY_VALUE_MMTYPE = "MMType1";
+  static String FONT_DICTIONARY_VALUE_TYPE3 = "Type3";
+  static String FONT_DICTIONARY_VALUE_TYPE0 = "CIDFontType0";
+  static String FONT_DICTIONARY_VALUE_TYPE0C = "CIDFontType0C";
+  static String FONT_DICTIONARY_VALUE_TYPE2 = "CIDFontType2";
+  static String FONT_DICTIONARY_VALUE_ENCODING_MAC = "MacRomanEncoding";
+  static String FONT_DICTIONARY_VALUE_ENCODING_MAC_EXP = "MacExpertEncoding";
+  static String FONT_DICTIONARY_VALUE_ENCODING_WIN = "WinAnsiEncoding";
+  static String FONT_DICTIONARY_VALUE_ENCODING_STD = "StandardEncoding";
+  static String FONT_DICTIONARY_VALUE_ENCODING_PDFDOC = "PDFDocEncoding";
+
+  static String FONT_DICTIONARY_VALUE_ENCODING = "Encoding";
+  static String FONT_DICTIONARY_VALUE_CMAP_IDENTITY_H = "Identity-H";
+  static String FONT_DICTIONARY_VALUE_CMAP_IDENTITY_V = "Identity-V";
+  static String FONT_DICTIONARY_VALUE_CMAP_IDENTITY = "Identity";
+  static String FONT_DICTIONARY_VALUE_TYPE_CMAP = "CMap";
+
+  static String FONT_DICTIONARY_KEY_NAME = "Name";
+  static String FONT_DICTIONARY_KEY_BASEFONT = "BaseFont";
+  static String FONT_DICTIONARY_KEY_FIRSTCHAR = "FirstChar";
+  static String FONT_DICTIONARY_KEY_LASTCHAR = "LastChar";
+  static String FONT_DICTIONARY_KEY_WIDTHS = "Widths";
+  static String FONT_DICTIONARY_KEY_FONT_DESC = "FontDescriptor";
+  static String FONT_DICTIONARY_KEY_ENCODING = "Encoding";
+  static String FONT_DICTIONARY_KEY_TOUNICODE = "ToUnicode";
+  static String FONT_DICTIONARY_KEY_FONTNAME = "FontName";
+  static String FONT_DICTIONARY_KEY_FLAGS = "Flags";
+  static String FONT_DICTIONARY_KEY_ITALICANGLE = "ItalicAngle";
+  static String FONT_DICTIONARY_KEY_FONTBBOX = "FontBBox";
+  static String FONT_DICTIONARY_KEY_FONTMATRIX = "FontMatrix";
+  static String FONT_DICTIONARY_KEY_CHARPROCS = "CharProcs";
+  static String DICTIONARY_KEY_RESOURCES = "Resources";
+  static String FONT_DICTIONARY_KEY_ASCENT = "Ascent";
+  static String FONT_DICTIONARY_KEY_DESCENT = "Descent";
+  static String FONT_DICTIONARY_KEY_CAPHEIGHT = "CapHeight";
+  static String FONT_DICTIONARY_KEY_STEMV = "StemV";
+  static String FONT_DICTIONARY_KEY_LENGTH1 = "Length1";
+  static String FONT_DICTIONARY_KEY_LENGTH2 = "Length2";
+  static String FONT_DICTIONARY_KEY_LENGTH3 = "Length3";
+  static String FONT_DICTIONARY_KEY_METADATA = "Metadata";
+  static String FONT_DICTIONARY_KEY_BASEENCODING = "BaseEncoding";
+  static String FONT_DICTIONARY_KEY_DIFFERENCES = "Differences";
+  static String FONT_DICTIONARY_KEY_DESCENDANT_FONTS = "DescendantFonts";
+  static String FONT_DICTIONARY_KEY_CID_SYSINFO = "CIDSystemInfo";
+  static String FONT_DICTIONARY_KEY_CID_GIDMAP = "CIDToGIDMap";
+  static String FONT_DICTIONARY_KEY_SYSINFO_REGISTRY = "Registry";
+  static String FONT_DICTIONARY_KEY_SYSINFO_ORDERING = "Ordering";
+  static String FONT_DICTIONARY_KEY_SYSINFO_SUPPLEMENT = "Supplement";
+  static String FONT_DICTIONARY_KEY_CMAP_NAME = "CMapName";
+  static String FONT_DICTIONARY_KEY_CMAP_WMODE = "WMode";
+  static String FONT_DICTIONARY_KEY_CMAP_USECMAP = "UseCMap";
+  static String FONT_DICTIONARY_KEY_CIDSET = "CIDSet";
+
+  static String STREAM_DICTIONARY_KEY_LENGHT = "Length";
+  static String STREAM_DICTIONARY_KEY_FILTER = "Filter";
+  static String STREAM_DICTIONARY_KEY_DECODEPARAMS = "DecodeParms";
+  static String STREAM_DICTIONARY_KEY_F = "F";
+  static String STREAM_DICTIONARY_KEY_FFILTER = "FFilter";
+  static String STREAM_DICTIONARY_KEY_FDECODEPARAMS = "FDecodeParms";
+  static String STREAM_DICTIONARY_KEY_COLOR_SPACE = "CS";
+
+  static String STREAM_DICTIONARY_VALUE_FILTER_LZW = "LZWDecode";
+
+  static String STREAM_DICTIONARY_VALUE_FILTER_ASCII_HEX = "ASCIIHexDecode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_ASCII_85 = "ASCII85Decode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_RUN = "RunLengthDecode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_CCITTFF = "CCITTFaxDecode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_JBIG = "JBIG2Decode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_DCT = "DCTDecode";
+  static String STREAM_DICTIONARY_VALUE_FILTER_FLATE_DECODE = "FlateDecode";
+
+  static String FILE_SPECIFICATION_VALUE_TYPE = "Filespec";
+  static String FILE_SPECIFICATION_KEY_EMBEDDED_FILE = "EF";
+
+  static String INLINE_DICTIONARY_VALUE_FILTER_LZW = "LZW";
+
+  static String INLINE_DICTIONARY_VALUE_FILTER_ASCII_HEX = "AHx";
+  static String INLINE_DICTIONARY_VALUE_FILTER_ASCII_85 = "A85";
+  static String INLINE_DICTIONARY_VALUE_FILTER_RUN = "RL";
+  static String INLINE_DICTIONARY_VALUE_FILTER_CCITTFF = "CCF";
+  static String INLINE_DICTIONARY_VALUE_FILTER_DCT = "DCT";
+  static String INLINE_DICTIONARY_VALUE_FILTER_FLATE_DECODE = "Fl";
+  
+  static String ANNOT_DICTIONARY_KEY_CONTENTS = "Contents";
+  static String ANNOT_DICTIONARY_KEY_RECT = "Rect";
+  static String ANNOT_DICTIONARY_KEY_CA = "CA";
+  static String ANNOT_DICTIONARY_KEY_DA = "DA";
+  static String ANNOT_DICTIONARY_KEY_QUADPOINTS = "QuadPoints";
+  static String ANNOT_DICTIONARY_KEY_L = "L";
+  static String ANNOT_DICTIONARY_KEY_F = "F";
+  static String ANNOT_DICTIONARY_KEY_C = "C";
+  static String ANNOT_DICTIONARY_KEY_N = "N";
+  static String ANNOT_DICTIONARY_KEY_D = "D";
+  static String ANNOT_DICTIONARY_KEY_R = "R";
+  static String ANNOT_DICTIONARY_KEY_INKLIST = "InkList";
+
+  static String ANNOT_DICTIONARY_VALUE_TYPE = "Annot";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_TEXT = "Text";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_LINK = "Link";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_FREETEXT = "FreeText";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_LINE = "Line";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUARE = "Square";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_CIRCLE = "Circle";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_HIGHLIGHT = "Highlight";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_UNDERLINE = "Underline";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUILGGLY = "Squiggly";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_STRIKEOUT = "StrikeOut";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_STAMP = "Stamp";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_INK = "Ink";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_POPUP = "Popup";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_WIDGET = "Widget";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_PRINTERMARK = "PrinterMark";
+  static String ANNOT_DICTIONARY_VALUE_SUBTYPE_TRAPNET = "TrapNet";
+
+  static String ACTION_DICTIONARY_VALUE_TYPE = "Action";
+  static String ACTION_DICTIONARY_KEY_S = "S";
+  static String ACTION_DICTIONARY_KEY_N = "N";
+  static String ACTION_DICTIONARY_KEY_T = "T";
+  static String ACTION_DICTIONARY_KEY_H = "H";
+  static String ACTION_DICTIONARY_KEY_D = "D";
+  static String ACTION_DICTIONARY_KEY_F = "F";
+  static String ACTION_DICTIONARY_KEY_URI = "URI";
+  static String ACTION_DICTIONARY_KEY_NEXT = "Next";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_GOTO = "GoTo";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_GOTOR = "GoToR";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_THREAD = "Thread";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_URI = "URI";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_HIDE = "Hide";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NAMED = "Named";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_SUBMIT = "SubmitForm";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_LAUNCH = "Launch";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_SOUND = "Sound";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_MOVIE = "Movie";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_RESET = "ResetForm";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_IMPORT = "ImportData";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_JAVASCRIPT = "JavaScript";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_SETSTATE = "SetState";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NOOP = "NOP";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NAMED_NEXT = "NextPage";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NAMED_PREV = "PrevPage";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NAMED_FIRST = "FirstPage";
+  static String ACTION_DICTIONARY_VALUE_ATYPE_NAMED_LAST = "LastPage";
+
+  static String ACROFORM_DICTIONARY_KEY_NEED_APPEARANCES = "NeedAppearances";
+
+  static final String RENDERING_INTENT_REL_COLOR = "RelativeColorimetric";
+  static final String RENDERING_INTENT_ABS_COLOR = "AbsoluteColorimetric";
+  static final String RENDERING_INTENT_PERCEPTUAL = "Perceptual";
+  static final String RENDERING_INTENT_SATURATION = "Saturation";
+
+  /**
+   * Error code uses by the Valdiator when there are an error without error
+   * code.
+   */
+  static final String ERROR_UNKOWN_ERROR = "-1";
+
+  // -----------------------------------------------------------
+  // ---- FILE STRUCTURE ERRORS 1.x...
+  // -----------------------------------------------------------
+
+  /**
+   * Error code for syntax error
+   */
+  static final String ERROR_SYNTAX_MAIN = "1";
+  // error code category which can occur in each pdf part
+  static final String ERROR_SYNTAX_COMMON = "1.0";
+  /**
+   * Too many entries in a dictionary object
+   */
+  static final String ERROR_SYNTAX_TOO_MANY_ENTRIES = "1.0.1";
+  /**
+   * Too many element in an array object
+   */
+  static final String ERROR_SYNTAX_ARRAY_TOO_LONG = "1.0.2";
+  /**
+   * The name length is too long
+   */
+  static final String ERROR_SYNTAX_NAME_TOO_LONG = "1.0.3";
+  /**
+   * The literal string is too long
+   */
+  static final String ERROR_SYNTAX_LITERAL_TOO_LONG = "1.0.4";
+  /**
+   * The hexa string is too long
+   */
+  static final String ERROR_SYNTAX_HEXA_STRING_TOO_LONG = "1.0.5";
+  /**
+   * The number is out of Range ( ex : greatter than 2^31-1)
+   */
+  static final String ERROR_SYNTAX_NUMERIC_RANGE = "1.0.6";
+  /**
+   * A dictionary key isn't a name
+   */
+  static final String ERROR_SYNTAX_DICTIONARY_KEY_INVALID = "1.0.7";
+  /**
+   * The language declared doesn't match with the RFC1766
+   */
+  static final String ERROR_SYNTAX_LANG_NOT_RFC1766 = "1.0.8";
+  /**
+   * There are too many objects
+   */
+  static final String ERROR_SYNTAX_INDIRECT_OBJ_RANGE = "1.0.9";
+  /**
+   * CID too long
+   */
+  static final String ERROR_SYNTAX_CID_RANGE = "1.0.10";
+  
+  static final String ERROR_SYNTAX_HEADER = "1.1";
+  static final String ERROR_SYNTAX_HEADER_FIRST_CHAR = "1.1.1";
+  static final String ERROR_SYNTAX_HEADER_FILE_TYPE = "1.1.2";
+
+  /**
+   * Common error about body syntax
+   */
+  static final String ERROR_SYNTAX_BODY = "1.2";
+  /**
+   * Error on the object delimiters (obj / endobj)
+   */
+  static final String ERROR_SYNTAX_OBJ_DELIMITER = "1.2.1";
+  /**
+   * Error on the stream delimiters (stream / endstream)
+   */
+  static final String ERROR_SYNTAX_STREAM_DELIMITER = "1.2.2";
+  /**
+   * Required fields are missing from the dictionary
+   */
+  static final String ERROR_SYNTAX_DICT_INVALID = "1.2.3";
+  /**
+   * The length entry is missing from the stream dictionary
+   */
+  static final String ERROR_SYNTAX_STREAM_LENGTH_MISSING = "1.2.4";
+  /**
+   * The length of the stream dictionary and the stream length is inconsistent
+   */
+  static final String ERROR_SYNTAX_STREAM_LENGTH_INVALID = "1.2.5";
+  /**
+   * F or/and FFilter or/and FDecodeParams are present in a stream dictionary
+   */
+  static final String ERROR_SYNTAX_STREAM_FX_KEYS = "1.2.6";
+  /**
+   * The stream uses an invalid filter (The LZW)
+   */
+  static final String ERROR_SYNTAX_STREAM_INVALID_FILTER = "1.2.7";
+  /**
+   * The stream uses a filter which isn't defined in the PDF Reference document. 
+   */
+  static final String ERROR_SYNTAX_STREAM_UNDEFINED_FILTER = "1.2.12";
+  /**
+   * The content stream has some syntax errors
+   */
+  static final String ERROR_SYNTAX_CONTENT_STREAM_INVALID = "1.2.8";
+  /**
+   * EmbeddedFile entry is present in a FileSpecification dictionary
+   */
+  static final String ERROR_SYNTAX_EMBEDDED_FILES = "1.2.9";
+  /**
+   * The content stream uses an unsupported operator
+   */
+  static final String ERROR_SYNTAX_CONTENT_STREAM_UNSUPPORTED_OP = "1.2.10";
+  /**
+   * The content stream contains an invalid argument for the operator
+   */
+  static final String ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT = "1.2.11";
+  /**
+   * Common error about the cross ref table
+   */
+  static final String ERROR_SYNTAX_CROSS_REF = "1.3";
+  /**
+   * Common error about the trailer
+   */
+  static final String ERROR_SYNTAX_TRAILER = "1.4";
+  /**
+   * ID is missing from the trailer
+   */
+  static final String ERROR_SYNTAX_TRAILER_MISSING_ID = "1.4.1";
+  /**
+   * Encrypt is forbidden
+   */
+  static final String ERROR_SYNTAX_TRAILER_ENCRYPT = "1.4.2";
+  /**
+   * An trailer entry has an invalid type
+   */
+  static final String ERROR_SYNTAX_TRAILER_TYPE_INVALID = "1.4.3";
+  /**
+   * Size is missing from the trailer
+   */
+  static final String ERROR_SYNTAX_TRAILER_MISSING_SIZE = "1.4.4";
+  /**
+   * Root is missing from the trailer
+   */
+  static final String ERROR_SYNTAX_TRAILER_MISSING_ROOT = "1.4.5";
+  /**
+   * ID in 1st trailer and the last is different
+   */
+  static final String ERROR_SYNTAX_TRAILER_ID_CONSISTENCY = "1.4.6";
+  /**
+   * EmbeddedFile entry is present in the Names dictionary
+   */
+  static final String ERROR_SYNTAX_TRAILER_CATALOG_EMBEDDEDFILES = "1.4.7";
+  /**
+   * Optional content is forbidden
+   */
+  static final String ERROR_SYNTAX_TRAILER_CATALOG_OCPROPERTIES = "1.4.8";
+  /**
+   * Errors in the Outlines dictionary
+   */
+  static final String ERROR_SYNTAX_TRAILER_OUTLINES_INVALID = "1.4.9";
+
+  // -----------------------------------------------------------
+  // ---- GRAPHIC ERRORS 2.x...
+  // -----------------------------------------------------------
+
+  /**
+   * Main error code for graphical problems
+   */
+  static final String ERROR_GRAPHIC_MAIN = "2";
+  static final String ERROR_GRAPHIC_INVALID = "2.1";
+  /**
+   * BBox Entry of a Form XObject is missing or isn't an Array
+   */
+  static final String ERROR_GRAPHIC_INVALID_BBOX = "2.1.1";
+  /**
+   * The OutputIntent dictionary is invalid
+   */
+  static final String ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY = "2.1.2";
+  /**
+   * The S entry of the OutputIntent isn't GTS_PDFA1
+   */
+  static final String ERROR_GRAPHIC_OUTPUT_INTENT_S_VALUE_INVALID = "2.1.3";
+  /**
+   * The ICC Profile is invalid
+   */
+  static final String ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_INVALID = "2.1.4";
+  /**
+   * There are more than one ICC Profile
+   */
+  static final String ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_MULTIPLE = "2.1.5";
+
+  /**
+   * Profile version is too recent for PDF 1.4 document
+   */
+  static final String ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_TOO_RECENT = "2.1.6";
+
+  static final String ERROR_GRAPHIC_MISSING_FIELD = "2.1.7";
+
+  static final String ERROR_GRAPHIC_TOO_MANY_GRAPHIC_STATES = "2.1.8";
+  
+  /**
+   * Main error code for graphical transparency problems
+   */
+  static final String ERROR_GRAPHIC_TRANSPARENCY = "2.2";
+  /**
+   * A Group entry with S = Transparency is used or the S = Null
+   */
+  static final String ERROR_GRAPHIC_TRANSPARENCY_GROUP = "2.2.1";
+  /**
+   * A XObject SMask value isn't None
+   */
+  static final String ERROR_GRAPHIC_TRANSPARENCY_SMASK = "2.2.2";
+
+  /**
+   * A XObject has an unexpected key defined
+   */
+  static final String ERROR_GRAPHIC_UNEXPECTED_KEY = "2.3";
+
+  /**
+   * A XObject has an unexpected value for a defined key
+   */
+  static final String ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY = "2.3.2";
+
+  /**
+   * An invalid color space is used
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE = "2.4";
+  /**
+   * RGB color space used in the PDF file but the DestOutputProfile isn't RGB
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_RGB = "2.4.1";
+  /**
+   * CMYK color space used in the PDF file but the DestOutputProfile isn't CMYK
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_CMYK = "2.4.2";
+  /**
+   * color space used in the PDF file but the DestOutputProfile is missing
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_MISSING = "2.4.3";
+  /**
+   * Unknown ColorSpace
+   */
+  static final String ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE = "2.4.4";
+  /**
+   * The pattern color space can't be used
+   */
+  static final String ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN = "2.4.5";
+  /**
+   * The pattern is invalid due to missing key or invalid value
+   */
+  static final String ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION = "2.4.6";
+  /**
+   * alternate color space used in the PDF file but the DestOutputProfile isn't
+   * consistent
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_ALTERNATE = "2.4.7";
+  /**
+   * Base ColorSpace in the Indexed color space is invalid
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_INDEXED = "2.4.8";
+  /**
+   * ColorSpace is forbidden due to some restriction (ex : Only DeviceXXX are
+   * auth in inlined image)
+   */
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_FORBIDDEN = "2.4.9";
+  
+  static final String ERROR_GRAPHIC_INVALID_COLOR_SPACE_TOO_MANY_COMPONENTS_DEVICEN = "2.4.10";
+
+  // -----------------------------------------------------------
+  // ---- FONT ERRORS 3.x...
+  // -----------------------------------------------------------
+
+  /**
+   * Main error code for font problems
+   */
+  static final String ERROR_FONTS_MAIN = "3";
+
+  static final String ERROR_FONTS_INVALID_DATA = "3.1";
+  /**
+   * Some mandatory fields are missing from the FONT Dictionary
+   */
+  static final String ERROR_FONTS_DICTIONARY_INVALID = "3.1.1";
+  /**
+   * Some mandatory fields are missing from the FONT Descriptor Dictionary
+   */
+  static final String ERROR_FONTS_DESCRIPTOR_INVALID = "3.1.2";
+  /**
+   * Error on the "Font File x" in the Font Descriptor (ex : FontFile and
+   * FontFile2 are present in the same dictionary)
+   */
+  static final String ERROR_FONTS_FONT_FILEX_INVALID = "3.1.3";
+  /**
+   * Charset declaration is missing in a Type 1 Subset
+   */
+  static final String ERROR_FONTS_CHARSET_MISSING_FOR_SUBSET = "3.1.4";
+  /**
+   * Encoding is inconsistent with the Font (ex : Symbolic TrueType mustn't
+   * declare encoding)
+   */
+  static final String ERROR_FONTS_ENCODING = "3.1.5";
+  /**
+   * Width array and Font program Width are inconsistent
+   */
+  static final String ERROR_FONTS_METRICS = "3.1.6";
+  /**
+   * Required entry in a Composite Font dictionary is missing
+   */
+  static final String ERROR_FONTS_CIDKEYED_INVALID = "3.1.7";
+  /**
+   * The CIDSystemInfo dictionary is invalid
+   */
+  static final String ERROR_FONTS_CIDKEYED_SYSINFO = "3.1.8";
+  /**
+   * The CIDToGID is invalid
+   */
+  static final String ERROR_FONTS_CIDKEYED_CIDTOGID = "3.1.9";
+  /**
+   * The CMap of the Composite Font is missing or invalid
+   */
+  static final String ERROR_FONTS_CIDKEYED_CMAP_INVALID_OR_MISSING = "3.1.10";
+  /**
+   * The CIDSet entry i mandatory from a subset of composite font
+   */
+  static final String ERROR_FONTS_CIDSET_MISSING_FOR_SUBSET = "3.1.11";
+  /**
+   * The CMap of the Composite Font is missing or invalid
+   */
+  static final String ERROR_FONTS_ENCODING_ERROR = "3.1.12";
+  /**
+   * Encoding entry can't be read due to IOException
+   */
+  static final String ERROR_FONTS_ENCODING_IO = "3.1.13";
+  /**
+   * The embedded font is damaged
+   */
+  static final String ERROR_FONTS_DAMAGED = "3.2";
+  /**
+   * The embedded Type1 font is damaged
+   */
+  static final String ERROR_FONTS_TYPE1_DAMAGED = "3.2.1";
+  /**
+   * The embedded TrueType font is damaged
+   */
+  static final String ERROR_FONTS_TRUETYPE_DAMAGED = "3.2.2";
+  /**
+   * The embedded composite font is damaged
+   */
+  static final String ERROR_FONTS_CID_DAMAGED = "3.2.3";
+  /**
+   * The embedded type 3 font is damaged
+   */
+  static final String ERROR_FONTS_TYPE3_DAMAGED = "3.2.4";
+  /**
+   * The embedded CID Map is damaged
+   */
+  static final String ERROR_FONTS_CID_CMAP_DAMAGED = "3.2.5";
+
+  /**
+   * Common error for a Glyph problem
+   */
+  static final String ERROR_FONTS_GLYPH = "3.3";
+  /**
+   * a glyph is missing
+   */
+  static final String ERROR_FONTS_GLYPH_MISSING = "3.3.1";
+  /**
+   * a glyph is missing
+   */
+  static final String ERROR_FONTS_UNKNOWN_FONT_REF = "3.3.2";
+
+  // -----------------------------------------------------------
+  // ---- TRANSPARENCY ERRORS 4.x...
+  // -----------------------------------------------------------
+  static final String ERROR_TRANSPARENCY_MAIN = "4";
+  /**
+   * Common transparency error
+   */
+  static final String ERROR_TRANSPARENCY_EXT_GRAPHICAL_STATE = "4.1";
+  /**
+   * Soft mask entry is present but is forbidden
+   */
+  static final String ERROR_TRANSPARENCY_EXT_GS_SOFT_MASK = "4.1.1";
+  /**
+   * Ca or/and ca entry are present but the value isn't 1.0
+   */
+  static final String ERROR_TRANSPARENCY_EXT_GS_CA = "4.1.2";
+  /**
+   * BlendMode value isn't valid (only Normal and Compatible are authorized)
+   */
+  static final String ERROR_TRANSPARENCY_EXT_GS_BLEND_MODE = "4.1.3";
+
+  // -----------------------------------------------------------
+  // ---- ANNOTATION ERRORS 5.x...
+  // -----------------------------------------------------------
+  static final String ERROR_ANNOT_MAIN = "5";
+  /**
+   * Common missing field error in annotation dictionary
+   */
+  static final String ERROR_ANNOT_MISSING_FIELDS = "5.1";
+  /**
+   * The subtype entry is missing from the annotation dictionary
+   */
+  static final String ERROR_ANNOT_MISSING_SUBTYPE = "5.1.1";
+  /**
+   * The AP dictionary of the annotation contains forbidden/invalid entries
+   * (only the N entry is authorized)
+   */
+  static final String ERROR_ANNOT_MISSING_AP_N_CONTENT = "5.1.2";
+
+  /**
+   * Common forbidden field error in annotation dictionary
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_ELEMENT = "5.2";
+  /**
+   * This type of annotation is forbidden (ex : Movie)
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_SUBTYPE = "5.2.1";
+  /**
+   * The annotation uses a flag which is forbidden.
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_FLAG = "5.2.2";
+  /**
+   * Annotation uses a Color profile which isn't the same than the profile
+   * contained by the OutputIntent
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_COLOR = "5.2.3";
+  /**
+   * Dest entry can't be used if the A element is used too
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_DEST = "5.2.4";
+  /**
+   * The AA field is forbidden for the Widget annotation when the PDF is a PDF/A
+   */
+  static final String ERROR_ANNOT_FORBIDDEN_AA = "5.2.5";
+  /**
+   * The annotation uses a flag which is not recommended but not forbidden by
+   * the ISO 19005-1:2005.
+   */
+  static final String ERROR_ANNOT_NOT_RECOMMENDED_FLAG = "5.2.6";
+
+  /**
+   * Common Invalid field error in annotation dictionary
+   */
+  static final String ERROR_ANNOT_INVALID_ELEMENT = "5.3";
+  /**
+   * The AP dictionary of the annotation contains forbidden/invalid entries
+   * (only the N entry is authorized)
+   */
+  static final String ERROR_ANNOT_INVALID_AP_CONTENT = "5.3.1";
+  /**
+   * Ca or/and ca entry are present but the value isn't 1.0
+   */
+  static final String ERROR_ANNOT_INVALID_CA = "5.3.2";
+  /**
+   * Dest entry of an annotation can't be checked due to an IO Exception
+   */
+  static final String ERROR_ANNOT_INVALID_DEST = "5.3.3";
+
+  // -----------------------------------------------------------
+  // ---- ACTION ERRORS 6.x...
+  // -----------------------------------------------------------
+  static final String ERROR_ACTION_MAIN = "6";
+
+  /**
+   * Common invalid action error
+   */
+  static final String ERROR_ACTION_INVALID_ACTIONS = "6.1";
+  /**
+   * A mandatory entry in the action dictionary is missing
+   */
+  static final String ERROR_ACTION_MISING_KEY = "6.1.1";
+  /**
+   * Some elements of the annotation dictionary have an invalid type (ex : array
+   * instead of Dictionary)
+   */
+  static final String ERROR_ACTION_INVALID_TYPE = "6.1.3";
+  /**
+   * The H entry of a Hide action is set to true (so some annotation can be
+   * hide)
+   */
+  static final String ERROR_ACTION_HIDE_H_INVALID = "6.1.4";
+  /**
+   * Common forbidden action error
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ACTIONS = "6.2";
+  /**
+   * Named action other than predefined not allowed
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ACTIONS_NAMED = "6.2.1";
+  /**
+   * Additional action entry is forbidden
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTION = "6.2.2";
+  /**
+   * Additional action entry is forbidden in a form field object
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTIONS_FIELD = "6.2.3";
+  /**
+   * A widget annotation linked with a form field shall not have any action
+   */
+  static final String ERROR_ACTION_FORBIDDEN_WIDGET_ACTION_FIELD = "6.2.4";
+  /**
+   * An explicitly forbidden action is used in the PDF file.
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ACTIONS_EXPLICITLY_FORBIDDEN = "6.2.5";
+  /**
+   * Actions is rejected if it isn't defined in the PDF Reference Third Edition
+   * This is to avoid not consistent file due to new features of the PDF format.
+   */
+  static final String ERROR_ACTION_FORBIDDEN_ACTIONS_UNDEF = "6.2.6";
+  // -----------------------------------------------------------
+  // ---- METADATA ERRORS 7.x...
+  // -----------------------------------------------------------
+  /**
+   * Main metadata error code
+   */
+  static final String ERROR_METADATA_MAIN = "7";
+
+  /**
+   * Invalid metadata found
+   */
+  static final String ERROR_METADATA_FORMAT = "7.1";
+
+  /**
+   * Unknown metadata
+   */
+  static final String ERROR_METADATA_PROPERTY_UNKNOWN = "7.1.1";
+
+  /**
+   * Invalid xmp metadata format
+   */
+  static final String ERROR_METADATA_PROPERTY_FORMAT = "7.1.2";
+
+  /**
+   * Metadata mismatch between PDF Dictionnary and xmp
+   */
+  static final String ERROR_METADATA_MISMATCH = "7.2";
+
+  /**
+   * Invalid information in xpacket processing instruction
+   */
+  static final String ERROR_METADATA_XPACKET_DEPRECATED = "7.0.0";
+
+  /**
+   * Description schema required not embedded
+   */
+  static final String ERROR_METADATA_ABSENT_DESCRIPTION_SCHEMA = "7.3";
+
+  /**
+   * A required namespace URI missing
+   */
+  static final String ERROR_METADATA_NS_URI_MISSING = "7.4";
+
+  /**
+   * A namespace URI has an unexpected value
+   */
+  static final String ERROR_METADATA_WRONG_NS_URI = "7.4.1";
+
+  /**
+   * A namespace prefix has an unexpected value
+   */
+  static final String ERROR_METADATA_WRONG_NS_PREFIX = "7.4.2";
+
+  /**
+   * Required property is missing
+   */
+  static final String ERROR_METADATA_PROPERTY_MISSING = "7.5";
+
+  /**
+   * A valueType is used but is not declared
+   */
+  static final String ERROR_METADATA_UNKNOWN_VALUETYPE = "7.6";
+
+  /**
+   * PDF/A Identification Schema not found
+   */
+  static final String ERROR_METADATA_PDFA_ID_MISSING = "7.11";
+
+  /**
+   * PDF/A Identification Conformance Invalid
+   */
+  static final String ERROR_METADATA_INVALID_PDFA_CONFORMANCE = "7.11.1";
+
+  /**
+   * PDF/A Identification Version Identifier Invalid (pdfaid:part)
+   */
+  static final String ERROR_METADATA_INVALID_PDFA_VERSION_ID = "7.11.2";
+
+  /**
+   * rdf:about is missing
+  */
+  static final String ERROR_METADATA_RDF_ABOUT_ATTRIBUTE_MISSING="7.0";
+	
+	
+  /**
+  * One of rdf:about attribute embedded in RDF:rdf have a different value than the others
+  */
+  static final String ERROR_METADATA_RDF_ABOUT_ATTRIBUTE_INEQUAL_VALUE="7.0.1";
+
+  /**
+  * a category has an invalid value in one property description (must be internal or external)
+  */
+  static final String ERROR_METADATA_CATEGORY_PROPERTY_INVALID="7.5.1";
+
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationException.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationException.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationException.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationException.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight;
+
+public class ValidationException extends Exception {
+
+  /**
+   * serial version number
+   */
+  private static final long serialVersionUID = -1616141241190424669L;
+
+  public ValidationException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public ValidationException(String message) {
+    super(message);
+  }
+
+  public ValidationException(Throwable cause) {
+    super(cause);
+  }
+
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationResult.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationResult.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationResult.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationResult.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,267 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+import org.apache.padaf.preflight.utils.COSUtils;
+import org.apache.padaf.xmpbox.XMPMetadata;
+import org.apache.pdfbox.pdmodel.PDDocument;
+
+/**
+ * Object returned by the validate method of the PDFValidator. This object
+ * contains a boolean to know if the PDF is PDF/A-1<I>x</I> compliant. If the
+ * document isn't PDF/A-1<I>x</I> a list of errors is provided.
+ */
+public class ValidationResult {
+	/**
+	 * Boolean to know if the PDF is a valid PDF/A
+	 */
+	private boolean isValid = false;
+
+	/**
+	 * Errors to know why the PDF isn't valid. If the PDF is valid, this list is
+	 * empty.
+	 */
+	private List<ValidationError> lErrors = new ArrayList<ValidationError>();
+
+	/**
+	 * Object representation of the PDF file.
+	 * This object has to be closed explicitly by the user using the
+	 * close method of the ValidationResult object or directly by the 
+	 * close method of the PDDocument object.
+	 * 
+	 * This attribute can be null if the Validation fails during the 
+	 * validation of the document syntax using the PDFParser object.
+	 */
+	private PDDocument pdf = null;
+
+	/**
+	 * Object representation of the XMPMetaData contained by the pdf file
+	 * This attribute can be null if the Validation fails.
+	 */
+	private XMPMetadata xmpMetaData = null;
+
+	/**
+	 * Create a Validation result object
+	 * 
+	 * @param isValid
+	 */
+	public ValidationResult(boolean isValid) {
+		this.isValid = isValid;
+	}
+
+	/**
+	 * Create a Validation Result object. This constructor force the isValid to
+	 * false and add the given error to the list or ValidationErrors.
+	 * 
+	 * @param error
+	 *          if error is null, no error is added to the list.
+	 */
+	public ValidationResult(ValidationError error) {
+		this.isValid = false;
+		if (error != null) {
+			this.lErrors.add(error);
+		}
+	}
+
+	/**
+	 * Create a Validation Result object. This constructor force the isValid to
+	 * false and add all the given errors to the list or ValidationErrors.
+	 * 
+	 * @param error
+	 *          if error is null, no error is added to the list.
+	 */
+	public ValidationResult(List<ValidationError> errors) {
+		this.isValid = false;
+		this.lErrors = errors;
+	}
+
+	/**
+	 * @return the xmpMetaData
+	 */
+	public XMPMetadata getXmpMetaData() {
+		return xmpMetaData;
+	}
+
+	/**
+	 * @param xmpMetaData the xmpMetaData to set
+	 */
+	void setXmpMetaData(XMPMetadata xmpMetaData) {
+		this.xmpMetaData = xmpMetaData;
+	}
+
+	/**
+	 * @return the pdf
+	 */
+	public PDDocument getPdf() {
+		return pdf;
+	}
+
+	/**
+	 * @param pdf the pdf to set
+	 */
+	void setPdf(PDDocument pdf) {
+		this.pdf = pdf;
+	}
+
+	/**
+	 * Close the instance of PDDocument contained by this 
+	 * ValidationResult object
+	 */
+	public void closePdf() {
+		COSUtils.closeDocumentQuietly(this.pdf);
+	}
+	
+	/**
+	 * @return true if the PDF is valid,false otherwise
+	 */
+	public boolean isValid() {
+		return isValid;
+	}
+
+	/**
+	 * Add error to the list of ValidationError. If the given error is null, this
+	 * method does nothing
+	 * 
+	 * @param error
+	 */
+	public void addError(ValidationError error) {
+		if (error != null) {
+			this.lErrors.add(error);
+		}
+	}
+
+	/**
+	 * @return the list of validation errors
+	 */
+	public List<ValidationError> getErrorsList() {
+		return this.lErrors;
+	}
+
+	/**
+	 * This Class represents an error of validation. It contains an error code and
+	 * an error explanation.
+	 */
+	public static class ValidationError {
+		/**
+		 * Error identifier. This error code can be used as identifier to
+		 * internationalize the logging message using i18n.
+		 */
+		private String errorCode;
+
+		/**
+		 * Error details
+		 */
+		private String details;
+
+		/**
+		 * Create a validation error with the given error code
+		 * 
+		 * @param errorCode
+		 */
+		public ValidationError(String errorCode) {
+			this.errorCode = errorCode;
+			if (errorCode.startsWith(ValidationConstants.ERROR_SYNTAX_COMMON)){
+				this.details = "Syntax error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_SYNTAX_HEADER)){
+				this.details = "Body Syntax error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_SYNTAX_BODY)){
+				this.details = "Body Syntax error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_SYNTAX_CROSS_REF)){
+				this.details = "CrossRef Syntax error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_SYNTAX_TRAILER)){
+				this.details = "Trailer Syntax error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_GRAPHIC_INVALID)){
+				this.details = "Invalid Graphis object";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_GRAPHIC_TRANSPARENCY)){
+				this.details = "Invalid Graphis transparency";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_GRAPHIC_UNEXPECTED_KEY)){
+				this.details = "Unexpected key in Graphic object definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_GRAPHIC_INVALID_COLOR_SPACE)){
+				this.details = "Invalid Color space";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_FONTS_INVALID_DATA)){
+				this.details = "Invalid Font definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_FONTS_DAMAGED)){
+				this.details = "Font damaged";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_FONTS_GLYPH)){
+				this.details = "Glyph error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_TRANSPARENCY_EXT_GRAPHICAL_STATE)){
+				this.details = "Transparency error";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_ANNOT_MISSING_FIELDS)){
+				this.details = "Missing field in an annotation definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_ANNOT_FORBIDDEN_ELEMENT)){
+				this.details = "Forbidden field in an annotation definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_ANNOT_INVALID_ELEMENT)){
+				this.details = "Invalid field value in an annotation definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_ACTION_INVALID_ACTIONS)){
+				this.details = "Invalid action definition";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_ACTION_FORBIDDEN_ACTIONS)){
+				this.details = "Action is forbidden";
+			} else if (errorCode.startsWith(ValidationConstants.ERROR_METADATA_MAIN)){
+				this.details = "Error on MetaData";
+			}
+		}
+
+		/**
+		 * Create a validation error with the given error code and the error
+		 * explanation.
+		 * 
+		 * @param errorCode
+		 *          the error code
+		 * @param details
+		 *          the error explanation
+		 */
+		public ValidationError(String errorCode, String details) {
+			this(errorCode);
+			StringBuilder sb = new StringBuilder(this.details.length()+details.length()+2);
+			sb.append(this.details).append(", ").append(details);
+			this.details = sb.toString();
+		}
+
+		/**
+		 * @return the error code
+		 */
+		public String getErrorCode() {
+			return errorCode;
+		}
+
+		/**
+		 * @return the error explanation
+		 */
+		public String getDetails() {
+			return details;
+		}
+
+		/**
+		 * Set the error explanation
+		 * 
+		 * @param details
+		 */
+		public void setDetails(String details) {
+			this.details = details;
+		}
+
+	}
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidationResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidatorConfig.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidatorConfig.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidatorConfig.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidatorConfig.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Properties;
+
+import org.apache.padaf.preflight.actions.ActionManagerFactory;
+import org.apache.padaf.preflight.annotation.AnnotationValidatorFactory;
+import org.apache.padaf.preflight.annotation.PDFAbAnnotationFactory;
+import org.apache.padaf.preflight.helpers.AbstractValidationHelper;
+
+
+/**
+ * This object contains the configuration of a PdfValidator.
+ * In this object, it is possible to define :
+ * <ul>
+ * <li> a list of priority Helpers that must be executed just after the syntactic validation
+ * <li> a list of standard Helpers that must be executed after priority helpers
+ * <li> a class which extends of AnnotationManagerFactory to allow the override the annotation validator creation
+ * <li> a class which extends of ActionManagerFactory to allow the override the action manager creation
+ * <li> a java.util.Properties object to authorize future configuration adds whitout change of the object interface.
+ * </ul>
+ */
+public class ValidatorConfig {
+	public static final String FONT_FILTER = "font-filter";
+	public static final String STREAM_FILTER = "stream-filter";
+	public static final String CATALOG_FILTER = "catalog-filter";
+	public static final String GRAPHIC_FILTER = "graphic-filter";
+
+	public static final String TRAILER_FILTER = "trailer-filter";
+	public static final String XREF_FILTER = "xref-filter";
+	public static final String BOOKMARK_FILTER = "bookmark-filter";
+	public static final String ACRO_FORM_FILTER = "acro-form-filter";
+	public static final String FILE_SPECIF_FILTER = "file-specification-filter";
+	public static final String PAGE_FILTER = "page-filter";
+	public static final String META_DATA_FILTER = "metadata-filter";
+
+	/**
+	 * Container for future properties values
+	 */
+	private Properties properties = new Properties();
+	/**
+	 * List of Helpers which have to be executed first. Helpers are called in the order ofa
+	 * appearance. 
+	 */
+	private LinkedHashMap<String, Class<? extends AbstractValidationHelper>> priorHelpers = new LinkedHashMap<String, Class<? extends AbstractValidationHelper>>();
+	/**
+	 * List of Helpers which have to be executed after priorHelpers. Helpers are called in the order ofa
+	 * appearance. 
+	 */
+	private LinkedHashMap<String, Class<? extends AbstractValidationHelper>> standHelpers = new LinkedHashMap<String, Class<? extends AbstractValidationHelper>>();
+	/**
+	 * Define the AnnotationFactory used by helpers
+	 * Default value is PDFAbAnnotationFactory.class
+	 */
+	private Class<? extends AnnotationValidatorFactory> annotFact = PDFAbAnnotationFactory.class;
+	/**
+	 * Define the ActionManagerFactory used by helpers
+	 * Default value is ActionManagerFactory.class
+	 */
+	private Class<? extends ActionManagerFactory> actionFact = ActionManagerFactory.class;
+
+	public void setAnnotationFactory(Class<? extends AnnotationValidatorFactory> _annotFact) {
+		this.annotFact = _annotFact;
+	}
+
+	public void setActionFactory(Class<? extends ActionManagerFactory> _actionFact) {
+		this.actionFact = _actionFact;
+	}
+
+	public Class<? extends AnnotationValidatorFactory> getAnnotFact() {
+		return annotFact;
+	}
+
+	public Class<? extends ActionManagerFactory> getActionFact() {
+		return actionFact;
+	}
+
+	public void addProperty(Object key, Object value) {
+		this.properties.put(key, value);
+	}
+
+	public Object getProperty(Object key) {
+		return this.properties.get(key);
+	}
+
+	public void addPriorHelpers(String key, Class<? extends AbstractValidationHelper> filter) {
+		priorHelpers.put(key, filter);
+	}
+
+	public void addStandHelpers(String key, Class<? extends AbstractValidationHelper> filter) {
+		standHelpers.put(key, filter);
+	}
+	
+	public Collection<Class<? extends AbstractValidationHelper>> getPriorHelpers() {
+		return priorHelpers.values();
+	}
+
+	public Collection<Class<? extends AbstractValidationHelper>> getStandHelpers() {
+		return standHelpers.values();
+	}
+}
\ No newline at end of file

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/ValidatorConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/Validator_A1b.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/Validator_A1b.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/Validator_A1b.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/Validator_A1b.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight;
+
+import javax.activation.FileDataSource;
+
+import org.apache.padaf.preflight.ValidationResult.ValidationError;
+
+
+
+/**
+ * This class is a simple main class used to check the validity of a pdf file.
+ * 
+ * Usage : java net.awl.edoc.pdfa.Validator <file path>
+ * 
+ * @author gbailleul
+ * 
+ */
+public class Validator_A1b {
+
+	public static void main(String[] args) throws Exception {
+		if (args.length == 0) {
+			System.out
+			.println("Usage : java net.awl.edoc.pdfa.Validator <file path>");
+			System.exit(1);
+		}
+
+		FileDataSource fd = new FileDataSource(args[0]);
+
+		PdfA1bValidator validator = new PdfA1bValidator(PdfAValidatorFactory.getStandardPDFA1BConfiguration());
+
+		ValidationResult result = validator.validate(fd);
+		if (result.isValid()) {
+			result.closePdf();
+			System.out.println("The file " + args[0] + " is a valid PDF/A-1b file");
+			System.exit(0);
+		} else {
+			System.out.println("The file" + args[0] + " is not valid, error(s) :");
+			for (ValidationError error : result.getErrorsList()) {
+				System.out.println(error.getErrorCode() + " : " + error.getDetails());
+			}
+
+			result.closePdf();
+			System.exit(-1);
+		}
+	}
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/Validator_A1b.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/AbstractActionManager.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/AbstractActionManager.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/AbstractActionManager.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/AbstractActionManager.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,173 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight.actions;
+
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTION;
+
+import java.util.List;
+
+
+import org.apache.padaf.preflight.ValidationException;
+import org.apache.padaf.preflight.ValidationResult.ValidationError;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSDocument;
+
+public abstract class AbstractActionManager {
+  /**
+   * ActionManager factory used to create new ActionManager
+   */
+  protected ActionManagerFactory actionFact = null;
+  /**
+   * Action name in a Additional Action dictionary
+   */
+  protected String aaKey = null;
+  /**
+   * The action dictionary checked by this class
+   */
+  protected COSDictionary actionDictionnary = null;
+  /**
+   * The COSDocument from which the action comes from
+   */
+  protected COSDocument cDoc = null;
+
+  /**
+   * 
+   * @param amFact
+   *          Instance of ActionManagerFactory used to create ActionManager to
+   *          check Next actions.
+   * @param adict
+   *          the COSDictionary of the action wrapped by this class.
+   * @param cDoc
+   *          the COSDocument from which the action comes from.
+   * @param aaKey
+   *          The name of the key which identify the action in a additional
+   *          action dictionary.
+   */
+  AbstractActionManager(ActionManagerFactory amFact, COSDictionary adict,
+      COSDocument cDoc, String aaKey) {
+    this.actionFact = amFact;
+    this.actionDictionnary = adict;
+    this.aaKey = aaKey;
+    this.cDoc = cDoc;
+  }
+
+  /**
+   * @return the isAdditionalAction
+   */
+  public boolean isAdditionalAction() {
+    return this.aaKey != null;
+  }
+
+  /**
+   * @return the actionDictionnary
+   */
+  public COSDictionary getActionDictionnary() {
+    return actionDictionnary;
+  }
+
+  /**
+   * @return the aaKey
+   */
+  public String getAdditionalActionKey() {
+    return aaKey;
+  }
+
+  /**
+   * This method create a list of Action Managers which represent actions in the
+   * Next entry of the current action dictionary. For each Next Action, the
+   * innerValid is called and the method returns false if a validation fails.
+   * 
+   * @param error
+   *          the validation error list to updated if the validation fails.
+   * @return True if all Next Action are valid, false otherwise.
+   * @throws ValidationException
+   */
+  protected boolean validNextActions(List<ValidationError> error)
+      throws ValidationException {
+    List<AbstractActionManager> lActions = this.actionFact.getNextActions(
+        this.actionDictionnary, this.cDoc);
+    for (AbstractActionManager nAction : lActions) {
+      if (!nAction.innerValid(error)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Call the valid(boolean, List) method with the additonalActionAuth set to
+   * false.
+   * 
+   * @param error
+   *          the validation error list to updated if the validation fails.
+   * @return
+   * @throws ValidationException
+   */
+  public boolean valid(List<ValidationError> error) throws ValidationException {
+    return valid(false, error);
+  }
+
+  /**
+   * Validate an Action dictionary.
+   * 
+   * Return false if the dictionary is invalid (ex : missing key). If the
+   * ActionManager represents an AdditionalAction, this method returns false and
+   * updates the error list when the additonalActionAuth parameter is set to
+   * false.
+   * 
+   * This method call the innerValid method to process specific checks according
+   * to the action type.
+   * 
+   * If innerValid successes, all actions contained in the Next entry of the
+   * Action dictionary are validated.
+   * 
+   * @param additonalActionAuth
+   *          boolean to know if an additional action is authorized.
+   * @param error
+   *          the validation error list to updated if the validation fails.
+   * @return 
+   * @throws ValidationException
+   */
+  public boolean valid(boolean additonalActionAuth, List<ValidationError> error)
+      throws ValidationException {
+    if (isAdditionalAction() && !additonalActionAuth) {
+      error.add(new ValidationError(ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTION, "Additional Action are forbidden" ));
+      return false;
+    }
+
+    if (innerValid(error)) {
+      return validNextActions(error);
+    }
+
+    return true;
+  }
+
+  /**
+   * This method must be implemented by inherited classes to process specific
+   * validation.
+   * 
+   * @param error
+   *          the validation error list to updated if the validation fails.
+   * @return True if the action is valid, false otherwise.
+   */
+  protected abstract boolean innerValid(List<ValidationError> error);
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/AbstractActionManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/ActionManagerFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/ActionManagerFactory.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/ActionManagerFactory.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/ActionManagerFactory.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,299 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight.actions;
+
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_NEXT;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_S;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_GOTO;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_GOTOR;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_HIDE;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_IMPORT;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_JAVASCRIPT;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_LAUNCH;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_MOVIE;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_NAMED;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_NOOP;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_RESET;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_SETSTATE;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_SOUND;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_SUBMIT;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_THREAD;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_ATYPE_URI;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_VALUE_TYPE;
+import static org.apache.padaf.preflight.ValidationConstants.DICTIONARY_KEY_ACTION;
+import static org.apache.padaf.preflight.ValidationConstants.DICTIONARY_KEY_ADDITIONAL_ACTION;
+import static org.apache.padaf.preflight.ValidationConstants.DICTIONARY_KEY_OPEN_ACTION;
+import static org.apache.padaf.preflight.ValidationConstants.DICTIONARY_KEY_TYPE;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+import org.apache.padaf.preflight.ValidationException;
+import org.apache.padaf.preflight.utils.COSUtils;
+import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSDocument;
+import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.cos.COSObject;
+import org.apache.pdfbox.persistence.util.COSObjectKey;
+
+public class ActionManagerFactory {
+//	/**
+//	 * This map is used to know if an Action has already been validated. It is
+//	 * useful to avoid infinite loop in an action which has a Next entry.
+//	 */
+//	private Map<COSObjectKey, Boolean> alreadyCreated = new HashMap<COSObjectKey, Boolean>();
+
+	/**
+	 * This method extract actions from the given dictionary. An action is
+	 * identified by the following entries :
+	 * <UL>
+	 * <li>A (Action) : Available in Annotations, Outline items
+	 * <li>OpenAction (OpenAction) : Available in the Catalog dictionary
+	 * <li>AA (Additional Action) : Available in the Catalog dictionary,
+	 * Annotations, Pages
+	 * </UL>
+	 * 
+	 * If there are no action, an empty list is returned.
+	 * 
+	 * @param dictionary
+	 * @param cDoc
+	 * @return
+	 * @throws ValidationException
+	 */
+	public final List<AbstractActionManager> getActions(COSDictionary dictionary,
+			COSDocument cDoc) throws ValidationException {
+		
+		List<AbstractActionManager> result = new ArrayList<AbstractActionManager>(0);
+		Map<COSObjectKey, Boolean> alreadyCreated = new HashMap<COSObjectKey, Boolean>();
+
+		COSBase aDict = dictionary.getDictionaryObject(DICTIONARY_KEY_ACTION);
+		if (aDict != null) {
+			callCreateAction(aDict, cDoc, result, alreadyCreated);
+		}
+
+		COSBase oaDict = dictionary.getDictionaryObject(DICTIONARY_KEY_OPEN_ACTION);
+		if (oaDict != null) {
+			if (!COSUtils.isArray(oaDict, cDoc)) {
+				callCreateAction(oaDict, cDoc, result, alreadyCreated);
+			} 
+			// else Nothing to do because of an array contains a Destination not an
+			// action.
+		}
+
+		COSBase aa = dictionary
+		.getDictionaryObject(DICTIONARY_KEY_ADDITIONAL_ACTION);
+		if (aa != null) {
+			COSDictionary aaDict = COSUtils.getAsDictionary(aa, cDoc);
+			if (aaDict != null) {
+				for (Object key : aaDict.keySet()) {
+					COSName name = (COSName) key;
+					callCreateAction(aaDict.getItem(name), cDoc, result, name.getName(), alreadyCreated);
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Call the callCreateAction(COSBase, COSDocument, List<ActionManager>,
+	 * String) method with null as isAA parameter.
+	 * 
+	 * @param aDict
+	 *          a COSBase object (COSObject or COSDictionary) which represent the
+	 *          action dictionary.
+	 * @param cDoc
+	 *          the COSDocument which contains the action.
+	 * @param result
+	 *          the list of ActionManager to updated if the aDict parameter is
+	 *          valid.
+	 * @param alreadyCreated This map is used to know if an Action has already been validated. It is
+	 * useful to avoid infinite loop in an action which has a Next entry.
+	 * @throws ValidationException
+	 */
+	private void callCreateAction(COSBase aDict, COSDocument cDoc,
+			List<AbstractActionManager> result, Map<COSObjectKey, Boolean> alreadyCreated) throws ValidationException {
+		callCreateAction(aDict, cDoc, result, null, alreadyCreated);
+	}
+
+	/**
+	 * Call the create action to add the ActionManager to the result list. If the
+	 * aDict parameter isn't an instance of COSDictionary, this method throws a
+	 * ValdiationException. If the aDict parameter is a reference to a
+	 * COSDicitonary, the action manager is create only if the linked COSObjectKey
+	 * is missing from the "alreadyCreated" map, in this case the action is added
+	 * to the map. If the aDict parameter is an instance of COSDIctionary, it is
+	 * impossible to check if the ActionManager already exists in the
+	 * "alreadyCreated" map.
+	 * 
+	 * @param aDict
+	 *          a COSBase object (COSObject or COSDictionary) which represent the
+	 *          action dictionary.
+	 * @param cDoc
+	 *          the COSDocument which contains the action.
+	 * @param result
+	 *          the list of ActionManager to updated if the aDict parameter is
+	 *          valid.
+	 * @param additionActionKey
+	 *          the Action identifier if it is an additional action
+     * @param alreadyCreated This map is used to know if an Action has already been validated. It is
+	 * useful to avoid infinite loop in an action which has a Next entry.
+	 * @throws ValidationException
+	 */
+	private void callCreateAction(COSBase aDict, COSDocument cDoc, List<AbstractActionManager> result, String additionActionKey, Map<COSObjectKey, Boolean> alreadyCreated)
+	throws ValidationException {
+		if (COSUtils.isDictionary(aDict, cDoc)) {
+			if (aDict instanceof COSObject) {
+				COSObjectKey cok = new COSObjectKey((COSObject) aDict);
+				if (!alreadyCreated.containsKey(cok)) {
+					result.add(createActionManager(COSUtils.getAsDictionary(aDict, cDoc),
+							cDoc, additionActionKey));
+					alreadyCreated.put(cok, true);
+				}
+			} else {
+				result.add(createActionManager(COSUtils.getAsDictionary(aDict, cDoc),
+						cDoc, additionActionKey));
+			}
+		} else {
+			throw new ValidationException(
+					"Action entry isn't an instance of COSDictionary");
+		}
+	}
+
+	/**
+	 * Returns all actions contained by the Next entry. If the action dictionary
+	 * doesn't have Next action, the result is an empty list.
+	 * 
+	 * @param actionDictionary
+	 *          the action dictionary which contains Next entry
+	 * @param cDoc
+	 *          the COSDocument which contains actions.
+	 * @return
+	 * @throws ValidationException
+	 */
+	public final List<AbstractActionManager> getNextActions(
+			COSDictionary actionDictionary, COSDocument cDoc)
+			throws ValidationException {
+		List<AbstractActionManager> result = new ArrayList<AbstractActionManager>(0);
+		Map<COSObjectKey, Boolean> alreadyCreated = new HashMap<COSObjectKey, Boolean>();
+		
+		COSBase nextDict = actionDictionary.getDictionaryObject(ACTION_DICTIONARY_KEY_NEXT);
+		if (nextDict != null) {
+			if (COSUtils.isArray(nextDict, cDoc)) {
+				COSArray array = COSUtils.getAsArray(nextDict, cDoc);
+				// ---- Next may contains an array of Action dictionary
+				for (int i = 0; i < array.size(); ++i) {
+					callCreateAction(array.get(i), cDoc, result, alreadyCreated);
+				}
+			} else {
+				// ---- Next field contains a Dictionary or a reference to a Dictionary
+				callCreateAction(nextDict, cDoc, result, alreadyCreated);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Create an instance of ActionManager according to the value of the S entry.
+	 * If the type entry isn't Action, a ValidationException will be thrown.
+	 * 
+	 * If the action type isn't authorized in a PDF/A file, an instance of
+	 * InvalidAction is returned.
+	 * 
+	 * @param action
+	 *          the action dictionary used to instantiate the ActionManager
+	 * @param cDoc
+	 *          the COSDocument which contains the action
+	 * @param isAA
+	 *          the Action identifier if it is an additional action
+	 * @return
+	 * @throws ValidationException
+	 */
+	protected AbstractActionManager createActionManager(COSDictionary action,
+			COSDocument cDoc, String aaKey) throws ValidationException {
+
+		String type = action.getNameAsString(DICTIONARY_KEY_TYPE);
+		if (type != null && !ACTION_DICTIONARY_VALUE_TYPE.equals(type)) {
+			throw new ValidationException(
+					"The given dictionary isn't the dictionary of an Action");
+		}
+
+		// ---- S is a mandatory fields. If S entry is missing, the return will
+		// return the InvalidAction manager
+		String s = action.getNameAsString(ACTION_DICTIONARY_KEY_S);
+
+		// --- Here is authorized actions
+		if (ACTION_DICTIONARY_VALUE_ATYPE_GOTO.equals(s)) {
+			return new GoToAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_GOTOR.equals(s)) {
+			return new GoToRemoteAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_THREAD.equals(s)) {
+			return new ThreadAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_URI.equals(s)) {
+			return new UriAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_HIDE.equals(s)) {
+			return new HideAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_NAMED.equals(s)) {
+			return new NamedAction(this, action, cDoc, aaKey);
+		}
+
+		if (ACTION_DICTIONARY_VALUE_ATYPE_SUBMIT.equals(s)) {
+			return new SubmitAction(this, action, cDoc, aaKey);
+		}
+
+		// --- Here is forbidden actions
+		if (ACTION_DICTIONARY_VALUE_ATYPE_LAUNCH.equals(s) || 
+				ACTION_DICTIONARY_VALUE_ATYPE_SOUND.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_MOVIE.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_RESET.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_IMPORT.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_JAVASCRIPT.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_SETSTATE.equals(s) ||
+				ACTION_DICTIONARY_VALUE_ATYPE_NOOP.equals(s)) {
+			return new InvalidAction(this, action, cDoc, aaKey,s);
+		}
+
+		// ---- The default ActionManager is the undefined one.
+		// Actions defined in a PDF Reference greater than 1.4 will be considered as
+		// Undefined actions, here the list of new actions until the PDF 1.6 :
+		// # GoToE (1.6) : Not PDF/A, uses EmbeddedFiles.
+		// # SetOCGState (1.5) : Not PDF/A, uses optional content.
+		// # Rendition (1.5) : Not PDF/A, use multimedia content.
+		// # Trans (1.5) : ??
+		// # GoTo3DView (1.6) : ??
+		return new UndefAction(this, action, cDoc, aaKey, s);
+	}
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/ActionManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToAction.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToAction.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToAction.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToAction.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight.actions;
+
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_D;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_INVALID_TYPE;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_MISING_KEY;
+
+import java.util.List;
+
+
+import org.apache.padaf.preflight.ValidationResult.ValidationError;
+import org.apache.padaf.preflight.utils.COSUtils;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSDocument;
+import org.apache.pdfbox.cos.COSName;
+
+/**
+ * ActionManager for the GoTo action GoToAction is valid if the D entry is
+ * present.
+ */
+public class GoToAction extends AbstractActionManager {
+
+  /**
+   * 
+   * @param amFact
+   *          Instance of ActionManagerFactory used to create ActionManager to
+   *          check Next actions.
+   * @param adict
+   *          the COSDictionary of the action wrapped by this class.
+   * @param cDoc
+   *          the COSDocument from which the action comes from.
+   * @param aa
+   *          The name of the key which identify the action in a additional
+   *          action dictionary.
+   */
+  public GoToAction(ActionManagerFactory amFact, COSDictionary adict,
+      COSDocument cDoc, String aa) {
+    super(amFact, adict, cDoc, aa);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * net.awl.edoc.pdfa.validation.actions.AbstractActionManager#valid(java.util
+   * .List)
+   */
+  @Override
+  protected boolean innerValid(List<ValidationError> error) {
+    COSBase d = this.actionDictionnary.getItem(COSName
+        .getPDFName(ACTION_DICTIONARY_KEY_D));
+
+    // ---- D entry is mandatory
+    if (d == null) {
+      error.add(new ValidationError(ERROR_ACTION_MISING_KEY,
+          "D entry is mandatory for the GoToActions"));
+      return false;
+    }
+
+    if (!(d instanceof COSName || COSUtils.isString(d, cDoc) || COSUtils
+        .isArray(d, cDoc))) {
+      error.add(new ValidationError(ERROR_ACTION_INVALID_TYPE, "Type of D entry is invalid"));
+      return false;
+    }
+
+    return true;
+  }
+
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToRemoteAction.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToRemoteAction.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToRemoteAction.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToRemoteAction.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight.actions;
+
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_F;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_MISING_KEY;
+
+import java.util.List;
+
+
+import org.apache.padaf.preflight.ValidationResult.ValidationError;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSDocument;
+import org.apache.pdfbox.cos.COSName;
+
+/**
+ * ActionManager for the GoToRemote action GoToRemoteAction is valid if the F
+ * entry is present.
+ */
+public class GoToRemoteAction extends GoToAction {
+
+  /**
+   * 
+   * @param amFact
+   *          Instance of ActionManagerFactory used to create ActionManager to
+   *          check Next actions.
+   * @param adict
+   *          the COSDictionary of the action wrapped by this class.
+   * @param cDoc
+   *          the COSDocument from which the action comes from.
+   * @param aaKey
+   *          The name of the key which identify the action in a additional
+   *          action dictionary.
+   */
+  public GoToRemoteAction(ActionManagerFactory amFact, COSDictionary adict,
+      COSDocument doc, String aaKey) {
+    super(amFact, adict, doc, aaKey);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * net.awl.edoc.pdfa.validation.actions.AbstractActionManager#valid(java.util
+   * .List)
+   */
+  @Override
+  protected boolean innerValid(List<ValidationError> error) {
+    if (super.innerValid(error)) {
+      COSBase f = this.actionDictionnary.getItem(COSName
+          .getPDFName(ACTION_DICTIONARY_KEY_F));
+      if (f == null) {
+        error.add(new ValidationError(ERROR_ACTION_MISING_KEY,
+            "F entry is mandatory for the GoToRemoteActions"));
+        return false;
+      }
+    }
+    return true;
+  }
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/GoToRemoteAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/HideAction.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/HideAction.java?rev=1150373&view=auto
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/HideAction.java (added)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/HideAction.java Sun Jul 24 14:02:12 2011
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ****************************************************************************/
+
+package org.apache.padaf.preflight.actions;
+
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_H;
+import static org.apache.padaf.preflight.ValidationConstants.ACTION_DICTIONARY_KEY_T;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_HIDE_H_INVALID;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_INVALID_TYPE;
+import static org.apache.padaf.preflight.ValidationConstants.ERROR_ACTION_MISING_KEY;
+
+import java.util.List;
+
+
+import org.apache.padaf.preflight.ValidationResult.ValidationError;
+import org.apache.padaf.preflight.utils.COSUtils;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSDocument;
+import org.apache.pdfbox.cos.COSName;
+
+/**
+ * ActionManager for the Hide action. The Hide action isn't specifically
+ * prohibited by PDF/A-1, but should have been. So this action manager isn't an
+ * instance of InvalidAction but authorized only the H entry with the false
+ * value.
+ */
+public class HideAction extends AbstractActionManager {
+
+  /**
+   * @param amFact
+   *          Instance of ActionManagerFactory used to create ActionManager to
+   *          check Next actions.
+   * @param adict
+   *          the COSDictionary of the action wrapped by this class.
+   * @param cDoc
+   *          the COSDocument from which the action comes from.
+   * @param aaKey
+   *          The name of the key which identify the action in a additional
+   *          action dictionary.
+   */
+  public HideAction(ActionManagerFactory amFact, COSDictionary adict,
+      COSDocument doc, String aaKey) {
+    super(amFact, adict, doc, aaKey);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * net.awl.edoc.pdfa.validation.actions.AbstractActionManager#valid(java.util
+   * .List)
+   */
+  @Override
+  protected boolean innerValid(List<ValidationError> error) {
+    COSBase t = this.actionDictionnary.getItem(COSName
+        .getPDFName(ACTION_DICTIONARY_KEY_T));
+    // ---- T entry is mandatory
+    if (t == null) {
+      error.add(new ValidationError(ERROR_ACTION_MISING_KEY,
+          "T entry is mandatory for the NamedActions"));
+      return false;
+    }
+
+    if (!(COSUtils.isDictionary(t, cDoc) || COSUtils.isArray(t, cDoc) || COSUtils
+        .isString(t, cDoc))) {
+      error.add(new ValidationError(ERROR_ACTION_INVALID_TYPE,"T entry type is invalid"));
+      return false;
+    }
+
+    /*
+     * ---- H entry is optional but the default value is True (annotations of
+     * the T entry will be hidden) according to the aim of a PDF/A it should be
+     * false (annotations of the T entry will be shown).
+     * 
+     * We check the H value and we throw an error if it is true because of the
+     * PDF/A Application Notes sentence :
+     * 
+     * The PDF Reference supports a concept whereby something will happen when
+     * the user performs an explicit or implicit action in a PDF viewer - these
+     * "things" are called Actions. PDF/A-1 permits a limited set of these
+     * Actions, which are detailed in section 6.6.1. Specifically, any action
+     * that could change the visual representation of the document or is not
+     * documented in the PDF Reference is not permitted. This includes the /Hide
+     * action which isn't specifically prohibited by PDF/A-1, but should have
+     * been.
+     */
+    boolean h = this.actionDictionnary.getBoolean(COSName
+        .getPDFName(ACTION_DICTIONARY_KEY_H), true);
+    if (h) {
+      error.add(new ValidationError(ERROR_ACTION_HIDE_H_INVALID,
+          "H entry is \"true\""));
+      return false;
+    }
+
+    return true;
+  }
+}

Propchange: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/actions/HideAction.java
------------------------------------------------------------------------------
    svn:eol-style = native