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); 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. // '_pdfioObjGetExtension()' - Get the extension pointer for an object.

View File

@ -220,6 +220,8 @@ extern pdfio_obj_t *pdfioObjCopy(pdfio_file_t *pdf, pdfio_obj_t *srcobj) _PDFIO_
extern pdfio_stream_t *pdfioObjCreateStream(pdfio_obj_t *obj, pdfio_filter_t compression) _PDFIO_PUBLIC; extern pdfio_stream_t *pdfioObjCreateStream(pdfio_obj_t *obj, pdfio_filter_t compression) _PDFIO_PUBLIC;
extern pdfio_array_t *pdfioObjGetArray(pdfio_obj_t *obj) _PDFIO_PUBLIC; extern pdfio_array_t *pdfioObjGetArray(pdfio_obj_t *obj) _PDFIO_PUBLIC;
extern pdfio_dict_t *pdfioObjGetDict(pdfio_obj_t *obj) _PDFIO_PUBLIC; extern pdfio_dict_t *pdfioObjGetDict(pdfio_obj_t *obj) _PDFIO_PUBLIC;
extern const char *pdfioObjGetName(pdfio_obj_t *obj) _PDFIO_PUBLIC;
extern unsigned short pdfioObjGetGeneration(pdfio_obj_t *obj) _PDFIO_PUBLIC; extern unsigned short pdfioObjGetGeneration(pdfio_obj_t *obj) _PDFIO_PUBLIC;
extern size_t pdfioObjGetLength(pdfio_obj_t *obj) _PDFIO_PUBLIC; extern size_t pdfioObjGetLength(pdfio_obj_t *obj) _PDFIO_PUBLIC;
extern size_t pdfioObjGetNumber(pdfio_obj_t *obj) _PDFIO_PUBLIC; extern size_t pdfioObjGetNumber(pdfio_obj_t *obj) _PDFIO_PUBLIC;