Hello,

I've written code that breaks input into lines using PdfPainter. The
input is a std::string object. It looks roughly like this:

/* --- CUT CODE SNIPPET --- */

std::string text = "a line\n\n\nmore lines now\n\nyep\nindeed\ndone.";

std::vector<PoDoFo::PdfString> vec_lines =
        painter.GetMultiLineTextAsLines(width, text);

std::vector<PoDoFo::PdfString>::const_iterator it = vec_lines.begin();

for( ; it != vec_lines.end(); ++it) {
        std::cout << "isvalid: " << it->IsValid() << ", ishex: "
                << it->IsHex() << ", isunicode: " << it->IsUnicode()
                << std::endl;

        std::cout << "line: " << it->GetStringUtf8() << std::endl;
}

/* --- CUT CODE SNIPPET --- */

This outputs:

isvalid: 1, ishex: 0, isunicode: 1
line: a line
isvalid: 1, ishex: 0, isunicode: 1
line:

isvalid: 1, ishex: 0, isunicode: 1
line: more lines now
isvalid: 1, ishex: 0, isunicode: 1
line:
yep
isvalid: 1, ishex: 0, isunicode: 1
line: indeed
isvalid: 1, ishex: 0, isunicode: 1
line: done.

As you can see, the second line consists actually of two '\n'
characters, and the fourth line seems to begin with an '\n' character. I
would expect no more than a single newline ('\n') character per line.

Am I missing something, or did I just stumble upon a PoDoFo bug (I'm
using 0.9.2)?


Thanks,
Razvan

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to