org.apache.pdfbox.preflight.process

## Class CatalogValidationProcess

- java.lang.Object
- - org.apache.pdfbox.preflight.process.AbstractProcess
  - - org.apache.pdfbox.preflight.process.CatalogValidationProcess

All Implemented Interfaces:
  ValidationProcess

    public class CatalogValidationProcess
    extends AbstractProcess

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

### Field Summary

Fields
`protected org.apache.pdfbox.pdmodel.PDDocumentCatalog` `catalog`
`protected List<String>` `listICC`

### Constructor Summary

Constructors
Constructor and Description
`CatalogValidationProcess()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `isStandardICCCharacterization(String name)`
`void` `validate(PreflightContext ctx)`
`protected void` `validateActions(PreflightContext ctx)` This method validates if OpenAction entry contains forbidden action type.
`protected void` `validateICCProfile(org.apache.pdfbox.cos.COSBase destOutputProfile, Map<org.apache.pdfbox.cos.COSObjectKey,Boolean> mapDestOutputProfile, PreflightContext ctx)` This method checks the destOutputProfile which must be a valid ICCProfile.
`protected void` `validateLang(PreflightContext ctx)` The Lang element is optional but it is recommended.
`protected void` `validateNames(PreflightContext ctx)` A Catalog shall not contain the EmbeddedFiles entry.
`protected void` `validateOCProperties(PreflightContext ctx)` A Catalog shall not contain the OCPProperties (Optional Content Properties) entry.
`void` `validateOutputIntent(PreflightContext ctx)` This method checks the content of each OutputIntent.

### Methods inherited from class org.apache.pdfbox.preflight.process.AbstractProcess

`addFontError, addValidationError, addValidationErrors`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### catalog

    protected org.apache.pdfbox.pdmodel.PDDocumentCatalog catalog

#### listICC

    protected List<String> listICC

### Constructor Detail

#### CatalogValidationProcess

    public CatalogValidationProcess()

### Method Detail

#### isStandardICCCharacterization

    protected boolean isStandardICCCharacterization(String name)

#### validate

    public void validate(PreflightContext ctx)
                  throws ValidationException

Throws:
  `ValidationException`

#### validateActions

    protected 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.

Parameters:
  `ctx` -
Throws:
  `ValidationException` - Propagate the ActionManager exception

#### validateLang

    protected void validateLang(PreflightContext ctx)
                         throws ValidationException

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

Parameters:
  `ctx` -
Throws:
  `ValidationException`

#### validateNames

    protected void validateNames(PreflightContext ctx)
                          throws ValidationException

A Catalog shall not contain the EmbeddedFiles entry.

Parameters:
  `ctx` -
Throws:
  `ValidationException`

#### validateOCProperties

    protected void validateOCProperties(PreflightContext ctx)
                                 throws ValidationException

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

Parameters:
  `ctx` -
Throws:
  `ValidationException`

#### validateOutputIntent

    public 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.

Parameters:
  `ctx` -
Throws:
  `ValidationException`

#### validateICCProfile

    protected void validateICCProfile(org.apache.pdfbox.cos.COSBase destOutputProfile,
                                      Map<org.apache.pdfbox.cos.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:
  `destOutputProfile` -
  `mapDestOutputProfile` -
  `ctx` - the preflight context.
Throws:
  `ValidationException`