Bug 56753 - Not displaying text in PDF document
Summary: Not displaying text in PDF document
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-04 21:09 UTC by Germán Poo-Caamaño
Modified: 2012-11-15 21:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
PDT Test case (Flyer A5 size intended to advertise a scouting section) (604.79 KB, text/plain)
2012-11-04 21:09 UTC, Germán Poo-Caamaño
Details
Don't complain if position at "nGlyphs" is out of bound (407 bytes, patch)
2012-11-05 14:21 UTC, Thomas Freitag
Details | Splinter Review

Description Germán Poo-Caamaño 2012-11-04 21:09:38 UTC
Created attachment 69529 [details]
PDT Test case (Flyer A5 size intended to advertise a scouting section)

Transfering this bug from GNOME Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=687419

Original message:

I'm using evince 3.6.0 on a Ubuntu 12.10 system on a Dell inspiron 1545,
pentium dual core CPU T4400 & the graphics reported as Mobile Intel® GM45
Express Chipset x86/MMX/SSE2 .

I've found that some .pdf's are not fully displaying on evince. I'm a Scout
leader in the UK & I created a flyer using the print centre available to
leaders. The flyer consists of a background with images & then boxes containing
contact details, venue's etc. The background poster is displaying, but not the
boxes with the other information. Does not relate to all of the posters /
flyers created using the software on the site.

Using the same laptop I've viewed the whole .pdf flyer using ImageMagick
(display), but also found that gimp (2.8) suffers from the same problem & only
displays the background images.

Strangely enough the whole .pdf flyer displays well on my android phone using
kindle.

The problem does not seem to be related to file size, as evince is happily
displaying some files that are much larger. 

One of the flyers with the problem is attached to this report. 

Please don't hesitate to contact me if I can help in any way further.
Comment 1 Germán Poo-Caamaño 2012-11-04 21:11:29 UTC
The text is there, but it is now shown properly.  I mean, I can select the
text, copy and paste it to a text editor.

That said, it seems a bug in poppler (or cairo).  When I render the document
with poppler-glib-demo, I get the following output in the console:

$ poppler-glib-demo /tmp/D00196233_00001.pdf 
Document successfully loaded in 0.0020 seconds
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed

poppler (0f7c17d7f92d4cd) and cairo (cf07bd866) from master.
Comment 2 Jose Aliste 2012-11-04 21:29:15 UTC
A quick debugging shows that the FoFiTrueType::make is returning null. When debugging a little further, I get that the code that checks for the sanity of the 'loca' table set parsedOk to false and hence the FofiTruetype::make returns Null. 

Unfortunately, I don't have more font knowledge to know whether this comes from a fault in the pdf file or not. Fwiw, if I comment the lines of the check (2087-2097 in FoFiTrueType.c) and I try to render the file, it renders without any problems. Hope this helps.
Comment 3 Albert Astals Cid 2012-11-05 10:11:04 UTC
Not cairo specific
Comment 4 Thomas Freitag 2012-11-05 14:21:21 UTC
Created attachment 69563 [details] [review]
Don't complain if position at "nGlyphs" is out of bound

I'm not a truetype expert, therefore I'm not sure if our code or the PDF is the problem. But with this small patch the PDF is rendered correctly.
Comment 5 Albert Astals Cid 2012-11-14 12:57:24 UTC
Thomas, if we're going to do this, shouldn't we just modify the outer loop?
Comment 6 Thomas Freitag 2012-11-14 13:21:07 UTC
(In reply to comment #5)
> Thomas, if we're going to do this, shouldn't we just modify the outer loop?

It was just cowardly: see that also 
   pos = getU16BE(tables[i].offset + j*2, &parsedOk);
in the loop can change the parsedOK value, and I'm not sure if this still should be done with j == nGlyphs.
Comment 7 Albert Astals Cid 2012-11-14 14:00:53 UTC
getU16BE is just a getter, sure it might put the parseOk to false, but you are already ignoring one error :D
Comment 8 Thomas Freitag 2012-11-14 14:32:26 UTC
(In reply to comment #7)
> getU16BE is just a getter, sure it might put the parseOk to false, but you
> are already ignoring one error :D

Okay, okay. Change the outer loop. To be true, when I had a first look at it I was wondering why j runs from 0 to equal nGlyphs. I would thought that having nGlyph it would be sufficient (and just more correct) to run from 0 to less nGlyphs. But because it was regtested by You and seems to work (I really wondered about that), I changed it in that way.
Comment 9 Albert Astals Cid 2012-11-14 21:13:05 UTC
Actually i'm being much more bold and suggesting we remove the whole loop.

I've removed it and ran the regtest and besides this it fixes another bug and there is no regression.

Looking at the code we only use the "loca" table in one place and it actually has a bit of a different logic for the parsing so since we don't use it I am suggesting to remove it.

Comments?
Comment 10 Thomas Freitag 2012-11-15 07:55:25 UTC
(In reply to comment #9)
> Actually i'm being much more bold and suggesting we remove the whole loop.
> 
> I've removed it and ran the regtest and besides this it fixes another bug
> and there is no regression.
> 
> Looking at the code we only use the "loca" table in one place and it
> actually has a bit of a different logic for the parsing so since we don't
> use it I am suggesting to remove it.
> 
> Comments?

I would agree!
Comment 11 Albert Astals Cid 2012-11-15 21:19:03 UTC
Will be fixed in poppler 0.22


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.