Top Fields Constructors Methods
org.apache.pdfbox.preflight.font

public Class Type0FontValidator

extends FontValidator<Type0Container>
Class Inheritance
Static Imports
org.apache.pdfbox.preflight.PreflightConstants.ERROR_FONTS_CIDKEYED_CMAP_INVALID_OR_MISSING, .PreflightConstants.ERROR_FONTS_CIDKEYED_INVALID, .PreflightConstants.ERROR_FONTS_CIDKEYED_SYSINFO, .PreflightConstants.ERROR_FONTS_CID_DAMAGED, .PreflightConstants.ERROR_FONTS_CID_CMAP_DAMAGED, .PreflightConstants.ERROR_FONTS_DICTIONARY_INVALID, .PreflightConstants.FONT_DICTIONARY_DEFAULT_CMAP_WMODE, .PreflightConstants.FONT_DICTIONARY_VALUE_CMAP_IDENTITY_H, .PreflightConstants.FONT_DICTIONARY_VALUE_CMAP_IDENTITY_V

Field Summary

Modifier and TypeField and Description
protected final PDFont
Inherited from org.apache.pdfbox.preflight.font.FontValidator:
contextdescriptorHelperfontContainer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

the validation result.
checkCIDSystemInfo
(COSDictionary cidSysInfo)

Check the content of the CIDSystemInfo dictionary.

protected void
protected void
protected void
checkMandatoryFields()

This methods extracts from the Font dictionary all mandatory fields.

private void
compareCIDSystemInfo(COSDictionary cmap)

The CIDSystemInfo must have the same Registry and Ordering for CMap and CIDFont.

protected FontValidator<? extends FontContainer<PDCIDFontType0>>
createCIDType0FontValidator(COSDictionary fDict)

Create the validation object for CIDType0 Font

protected FontValidator<? extends FontContainer<PDCIDFontType2>>

Returns:

a CIDType2 tont font validator.
createCIDType2FontValidator
(COSDictionary
a CIDType2 font dictionary.
fDict
)

Create the validation object for CIDType2 Font

protected FontValidator<? extends FontContainer<? extends PDCIDFont>>
private void
processCMapAsStream(COSStream
the cmap stream.
aCMap
)

This method checks mandatory fields of the CMap stream.

protected void
processDescendantFont()

Extract the single CIDFont from the descendant array.

public void
Inherited from org.apache.pdfbox.preflight.font.FontValidator:
checkToUnicodegetFontContainer

Field Detail

fontback to summary
protected final PDFont font

Constructor Detail

Type0FontValidatorback to summary
public Type0FontValidator(PreflightContext context, PDFont font)

Method Detail

checkCIDSystemInfoback to summary
protected boolean checkCIDSystemInfo(COSDictionary cidSysInfo)

Check the content of the CIDSystemInfo dictionary. A CIDSystemInfo dictionary must contain :

  • a Name - Registry
  • a Name - Ordering
  • a Integer - Supplement
Returns:boolean

the validation result.

checkCMapEncodingback to summary
protected void checkCMapEncoding(COSBase encoding)
checkEncodingback to summary
protected void checkEncoding()

Overrides org.apache.pdfbox.preflight.font.FontValidator.checkEncoding.

Check the CMap entry. The CMap entry must be a dictionary in a PDF/A. This entry can be a String only if the String value is Identity-H or Identity-V

Annotations
@Override
checkMandatoryFieldsback to summary
protected void checkMandatoryFields()

This methods extracts from the Font dictionary all mandatory fields. If a mandatory field is missing, the list of ValidationError in the FontContainer is updated.

compareCIDSystemInfoback to summary
private void compareCIDSystemInfo(COSDictionary cmap)

The CIDSystemInfo must have the same Registry and Ordering for CMap and CIDFont. This control is useless if CMap is Identity-H or Identity-V so this method is called by the checkCMap method.

createCIDType0FontValidatorback to summary
protected FontValidator<? extends FontContainer<PDCIDFontType0>> createCIDType0FontValidator(COSDictionary fDict)

Create the validation object for CIDType0 Font

createCIDType2FontValidatorback to summary
protected FontValidator<? extends FontContainer<PDCIDFontType2>> createCIDType2FontValidator(COSDictionary fDict)

Create the validation object for CIDType2 Font

Parameters
fDict:COSDictionary

a CIDType2 font dictionary.

Returns:FontValidator<? extends FontContainer<PDCIDFontType2>>

a CIDType2 tont font validator.

createDescendantValidatorback to summary
protected FontValidator<? extends FontContainer<? extends PDCIDFont>> createDescendantValidator(COSDictionary cidFont)
processCMapAsStreamback to summary
private void processCMapAsStream(COSStream aCMap)

This method checks mandatory fields of the CMap stream. This method also checks if the CMap stream is damaged using the CMapParser of the fontbox api. The standard information of a stream element will be checked by the StreamValidationProcess.

Parameters
aCMap:COSStream

the cmap stream.

processDescendantFontback to summary
protected void processDescendantFont() throws ValidationException

Extract the single CIDFont from the descendant array. Create a FontValidator for this CIDFont and launch its validation.

Exceptions
ValidationException:
if there is an error validating the CIDFont.
validateback to summary
public void validate() throws ValidationException

Implements abstract org.apache.pdfbox.preflight.font.FontValidator.validate.

Annotations
@Override