aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdf_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf_get.c')
-rw-r--r--src/pdf_get.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pdf_get.c b/src/pdf_get.c
index a441b1e..95d5b66 100644
--- a/src/pdf_get.c
+++ b/src/pdf_get.c
@@ -162,6 +162,27 @@ pdf_get_catalog_id(pdf_object_t **pdf)
}
int
+pdf_get_xref_id(pdf_object_t **pdf)
+{
+ if (*pdf == NULL)
+ return 1;
+
+ int xref_id = 0;
+
+ pdf_object_t *ptr = (*pdf)->next;
+
+ while (ptr != NULL) {
+ if (ptr->dictionary != NULL &&
+ strstr(ptr->dictionary, "/XRef") != NULL)
+ xref_id = ptr->id;
+
+ ptr = ptr->next;
+ }
+
+ return xref_id;
+}
+
+int
pdf_get_parent_id(pdf_object_t **pdf, int **id)
{
if (*pdf == NULL || *id != NULL)