[poppler] Incompatible number of glyphs from glib get_text{, layout}

Peter Waller peter at scraperwiki.com
Tue May 26 02:53:52 PDT 2015

On 17 January 2014 at 10:30, Peter Waller <peter at scraperwiki.com> wrote:

> A screenshot from the poppler glib demo app demonstrates this, attached
> below. Poppler gets 696 characters and 1261 layout rectangles.

> http://pwaller.net/sw/2014-01-17-broken.pdf

> I've reported this on bugzilla here:
> https://bugs.freedesktop.org/show_bug.cgi?id=73885

Link to old thread:

I've investigated this briefly. An observation:


The sel_text->getLength() is 1283 (which doesn't match with the 1261 from

If I change this to use a g_strndup() with the correct length:

result = g_strndup (sel_text->getCString (), sel_text->getLength());

And then look at result[696:], then I find that the rest of the string is
filled with 0 bytes.

I'm extremely keen to get this fixed, so any pointers would be appreciated.
The rate of encountering this bug is increasing all the time!


- Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150526/f6897960/attachment.html>

More information about the poppler mailing list