Get name from simple object. For example, Image ColorSpace is the reference to other object.

This commit is contained in:
Sergey Vlasov
2024-09-25 17:04:25 +03:00
parent 206f75403a
commit 04c4f44324
2 changed files with 22 additions and 0 deletions

View File

@ -267,6 +267,26 @@ pdfioObjGetDict(pdfio_obj_t *obj) // I - Object
return (NULL);
}
//
// 'pdfioObjGetName()' - Get the name value associated with an object.
//
const char * // O - Dictionary or `NULL` on error
pdfioObjGetName(pdfio_obj_t *obj) // I - Object
{
if (!obj)
return (NULL);
if (obj->value.type == PDFIO_VALTYPE_NONE)
_pdfioObjLoad(obj);
if (obj->value.type == PDFIO_VALTYPE_NAME)
return (obj->value.value.name);
else
return (NULL);
}
//
// '_pdfioObjGetExtension()' - Get the extension pointer for an object.