[poppler] using ObjectStream and XRef->getObjStr

Norbert Preining preining at logic.at
Tue May 5 07:35:05 PDT 2009


Dear all,

we are trying to compile the TeX Live Suite with poppler instead of
xpdf. Unfortunately one of the programs uses getObjStr which is not
exhibited by poppler through the XRef.h.

The pdftosrc.cc uses:
                ObjectStream *objStr = xref->getObjStr();
                assert(objStr != NULL);
                int *localOffsets = objStr->getOffsets();
                assert(localOffsets != NULL);
                fprintf(outfile, "%.10lu 00000 n\n",
                        (long unsigned) (objStr->getFirstOffset() +
                                         localOffsets[e->gen]));

currently I have to include instead of XRef.h a fixed version with the
following patch included:
--- poppler-0.6.2/poppler-0.6.2/poppler/XRef.h.objstream
2007-11-05 00:11:05.000000000 +0100
+++ poppler-0.6.2/poppler-0.6.2/poppler/XRef.h	2007-11-28
12:23:02.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);



Is there any chance that something similar is included, or do you have
any suggestion how to achieve the same as above using only the supplied
headers of libpoppler.

Thanks and all the best

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
-------------------------------------------------------------------------------
LIFF (n.)
A book, the contents of which are totally belied by its cover. For
instance, any book the dust jacket of which bears the words. 'This
book will change your life'.
			--- Douglas Adams, The Meaning of Liff


More information about the poppler mailing list