From 1f62c53da6edc5a82a1e0eceb401b2274cd4a0d1 Mon Sep 17 00:00:00 2001 From: yzrh Date: Wed, 30 Dec 2020 17:06:55 +0000 Subject: Produce PDF directly from KDH. --- src/pdf_get.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/pdf_get.c') 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 @@ -161,6 +161,27 @@ pdf_get_catalog_id(pdf_object_t **pdf) return catalog_id; } +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) { -- cgit v1.2.3