Hi,

PdfContentsTokenizer in recent PoDoFo versions (e.g. rev 1132) stopped working. I have created a minimal source which shows the problem: The ReadNext() function immediately returns FALSE and the while-loop creates no output at all. Up to rev. 1069 the output was as expected:
v v k
v v v v k
v k

Here is the source to reproduce the behavior:

#include "podofo.h"
#include <string>
int main(int argc, char **argv) {
  std::string str=
    "/Layer /MC0 BDC\n" // variant variant keyword
    "0.543 0 0.937 0 k\n" // variant variant variant variant keywork
    "/GS0 gs\n"; // variant keyword
  const char *buf=str.c_str();
const PoDoFo::pdf_long buflen=str.size(); // for older lib-versions use pdf_long instead of PoDoFo::pdf_long

  PoDoFo::PdfContentsTokenizer tokenizer(buf, buflen);
  PoDoFo::EPdfContentsType type;
  const char* keyword=NULL;
  PoDoFo::PdfVariant variant;

  while (tokenizer.ReadNext(type, keyword, variant)) {
    switch (type) {
    case PoDoFo::ePdfContentsType_Keyword:
      std::clog << "k" << std::endl;
      break;

    case PoDoFo::ePdfContentsType_Variant:
      std::clog << "v ";
      break;
    }
  }

  return(0);
}

What is going wrong? Unfortunately, I cannot find the exact svn- revision where it stopped working:
- as mentioned before, it worked with 1069
- between rev. 1070 and 1110 the library does not compile on my system (Mac OS X)
- rev. 1120 builds fine and already produces no output

Thank you very much,
Amin

PS: Strangely, the use of the other constructor PdfContentsTokenizer( PdfCanvas* pCanvas ) seems to work: It is called by TextExtractor::ExtractText in tools/podofotxtextract. And this tool produces output on my system.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to