In your pdf file, descendant of font F3 (named ArialNarrow-Bold) is of type 
CIDFontType2, but its FontDescriptor has a key "FontFile" (you can check by
opening your file in a text editor, and looking near lines 915 and 960)

According to pdf reference[1], FontFile should only be used with Type1.

GfxFont::readFontDescriptor (in xpdf/GfxFont.cc:165)
checks if FontFile is defined. If yes, and if type is not fontType1, it 
assumes, 
type is wrong (this is first error reason) and sets it to fontType1.

Class of font objects is either Gfx8BitFont or GfxCIDFont, depending on type.
So, at the end of GfxCIDFont constructor, you have a font object whose type is
fontType1

In SplashOutputDev::doUpdateFont (xpdf/SplashOutputDev.cc:963)
as fontType is fontType1, there is  ((Gfx8BitFont *)gfxFont)->getEncoding() (on
line 1084). I don't understand the technical details here, but anyway, you
crash soon after.

I attach a patch that seems to fix the problem.

arno


[1]: http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf chap 5.8
--- xpdf-3.02/xpdf/GfxFont.cc	2007-08-25 19:19:15.000000000 +0200
+++ xpdf-3.02.new/xpdf/GfxFont.cc	2007-08-25 19:41:23.000000000 +0200
@@ -191,10 +191,12 @@ void GfxFont::readFontDescriptor(XRef *x
 
     // look for embedded font file
     if (obj1.dictLookupNF("FontFile", &obj2)->isRef()) {
-      embFontID = obj2.getRef();
       if (type != fontType1) {
-	error(-1, "Mismatch between font type and embedded font file");
-	type = fontType1;
+	    error(-1, "Mismatch between font type and embedded font file");
+      }
+      if (!isCIDFont()) {
+          type = fontType1;
+          embFontID = obj2.getRef();
       }
     }
     obj2.free();
@@ -203,38 +205,48 @@ void GfxFont::readFontDescriptor(XRef *x
       embFontID = obj2.getRef();
       if (type != fontTrueType && type != fontCIDType2) {
 	error(-1, "Mismatch between font type and embedded font file");
-	type = type == fontCIDType0 ? fontCIDType2 : fontTrueType;
+	type = type == isCIDFont() ? fontCIDType2 : fontTrueType;
       }
     }
     obj2.free();
+
     if (embFontID.num == -1 &&
 	obj1.dictLookupNF("FontFile3", &obj2)->isRef()) {
+
       if (obj2.fetch(xref, &obj3)->isStream()) {
 	obj3.streamGetDict()->lookup("Subtype", &obj4);
 	if (obj4.isName("Type1")) {
-	  embFontID = obj2.getRef();
 	  if (type != fontType1) {
 	    error(-1, "Mismatch between font type and embedded font file");
-	    type = fontType1;
 	  }
+      if (!isCIDFont()) {
+	    type = fontType1;
+	    embFontID = obj2.getRef();
+      }
 	} else if (obj4.isName("Type1C")) {
-	  embFontID = obj2.getRef();
 	  if (type != fontType1 && type != fontType1C) {
 	    error(-1, "Mismatch between font type and embedded font file");
 	  }
-	  type = fontType1C;
+      if (!isCIDFont()) {
+        type = fontType1C;
+	    embFontID = obj2.getRef();
+      }
 	} else if (obj4.isName("TrueType")) {
-	  embFontID = obj2.getRef();
 	  if (type != fontTrueType) {
 	    error(-1, "Mismatch between font type and embedded font file");
-	    type = fontTrueType;
 	  }
+      if (!isCIDFont()) {
+	    type = fontTrueType;
+	    embFontID = obj2.getRef();
+      }
 	} else if (obj4.isName("CIDFontType0C")) {
-	  embFontID = obj2.getRef();
 	  if (type != fontCIDType0) {
 	    error(-1, "Mismatch between font type and embedded font file");
 	  }
-	  type = fontCIDType0C;
+      if (isCIDFont()) {
+	    type = fontCIDType0C;
+	    embFontID = obj2.getRef();
+      }
 	} else if (obj4.isName("OpenType")) {
 	  embFontID = obj2.getRef();
 	  if (type == fontTrueType) {

Attachment: signature.asc
Description: Digital signature

Reply via email to