for (int i = 0; outputIntents != null && i < outputIntents.size(); ++i) {
COSDictionary dictionary = COSUtils.getAsDictionary(outputIntents.get(i), cDoc);
if (dictionary == null) {
result.add(new ValidationError(
ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY,
"OutputIntent object is null or isn't a dictionary"));
} else {
// ---- S entry is mandatory and must be equals to GTS_PDFA1
String sValue = dictionary.getNameAsString(COSName.getPDFName(OUTPUT_INTENT_DICTIONARY_KEY_S));
if (!OUTPUT_INTENT_DICTIONARY_VALUE_GTS_PDFA1.equals(sValue)) {
result.add(new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_S_VALUE_INVALID,
"The S entry of the OutputIntent isn't GTS_PDFA1"));
continue;
}
// ---- OutputConditionIdentifier is a mandatory field
String outputConditionIdentifier = dictionary
.getString(COSName.getPDFName(OUTPUT_INTENT_DICTIONARY_KEY_OUTPUT_CONDITION_IDENTIFIER));
if (outputConditionIdentifier == null) {// empty string is autorized (it may be an application specific value)
result.add(new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY,
"The OutputIntentCondition is missing"));
continue;
}
// ---- If OutputConditionIdentifier is "Custom" or a non Standard ICC Characterization :
// ---- DestOutputProfile and Info are mandatory
// ---- DestOutputProfile must be a ICC Profile
// ---- Because of PDF/A conforming file needs to specify the color characteristics, the DestOutputProfile
// ---- is checked even if the OutputConditionIdentifier isn't "Custom"
COSBase dop = dictionary.getItem(COSName.getPDFName(OUTPUT_INTENT_DICTIONARY_KEY_DEST_OUTPUT_PROFILE));
ValidationError valer = validateICCProfile(dop, cDoc, tmpDestOutputProfile, handler);
if (valer != null) {
result.add(valer);
continue;
}