[tex-k] libpoppler support in TeX Live source tree
Norbert Preining
preining at logic.at
Thu May 7 21:56:11 CEST 2009
On Do, 07 Mai 2009, The Thanh Han wrote:
> I think for your purpose it suffices to add something like
> this to pdftosrc.cc:main():
>
> #ifdef POPPLER
> fprintf(sdterr, "warning: this version of pdftosrc doesn't support object stream (use pdftosrc from TeX Live if you need it)");
> #endif
s/sdterr/stderr/;
Good idea (modulo /sdterr/stderr/), I have removed the included XRef.h
and added this warning for poppler builds, and for xpdf build do as
normal. Thanks.
The pdftosrc.cc now looks like:
...
else { // e->offset is the object number of the object stream
#ifdef POPPLER_VERSION
fprintf(stderr, "warning: this version of pdftosrc doesn't support object stream (use pdftosrc from TeX Live if you need it)\n");
#else
// e->gen is the local index inside that object stream
//int objStrOffset = xref->getEntry(e->offset)->offset;
Object tmpObj;
xref->fetch(i, e->gen, &tmpObj); // to ensure xref->objStr is set
ObjectStream *objStr = xref->getObjStr();
assert(objStr != NULL);
int *localOffsets = objStr->getOffsets();
assert(localOffsets != NULL);
// fprintf(outfile, "%0.10lu %i n\n",
// (long unsigned) (objStrOffset), e->gen);
fprintf(outfile, "%.10lu 00000 n\n",
(long unsigned) (objStr->getFirstOffset() +
localOffsets[e->gen]));
// (long unsigned) (objStrOffset +
// objStr->getStart() + localOffsets[e->gen]));
tmpObj.free();
#endif
}
...
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining at logic.at> Vienna University of Technology
Debian Developer <preining at debian.org> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
JARROW (adj.)
An agricultural device which, when towed behind a tractor, enables the
farmer to spread his dung evenly across the width of the road.
--- Douglas Adams, The Meaning of Liff
More information about the tex-k
mailing list