[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.
>
<snip>
> http://pwaller.net/sw/2014-01-17-broken.pdf
>
<snip>
> I've reported this on bugzilla here:
> https://bugs.freedesktop.org/show_bug.cgi?id=73885
>
Link to old thread:
http://thread.gmane.org/gmane.comp.freedesktop.poppler/8683
I've investigated this briefly. An observation:
http://cgit.freedesktop.org/poppler/poppler/tree/glib/poppler-page.cc?id=poppler-0.33.0#n825
The sel_text->getLength() is 1283 (which doesn't match with the 1261 from
poppler_page_get_layout).
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!
Thanks,
- 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