Bug 688407

Summary: pdfrwrite : A shading displaced converting Altona_Visual_1v2a_x3.pdf
Product: Ghostscript Reporter: leonardo <leonardo>
Component: PDF WriterAssignee: leonardo <leonardo>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P1    
Version: master   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---
Attachments: Altona_Visual_1v2a_x3-.pdf
cur.pdf

Description leonardo 2005-11-30 06:54:38 UTC
After converting Altona_Visual_1v2a_x3.pdf to PDF/X shadings at right side of 
the rendering look with a gap in Acrobat Reader.

Reported by Thorsten Breiding.

Actually PDF/X is not relevant, here is another command line to reproduce :

gswin32c -sProcessColorModel=DeviceCMYK -dUseCIEColor -dBATCH -dNOPAUSE -
dNOOUTERSAVE -sDEVICE=pdfwrite -sOutputFile=cur3.pdf params.ps PDFX_def.ps 
Altona_Visual_1v2a_x3.pdf

Ghostscript also renmders cur3.pdf with a gap in shadings.
Comment 1 leonardo 2005-12-06 21:00:31 UTC
Created attachment 1836 [details]
Altona_Visual_1v2a_x3-.pdf

A simplified test case. After a re-distillation with Ghostscript, a white bar
appears over the shading when rendering with Adobe Reader 4,5,7 at some
resolutions (choose View/FitWindow and then change the vindow size until a
vertical bar appears). The PDF/X option isn't relevant.

gswin32c -dBATCH -dNOPAUSE -dNOOUTERSAVE -sDEVICE=pdfwrite -sOutputFile=cur.pdf
params.ps  Altona_Visual_1v2a_x3-.pdf
Comment 2 leonardo 2005-12-06 21:06:32 UTC
Created attachment 1837 [details]
cur.pdf

Attaching a result of the conversion. The effect depends on the 'f' command,
which appears in the line 270 of cur.pdf . If replace it with 'n', the white
vertical bar isn't appear. 

The 'f' command at line 270 paints a circle with white color (0 0 0 0 k) with a
clip. Later it is overprinted with a shading. I guess coordinates of the clip
and the shading don't comply.
Comment 3 leonardo 2005-12-06 21:24:59 UTC
oops, I missed that cur.pdf was manually edited to change colors for a batter 
visualization.
Comment 4 leonardo 2005-12-06 21:28:33 UTC
The effect also depends on 'W*' command at line 296.

Thus in cur.pdf the white circle is painted with a clip [9976,10622]x
[1083,2319], and the pattern '12 0 obj' is a radial shading with concentric 
circles, which is painted with a clip [9976.9, 10621.9]x[1083.8, 2347]. Thus we 
observe a gap by X from 9976 to 9976.9 . Will check whether it presents in thge 
source document.
Comment 5 leonardo 2005-12-06 21:38:20 UTC
In the source document both clips are "997.69 234.7 64.5 -126.32 re". Likely  
Ghostscript rounds it at first time and doesn't round at second time. Likely a 
bug presents in the high level cliping path handling. Also don't like why the 
shading boundary has been flattened.