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/parsepdf.c | |
parent | 31b1f792826f51e9271475d124c3a1df4aa5116b (diff) | |
download | libnspdf-a65babe2fbd341f9d12a50a9530682ef1e015b58.tar.gz libnspdf-a65babe2fbd341f9d12a50a9530682ef1e015b58.tar.bz2 |
add metadata interface
Diffstat (limited to 'test/parsepdf.c')
-rw-r--r-- | test/parsepdf.c | 9 |
1 files changed, 9 insertions, 0 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); |