Bug 689309

Summary: Problem with transparency reading PDF file
Product: Ghostscript Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: PDF InterpreterAssignee: Timothy Osborn <tim.osborn>
Status: NOTIFIED DUPLICATE    
Severity: normal CC: alex
Priority: P1    
Version: master   
Hardware: PC   
OS: Linux   
Customer: 1110 Word Size: ---
Attachments: trans.pdf
screenshot.png
transillus.pdf

Description Marcos H. Woehrmann 2007-06-29 05:53:26 UTC
The customer reports and I've verified that the attached PDF file is not read
correctly with Ghostscript.  The customer reported this using 8.54, but 8.57 and
head (r8085) produce the same results.

The command line I used for testing:

  bin/gs -sDEVICE=ppmraw -sOutputFile=test.ppm ./trans.pdf

I've attached a screenshot comparing Acrobat 1.5 output to Ghostscript.
Comment 1 Marcos H. Woehrmann 2007-06-29 05:57:56 UTC
Created attachment 3088 [details]
trans.pdf
Comment 2 Marcos H. Woehrmann 2007-06-29 05:58:13 UTC
Created attachment 3089 [details]
screenshot.png
Comment 3 Ray Johnston 2007-06-29 08:46:05 UTC
Note that with a later rev than 8.57 (rev 8075) I see:

Error: /rangecheck in --.discardtransparencygroup--

Comment 4 Marcos H. Woehrmann 2007-06-29 10:27:13 UTC
Interestingly I do not see the rangecheck message:

% ~/artifex/ghostscript/trunk/gs/bin/gs -sOutputFile=test.ppm -sDEVICE=ppmraw trans.pdf
GPL Ghostscript SVN PRE-RELEASE 8.60 (2007-05-12)
Copyright (C) 2007 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
>>showpage, press <return> to continue<<

GS>quit
% 
Comment 5 Timothy Osborn 2007-06-29 10:35:21 UTC
My results are as shown in screenshot.png. That is, job completes, but gs
produces bad output.
Comment 6 Timothy Osborn 2007-06-29 12:34:02 UTC
Created attachment 3100 [details]
transillus.pdf
Comment 7 Timothy Osborn 2007-06-29 12:44:50 UTC
It appears this is not a color compositing problem so much as a problem in the
PDF interpreter. When I take the original PDF (trans.pdf) and open it in
Illustrator CS2, make a single minor change to the PDF (move a cliprect a few
pixels) and save the PDF as a new PDF, this new PDF renders properly. Please see
the attachment transillus.pdf, which is the PDF that renders correctly. This
indicates that gs can handle the tranparecy operations, but something about the
structure of the original PDF is not being dealt with correctly. It it were
truly a compositing problem, the structural change in transillus.pdf would not
circumvent that problem.
Comment 8 Henry Stiles 2007-07-10 15:45:13 UTC
Tim, we request a better analysis here, we really can't conclude much from
comment #7.
Comment 9 Timothy Osborn 2007-07-11 08:45:33 UTC
There is a problem with the PDF interpretation when graphic states contain a
softmask dictionary. What happens is the softmask is never composited as it
never becomes part of a transparency group. Since compositing only takes place
when a group is "popped", the interpreter needs to recognize transparency groups
that are part of a graphics state. Currently the PDF interpreter only recognizes
groups that are part of a form group or imagemasks.

The reason transillus.pdf works correctly is that the file was restructured by
Illustrator in such as way that the SMask become part of a form group.

This is a duplicate of bug #688601

*** This bug has been marked as a duplicate of 688601 ***
Comment 10 Marcos H. Woehrmann 2011-09-18 21:47:04 UTC
Changing customer bugs that have been resolved more than a year ago to closed.