aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdf_get.c
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2020-12-30 17:06:55 +0000
committeryzrh <yzrh@noema.org>2020-12-30 21:12:52 +0000
commit1f62c53da6edc5a82a1e0eceb401b2274cd4a0d1 (patch)
tree24359d29576a26ae70c446d4d01a8a93a61d62c2 /src/pdf_get.c
parent98691d4203f4e578b84b2014db0fbe0c1209cc48 (diff)
downloadmelon-1f62c53da6edc5a82a1e0eceb401b2274cd4a0d1.tar.gz
melon-1f62c53da6edc5a82a1e0eceb401b2274cd4a0d1.tar.zst
Produce PDF directly from KDH.
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)