*/
private static class ProcessGraphicsStateResource implements ContentOperator{
public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {
PdfName dictionaryName = (PdfName)operands.get(0);
PdfDictionary extGState = processor.resources.getAsDict(PdfName.EXTGSTATE);
if (extGState == null)
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.operator.1", operator));
PdfDictionary gsDic = extGState.getAsDict(dictionaryName);
if (gsDic == null)
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("1.is.an.unknown.graphics.state.dictionary", dictionaryName));
// at this point, all we care about is the FONT entry in the GS dictionary
PdfArray fontParameter = gsDic.getAsArray(PdfName.FONT);
if (fontParameter != null){
CMapAwareDocumentFont font = new CMapAwareDocumentFont((PRIndirectReference)fontParameter.getPdfObject(0));
float size = fontParameter.getAsNumber(1).floatValue();
processor.gs().font = font;