CPDF_Dictionary.GetString is a method in the C++ PDF library that allows the user to retrieve the value of a string key stored in a PDF dictionary.
Example: Consider a PDF file that stores the metadata for a document, including the author name, creation date, and title. The information is stored in a dictionary object named 'Info'. The following code snippet shows how to retrieve the author name from the 'Info' dictionary.
CPDF_Dictionary info_dict = pdf_doc.GetInfo(); // Get the Info dictionary object CPDF_Object* author_obj = info_dict.GetDirectObject("Author"); // Retrieve the author object if (author_obj && author_obj->IsString()) { CFX_ByteString author_name = author_obj->GetString(); // Retrieve the author name std::cout << "Author name: " << author_name << std::endl; }
This code retrieves the 'Author' object from the 'Info' dictionary, checks if it is a string object, and if it is, retrieves the author name.
Package/library: The code is using the CPDF_Dictionary class, which is part of the Foxit SDK PDF library.
C++ (Cpp) CPDF_Dictionary::GetString - 30 examples found. These are the top rated real world C++ (Cpp) examples of CPDF_Dictionary::GetString extracted from open source projects. You can rate examples to help us improve the quality of examples.