diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cnki_pdf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cnki_pdf.c b/src/cnki_pdf.c index 502a0ce..328a989 100644 --- a/src/cnki_pdf.c +++ b/src/cnki_pdf.c @@ -322,12 +322,13 @@ cnki_pdf(cnki_t **param) root = i; } - if ((*param)->stat > 0) - printf("Root object is %d.\n", - root); + if (root == 0) + root = pdf_get_free_id(&pdf); + else if ((*param)->stat > 0) + printf("Root object is %d.\n", root); } - if (pdf_get_kid_count(&pdf, root) == 0) { + if (pdf_get_obj(&pdf, root, NULL) != 0) { if ((*param)->stat > 0) printf("Root object is missing\n"); |