The customer reports and I've verified that the attached PDF files cannot be read by Ghostscript 8.62 nor head (r8604). The customer suspects the issue is related to the embedded CID fonts. The command line I'm using for testing: bin/gs -sDEVICE=tiff24nc -o test.tif ./002_untergeschoss.pdf Here is the Ghostscript output: GPL Ghostscript SVN PRE-RELEASE 8.63 (2008-03-01) Copyright (C) 2008 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1 Error: /undefined in --run-- Operand stack: --nostringval-- --dict:6/15(L)-- F4 8.24651 --dict:6/6(L)-- --dict:6/6(L)-- OfficinaSans- Book --dict:11/12(ro)(G)-- --nostringval-- --dict:8/8(L)-- --dict:17/17(L)-- --dict:17/17(L)- - CIDFontName Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push - -nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 1 3 %oparray_pop --nostringval-- -- nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- - -nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push -- nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- -- nostringval-- Dictionary stack: --dict:1148/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- -- dict:108/127(ro)(G)-- --dict:275/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- -- dict:21/40(L)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- - -dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:9/13(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript SVN PRE-RELEASE 8.63: Unrecoverable error, exit code 1
Created attachment 3887 [details] 002_untergeschoss.pdf
Created attachment 3888 [details] 001_übersicht_200.pdf
Created attachment 3890 [details] 002_simple.pdf Much simplified version of the 002_untergeschoss.pdf file. I believe this file does not need to marked as private.
The PDF file is invalid. The font descriptor for OfficinaSans-Book has /Subtype /CIDFontType2 i.e. declared CIDFont object but refers to an OpenType file that contains a simple CFF font. We cannot recover from this error. If I do: --- pdf_font.ps.old 2008-03-25 11:23:15.000000000 -0500 +++ pdf_font.ps 2008-03-25 21:58:38.000000000 -0500 @@ -1432,7 +1432,7 @@ /MMType1 //adjustfont /TrueType //adjustfont /CIDFontType0 //adjustCIDType0 - /CIDFontType2 //adjustCIDType2 + /CIDFontType2 //adjustfont % //adjustCIDType2 .dicttomark readonly def % Bind a proc and define n names The simplified sample proceeds to completion but renders incorrectly. According to the PDF spec, the descendant font must be CIDFont, not a simple font.
Passing to Alex who handles PDF interpreter.
A second customer has reported the same problem; I've attached their test file.
Created attachment 3901 [details] 12619.pdf
Created attachment 3904 [details] experimental patch - uses wrong encoding This patch creates a CIDFont resource from a simple font. It fixes the PostScript error but uses wrong encoding - some of the characters may be swapped or missing. The correct fix should be a part of ReadData procedure and use CharString INDEX for glyph numbers.
Created attachment 3948 [details] patch This patch appears to work.
Created attachment 3951 [details] patch PDF can use OpenType font with ordinary CFF data as a CIDFont. Such a font is referenced by /CIDFontType2 and may have /CIDToGIDMap table. The following changes have been done to support this usage. - A flag that forces CIDFont generation was added to CFF font loader. - When the flag is on, CFF font is converted to a Type 9 CIDFont. - The FontSet resource is returned by the value from the font loader because it can be of either Font or CIDFont type, - Since CIDMap has no effect on CIDFont Type 9, CIDToGIDMap is interpreted by PDF reader to modify GlyphDirectory to the same effect. - Unused CIDMap is no longer generated for CIDFontType2 objects that are nor TrueType CIDFont resources. Regression testing shows no differences.
The last path is committed as a rev. 8646.