diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-12-31 18:03:41 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-12-31 18:09:39 +0000 |
commit | a65babe2fbd341f9d12a50a9530682ef1e015b58 (patch) | |
tree | 426c8930746531a21c44e273d4cdc243fe5a66c6 /test | |
parent | 31b1f792826f51e9271475d124c3a1df4aa5116b (diff) | |
download | libnspdf-a65babe2fbd341f9d12a50a9530682ef1e015b58.tar.gz libnspdf-a65babe2fbd341f9d12a50a9530682ef1e015b58.tar.bz2 |
add metadata interface
Diffstat (limited to 'test')
-rw-r--r-- | test/parsepdf.c | 9 | ||||
-rwxr-xr-x | test/runtest.sh | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/test/parsepdf.c b/test/parsepdf.c index 3482af5..1d7a086 100644 --- a/test/parsepdf.c +++ b/test/parsepdf.c @@ -14,7 +14,10 @@ #include <stdbool.h> #include <string.h> +#include <libwapcaplet/libwapcaplet.h> + #include <nspdf/document.h> +#include <nspdf/meta.h> static nspdferror read_whole_pdf(const char *fname, uint8_t **buffer, uint64_t *buffer_length) @@ -58,6 +61,7 @@ int main(int argc, char **argv) uint64_t buffer_length; struct nspdf_doc *doc; nspdferror res; + struct lwc_string_s *title; if (argc < 2) { fprintf(stderr, "Usage %s <filename>\n", argv[0]); @@ -82,6 +86,11 @@ int main(int argc, char **argv) return res; } + res = nspdf_get_title(doc, &title); + if (res == NSPDFERROR_OK) { + printf("Title:%s\n", lwc_string_data(title)); + } + res = nspdf_document_destroy(doc); if (res != NSPDFERROR_OK) { printf("failed to destroy document (%d)\n", res); diff --git a/test/runtest.sh b/test/runtest.sh index 1aa83c7..c62ec11 100755 --- a/test/runtest.sh +++ b/test/runtest.sh @@ -1,4 +1,4 @@ #!/bin/sh TEST_PATH=$1 -${TEST_PATH}/test_parsepdf ~/Downloads/HiKey_User_Guide_Rev0.2.pdf +${TEST_PATH}/test_parsepdf test/files/sn74ls173a.pdf |