Top Description Fields Constructors Methods
org.apache.pdfbox.preflight.process

public Class CatalogValidationProcess

extends AbstractProcess
Class Inheritance
Imports
java.awt.color.ICC_Profile, java.io.IOException, .InputStream, java.util.Arrays, .HashMap, .List, .Map, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSName, .COSObject, .COSObjectKey, .COSStream, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentCatalog, .PDDocumentNameDictionary, org.apache.pdfbox.pdmodel.graphics.color.PDICCBased, org.apache.pdfbox.preflight.PreflightConfiguration, .PreflightContext, .ValidationResult.ValidationError, org.apache.pdfbox.preflight.exception.ValidationException, org.apache.pdfbox.preflight.graphic.ColorSpaceHelper, .ColorSpaceHelperFactory, .ColorSpaceHelperFactory.ColorSpaceRestriction, .ICCProfileWrapper, org.apache.pdfbox.preflight.utils.ContextHelper

This ValidationProcess check if the Catalog entries are confirming with the PDF/A-1b specification.

Field Summary

Modifier and TypeField and Description
private PDDocumentCatalog
private static final List<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
public void
private void
validateActions(PreflightContext ctx)

This method validates if OpenAction entry contains forbidden action type.

private void
validateICCProfile(COSBase destOutputProfile, Map<COSObjectKey, Boolean> mapDestOutputProfile, PreflightContext
the preflight context.
ctx
)

This method checks the destOutputProfile which must be a valid ICCProfile.

private void
validateLang(PreflightContext ctx)

The Lang element is optional but it is recommended.

private void
validateNames(PreflightContext ctx)

A Catalog shall not contain the EmbeddedFiles entry.

private void
validateOCProperties(PreflightContext ctx)

A Catalog shall not contain the OCPProperties (Optional Content Properties) entry.

private void
validateOutputIntent(PreflightContext ctx)

This method checks the content of each OutputIntent.

Inherited from org.apache.pdfbox.preflight.process.AbstractProcess:
addFontErroraddValidationErroraddValidationErrors

Field Detail

catalogback to summary
private PDDocumentCatalog catalog
listICCback to summary
private static final List<String> listICC

Constructor Detail

CatalogValidationProcessback to summary
public CatalogValidationProcess()

Method Detail

isStandardICCCharacterizationback to summary
private boolean isStandardICCCharacterization(String name)
validateback to summary
public void validate(PreflightContext ctx) throws ValidationException

Implements org.apache.pdfbox.preflight.process.ValidationProcess.validate.

Annotations
@Override
validateActionsback to summary
private void validateActions(PreflightContext ctx) throws ValidationException

This method validates if OpenAction entry contains forbidden action type. It checks too if an Additional Action is present.

Exceptions
ValidationException:
Propagate the ActionManager exception
validateICCProfileback to summary
private void validateICCProfile(COSBase destOutputProfile, Map<COSObjectKey, Boolean> mapDestOutputProfile, PreflightContext ctx) throws ValidationException

This method checks the destOutputProfile which must be a valid ICCProfile. If another ICCProfile exists in the mapDestOutputProfile, a ValidationError (ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_MULTIPLE) is returned because only one profile is authorized. If the ICCProfile already exists in the mapDestOutputProfile, the method returns null. If the destOutputProfile contains an invalid ICCProfile, a ValidationError (ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_INVALID) is returned. If the destOutputProfile is an empty stream, a ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY) is returned. If the destOutputFile is valid, mapDestOutputProfile is updated, the ICCProfile is added to the document ctx and null is returned.

Parameters
ctx:PreflightContext

the preflight context.

validateLangback to summary
private void validateLang(PreflightContext ctx)

The Lang element is optional but it is recommended. This method check the Syntax of the Lang if this entry is present.

validateNamesback to summary
private void validateNames(PreflightContext ctx)

A Catalog shall not contain the EmbeddedFiles entry.

validateOCPropertiesback to summary
private void validateOCProperties(PreflightContext ctx)

A Catalog shall not contain the OCPProperties (Optional Content Properties) entry.

validateOutputIntentback to summary
private void validateOutputIntent(PreflightContext ctx) throws ValidationException

This method checks the content of each OutputIntent. The S entry must contain GTS_PDFA1. The DestOutputProfile must contain a valid ICC Profile Stream. If there are more than one OutputIntent, they have to use the same ICC Profile. This method returns a list of ValidationError. It is empty if no errors have been found.