CPDF_Dictionary dict = GetRootDict(); CPDF_Object* obj = dict.GetDictBy("Type"); if (obj && obj->IsName() && obj->GetName() == "Catalog") { // do something with the catalog dictionary }
CPDF_Dictionary font_dict = GetFontDict(); CPDF_Object* obj = font_dict.GetDictBy("Subtype"); if (obj && obj->IsName() && obj->GetName() == "Type1") { CPDF_Dictionary encoding_dict = font_dict.GetDictBy("Encoding")->GetDict(); // do something with the font encoding dictionary }In this example, we first get the font dictionary using the GetFontDict method. We then retrieve an object with a key value of "Subtype" from the font dictionary using the GetDictBy method. If the object is a name object with a value of "Type1", we can assume that it is a Type 1 font dictionary and retrieve its encoding dictionary using the GetDictBy method again. Based on the package name and the class name, it is likely that CPDF_Dictionary is a part of a PDF processing library or SDK, such as pdfium or iText.