[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: new libpoppler



Hi Loïc,

On Di, 22 Apr 2008, Loïc Minier wrote:
>  It's targetted at experimental; I just asked the release team to grant
>  the unstable transition for the SONAME changes (this usually takes a
>  while, probably after the python2.5 move so a long while).

Ok.

>  wasn't too happy about this churn though, so I'd appreciate if someone
>  from the TeX group could try out the new poppler instead of me.  :-)

Will do.

>  Packages are at:
>  <http://people.dooz.org/~lool/debian/poppler/0.8.0-1/sid-pbuilder/>

Thanks, will get them.

> > AFAIR from discussions on the tldistro mailing list this requires again
> > changes to the libpoppler patch, and a FTBFS is not exactely what I need
> > now.
> 
>  Hmm ok.

I attach an email which gives a patch. I will try to build texlive with
libpoppler 0.8 without and with this patch and see what works.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>        Vienna University of Technology
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
Zaphod grinned two manic grins, sauntered over to the bar
and bought most of it.
                 --- Zaphod in paradise.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy
--- Begin Message ---
Hi all,

On Wed, Apr 16, 2008 at 09:39:01AM +0200, Patrice Dumas wrote:
> On Mon, Apr 14, 2008 at 11:57:59PM +0200, Alexis Ballier wrote:
> > Hi,
> > 
> > I've seen some other distros patching texlive to use poppler. I can
> > easily see the pros (code sharing, less security issues, etc.) but also
> > see some cons: api changes in poppler, differing from what the texlive
> > team has been working with, possible subtle differences between the
> > two...
> 
> We use also libpoppler in fedora. I attach the patch. It is not the
> cleanest patch ever for the part relating with building against an
> external poppler, but it works.
> 
> > problems than it may cause ? Do different poppler releases require
> > code/patches adjustments ?
> 
> It is a bit young in fedora, but unless I am wrong there was a recent
> libpoppler ABI incompatible change, but it didn't required to change
> the texlive patch.

Please note that libpoppler needs to be patched in a way that ObjStream
class is visible to have pdftosrc successfully compiled. Attaching the
patch against libpoppler. It works also for the latest poppler 0.8.0.

Best,
Jindrich

--
Jindrich Novy <jnovy@redhat.com>   http://people.redhat.com/jnovy/
diff -up poppler-0.8.0/poppler-0.8.0/poppler/XRef.h.objstream poppler-0.8.0/poppler-0.8.0/poppler/XRef.h
--- poppler-0.8.0/poppler-0.8.0/poppler/XRef.h.objstream	2008-01-21 21:00:59.000000000 +0100
+++ poppler-0.8.0/poppler-0.8.0/poppler/XRef.h	2008-02-18 17:18:47.000000000 +0100
@@ -19,7 +19,36 @@
 class Dict;
 class Stream;
 class Parser;
-class ObjectStream;
+
+class ObjectStream {
+public:
+
+  // Create an object stream, using object number <objStrNum>,
+  // generation 0.
+  ObjectStream(XRef *xref, int objStrNumA);
+
+  ~ObjectStream();
+
+  // Return the object number of this object stream.
+  int getObjStrNum() { return objStrNum; }
+
+  // Get the <objIdx>th object from this stream, which should be
+  // object number <objNum>, generation 0.
+  Object *getObject(int objIdx, int objNum, Object *obj);
+
+  int *getOffsets() { return offsets; }
+  Guint getFirstOffset() { return firstOffset; }
+
+private:
+
+  int objStrNum;		// object number of the object stream
+  int nObjects;			// number of objects in the stream
+  Object *objs;			// the objects (length = nObjects)
+  int *objNums;			// the object numbers (length = nObjects)
+  int *offsets;			// the object offsets (length = nObjects)
+  Guint firstOffset;
+};
+
 
 //------------------------------------------------------------------------
 // XRef
@@ -106,6 +135,7 @@ public:
   int getSize() { return size; }
   XRefEntry *getEntry(int i) { return &entries[i]; }
   Object *getTrailerDict() { return &trailerDict; }
+  ObjectStream *getObjStr() { return objStr; }
 
   // Write access
   void setModifiedObject(Object* o, Ref r);
diff -up poppler-0.8.0/poppler-0.8.0/poppler/XRef.cc.objstream poppler-0.8.0/poppler-0.8.0/poppler/XRef.cc
--- poppler-0.8.0/poppler-0.8.0/poppler/XRef.cc.objstream	2008-01-21 21:00:59.000000000 +0100
+++ poppler-0.8.0/poppler-0.8.0/poppler/XRef.cc	2008-02-18 17:18:47.000000000 +0100
@@ -50,34 +50,9 @@
 // ObjectStream
 //------------------------------------------------------------------------
 
-class ObjectStream {
-public:
-
-  // Create an object stream, using object number <objStrNum>,
-  // generation 0.
-  ObjectStream(XRef *xref, int objStrNumA);
-
-  ~ObjectStream();
-
-  // Return the object number of this object stream.
-  int getObjStrNum() { return objStrNum; }
-
-  // Get the <objIdx>th object from this stream, which should be
-  // object number <objNum>, generation 0.
-  Object *getObject(int objIdx, int objNum, Object *obj);
-
-private:
-
-  int objStrNum;		// object number of the object stream
-  int nObjects;			// number of objects in the stream
-  Object *objs;			// the objects (length = nObjects)
-  int *objNums;			// the object numbers (length = nObjects)
-};
-
 ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
   Stream *str;
   Parser *parser;
-  int *offsets;
   Object objStr, obj1, obj2;
   int first, i;
 
@@ -85,6 +60,7 @@ ObjectStream::ObjectStream(XRef *xref, i
   nObjects = 0;
   objs = NULL;
   objNums = NULL;
+  offsets = NULL;
 
   if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
     goto err1;
@@ -105,6 +81,7 @@ ObjectStream::ObjectStream(XRef *xref, i
     goto err1;
   }
   first = obj1.getInt();
+  firstOffset = objStr.getStream()->getBaseStream()->getStart() + first;
   obj1.free();
   if (first < 0) {
     goto err1;
@@ -131,7 +108,7 @@ ObjectStream::ObjectStream(XRef *xref, i
       obj1.free();
       obj2.free();
       delete parser;
-      gfree(offsets);
+//       gfree(offsets);
       goto err1;
     }
     objNums[i] = obj1.getInt();
@@ -141,7 +118,7 @@ ObjectStream::ObjectStream(XRef *xref, i
     if (objNums[i] < 0 || offsets[i] < 0 ||
 	(i > 0 && offsets[i] < offsets[i-1])) {
       delete parser;
-      gfree(offsets);
+//       gfree(offsets);
       goto err1;
     }
   }
@@ -170,7 +147,7 @@ ObjectStream::ObjectStream(XRef *xref, i
     delete parser;
   }
 
-  gfree(offsets);
+//   gfree(offsets);
 
  err1:
   objStr.free();
@@ -187,6 +164,7 @@ ObjectStream::~ObjectStream() {
     delete[] objs;
   }
   gfree(objNums);
+  gfree(offsets);
 }
 
 Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {

--- End Message ---

Reply to: