in src/java/org/apache/fop/render/pdf/pdfbox/PDFWriter.java [90:145]
protected void processArg(Operator op, COSBase c) throws IOException {
if (c instanceof COSInteger) {
s.append(((COSInteger) c).intValue());
s.append(" ");
} else if (c instanceof COSFloat) {
float f = ((COSFloat) c).floatValue();
if (!floatCache.containsKey(f)) {
addCache(f);
}
s.append(floatCache.get(f));
s.append(" ");
if (floatCache.size() > 1024) {
floatCache.clear();
}
} else if (c instanceof COSName) {
COSName cn = (COSName)c;
key.writeName(s, cn);
s.append(" ");
String name = key.getName(cn);
if (!name.equals(cn.getName())) {
keyUsed = true;
}
} else if (c instanceof COSString) {
s.append("<" + ((COSString) c).toHexString() + ">");
} else if (c instanceof COSArray) {
s.append("[");
readPDFArguments(op, (Collection<COSBase>) ((COSArray) c).toList());
s.append("] ");
} else if (c instanceof COSDictionary) {
Collection<COSBase> dictArgs = new ArrayList<COSBase>();
if (currentMCID != 0 && op.getName().equals("BDC")) {
for (Map.Entry<COSName, COSBase> cn : ((COSDictionary)c).entrySet()) {
if (cn.getKey().getName().equals("MCID")) {
updateMCID(cn, dictArgs);
} else {
dictArgs.add(cn.getKey());
dictArgs.add(cn.getValue());
}
}
} else {
for (Map.Entry<COSName, COSBase> cn : ((COSDictionary)c).entrySet()) {
dictArgs.add(cn.getKey());
dictArgs.add(cn.getValue());
}
}
s.append("<<");
readPDFArguments(op, dictArgs);
s.append(">>");
} else if (c instanceof COSBoolean) {
s.append(((COSBoolean) c).getValue()).append(" ");
} else if (c instanceof COSNull) {
s.append("null ");
} else {
throw new IOException(c + " not supported");
}
}