[tex-k] libpoppler support in TeX Live source tree

Peter Breitenlohner peb at mppmu.mpg.de
Mon May 4 17:08:57 CEST 2009


On Wed, 18 Mar 2009, Martin Schröder wrote:

> 2009/3/18, Norbert Preining <preining at logic.at>:
>>  Rationale: Some distributions use libpoppler instead of xpdf to have a
>>  shared library where sec fixes are only going into one package.
>
> <cough>All</cough> Linux distros I know of distribute a patched pdfTeX
> with poppler. I think it's prudent to face the facts.
>
>>  I am also willing to later on care for the poppler support, i.e., at
>>  least check for compilability.
>
> Me too, but I have scarce time till easter.

Hi everybody,

here some thoughts about xpdf and poppler.

(1) I have applied the pl3 patch to libxpdf and reorganized things a bit. 
There is now a subdirectory xpdf-3.02-foolabs/ with the original pl1,2,3
patches and another one xpdf-3.02-PATCHES/ with those actually applied.

Sorry Thanh, I did this over the weekend at home and have replaced your
changes from the weekend (but of course kept your pdftex changes).

Martin,

do you think the comments I added are sufficient?

(2) I have compiled poppler on my system and done a staged install, i.e.,
with DESTDIR=<somewhere>, but no final install yet.

(2a) I assume for pdfTeX/luaTeX/XeTeX one needs libpoppler configured with
'--enable-xpdf-headers', but as far as I can see no backend is needed nor
the utils.

The relevant headers from poppler are in $(includedir)/poppler and
$(includedir)/poppler/goo, whereas those from xpdf are in X/goo, X/fofi, and
X/xpdf. So my questions is: what are the required -I's or in other words
which xpdf headers are directly included from pdfTeX/luaTeX/XeTeX and how
(in pdftexdir/ I have seen, e.g., '#include <gmem.h>', '#include
"GlobalParams.h"' and more -- why the difference -- and it would be nice to
have a complete list).

I have compiled poopler-0.10.6 and found several warnings:

../../poppler-0.10.6/poppler/ABWOutputDev.cc:458: warning: 'N_tempColset' might be used uninitialized in this function

should be avoided

../../poppler-0.10.6/poppler/JBIG2Stream.cc:2704: warning: too many arguments for format
../../poppler-0.10.6/poppler/JBIG2Stream.cc:2718: warning: too many arguments for format

these two are real bad

../../poppler-0.10.6/poppler/Movie.cc:230: warning: converting of negative value `-0x00000000000000001' to `Gulong'

most probably a bug

../../poppler-0.10.6/poppler/CairoFontEngine.cc:240: warning: converting to non-pointer type `int' from NULL

that's nonsense (using NULL as bool return type)

../../poppler-0.10.6/glib/test-poppler-glib.cc:516: warning: long unsigned int format, gsize arg (arg 2)

can be avoided by some clever (but safe) typecast

../../poppler-0.10.6/poppler/GfxFont.cc:841: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/GfxFont.cc:1061: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:132: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:424: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:540: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:637: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:783: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/XRef.cc:812: warning: comparison between signed and unsigned integer expressions
../../poppler-0.10.6/poppler/CairoFontEngine.cc:468: warning: comparison between signed and unsigned integer expressions

these might be somewhat difficult to avoid but indicate a certain sloppyness.

You poppler guys certainly can do better. The problems (bugs?) above dampen
my enthusiasm for poppler as 'system-xpdf'.

=================

(3) Which is the exact define you would need for the poppler version, at the
same time indicating the use of poppler instead of xpdf?

Do you need -DPDF_PARSER_ONLY in addition? and what else?

What is the minimum poppler version you would need?

I assume the flags as produced by pkg-config should suffice.

=================

Once I have answers to all of the above, I'll implement the configure option
 	--with-system-xpdf   use installed poppler headers and library
                              instead of xpdf (requires pkg-config)
and you can test which changes are needed in pdfTeX/luaTeX/XeTeX for poppler.

Regards
Peter


More information about the tex-k mailing list