private static PdfDictionary GetDirectDict(PdfDictionary input)
{
PdfDictionary output = new PdfDictionary();
foreach (KeyValuePair<PdfName,PdfObject> entry in input.hashMap) {
PdfObject value = GetDirectObject(entry.Value);
if (value == null)
continue;
if (value.IsArray()) {
output.Put(entry.Key, GetDirectArray((PdfArray)value));
} else if (value.IsDictionary()) {
output.Put(entry.Key, GetDirectDict((PdfDictionary)value));
} else {
output.Put(entry.Key,value);
}
}
return output;
}