{
COSBase resources = this.fontDictionary.getItem(COSName.RESOURCES);
if (resources != null)
{
COSDictionary dictionary = COSUtils.getAsDictionary(resources, cosDocument);
if (dictionary == null)
{
this.fontContainer.push(new ValidationError(ERROR_FONTS_DICTIONARY_INVALID,
"The Resources element isn't a dictionary"));
return;
}
// process Fonts and XObjects
ContextHelper.validateElement(context, new PDResources(dictionary), RESOURCES_PROCESS);
COSBase cbFont = dictionary.getItem(COSName.FONT);
if (cbFont != null)
{
/*
* Check that all referenced object are present in the PDF file
*/
COSDictionary dicFonts = COSUtils.getAsDictionary(cbFont, cosDocument);
Set<COSName> keyList = dicFonts.keySet();
for (Object key : keyList)
{
COSBase item = dicFonts.getItem((COSName) key);
COSDictionary xObjFont = COSUtils.getAsDictionary(item, cosDocument);
try
{
PDFont aFont = PDFontFactory.createFont(xObjFont);
FontContainer aContainer = this.context.getFontContainer(aFont.getCOSObject());