diff options
author | Jay Berkenbilt <ejb@ql.org> | 2010-09-24 22:47:58 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2010-09-24 22:47:58 +0200 |
commit | 359999a59cc1befdc94115d3cd17cb95a0ebdb49 (patch) | |
tree | 0e832f3ca8390a14ff2ee1afe16d3553d6d3fca4 /TODO | |
parent | 88706995c88eae3c5eff4b069c23a73a09f72200 (diff) | |
download | qpdf-359999a59cc1befdc94115d3cd17cb95a0ebdb49.tar.zst |
note
git-svn-id: svn+q:///qpdf/trunk@1033 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'TODO')
-rw-r--r-- | TODO | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -1,3 +1,41 @@ +2.2.1 +===== + +Add interface for working with in-memory PDF files. Here's some code +to work with. + + Pl_Buffer b("b"); + FILE* f = QUtil::fopen_wrapper(std::string("open ") + filename, + fopen(filename, "rb")); + unsigned char buf[1024]; + size_t bytes_read = 0; + while (true) + { + size_t len = fread(buf, 1, sizeof(buf), f); + if (len == 0) + { + if (ferror(f)) + { + throw QPDFExc(qpdf_e_system, + filename, "", + 0, + "read"); + } + else + { + b.finish(); + break; + } + } + else + { + b.write(buf, len); + bytes_read += len; + } + } + fclose(f); + this->file = new BufferInputSource(filename, b.getBuffer()); + General ======= |