Bug 689970

Summary: major artefacts in pdfwriter output
Product: Ghostscript Reporter: Bernhard Weisshuhn <bkw>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: NOTIFIED FIXED    
Severity: major CC: till.kamppeter
Priority: P4    
Version: 8.63   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: Original file, displays fine
file with artefacts after being processed by ps2pdf
Another Testcase, heavily distorted by ps2pdf
File 4259 after being processed with ps2pdf
output with svn 9251 - still broken
out.pdf

Description Bernhard Weisshuhn 2008-07-15 05:01:06 UTC
The attached file is damaged very badly when piped through pdfwriter (say ps2pdf).
Several readers we tried (ghostscript, poppler, Adobe Reader, Apple Preview)
render the original just fine but give very noticable artefacts when used on the
file produced by ps2pdf.
I cannot really comment on the (customer supplied) file. A preflight on Acrobat
Pro 9 did not reveal any pecularities.
Comment 1 Bernhard Weisshuhn 2008-07-15 05:02:12 UTC
Created attachment 4219 [details]
Original file, displays fine
Comment 2 Bernhard Weisshuhn 2008-07-15 05:04:42 UTC
Created attachment 4220 [details]
file with artefacts after being processed by ps2pdf

% ps2pdf input.pdf ps2pdf.pdf
% gs --version
8.63
Comment 3 Ken Sharp 2008-07-15 06:11:28 UTC
This looks like its another case of the text render mode causing problems. Much
of the text is drawn with Tr 2 (fill and then stroke), apparently to increase
the 'boldness' of the font because it uses the same colour for both operations.
If I alter that to Tr 1 or 0 and convert then the problem disappears. 

To do this, select the text in Acrobat, right-click and select properties. Note
that the stroke and fill colours are set. Alter the stroke colour to 'no
colour'. Notice that the boldness is reduced. Convert, problem disappears.


The current pdfwrite code in HEAD does a 'better' job with text rendering modes
than the old code did, but its far from perfect, and faulty line widths are a
known problem.

Hopefully I'll get round to altering the graphics state to address this soon.
See also issue #689692.

I won't mark this as a duplicate, because its not quite the same problem.
Comment 4 Bernhard Weisshuhn 2008-08-07 02:49:56 UTC
Created attachment 4259 [details]
Another Testcase, heavily distorted by ps2pdf

I supspect this the same problem.
Comment 5 Bernhard Weisshuhn 2008-08-07 02:53:01 UTC
Created attachment 4260 [details]
File 4259 after being processed with ps2pdf
Comment 6 Ken Sharp 2008-08-20 00:40:07 UTC
*** Bug 690025 has been marked as a duplicate of this bug. ***
Comment 7 Ken Sharp 2008-11-06 07:57:25 UTC
This patch:

http://ghostscript.com/pipermail/gs-cvs/2008-November/008772.html

(revision 9196) resolves the problem. There are still issues with text rendering
modes (as noted in the submission log) to be dealt with later.
Comment 8 Bernhard Weisshuhn 2008-12-04 01:53:23 UTC
Created attachment 4637 [details]
output with svn 9251 - still broken

Output with current svn (rev 9251, built on freebsd) is still severely
distorted. I strongly vote to reopen this bug.
Comment 9 Ken Sharp 2008-12-05 00:28:16 UTC
Created attachment 4638 [details]
out.pdf

The image does not match the PDF file I produce here on Windows which displays
perfectly in Acrobat. The report says 'All' for the OS, so I did not (and have
not) tested it on Linux or any other Unix.

You do not say how you achieved the output, is this also created from freeBSD ?
If so what application did you use to view the output ?

I doubt there is any point in re-opening this bug in any event, the text
rendering has been heavily revised over the last few weeks and has probably
reached the best state it is going to until a major overhaul is completed.

The file from this issue will be tested, along with all the others, as part of
the testing for that work.

For what its worth I have attached the PDF file I produced.
Comment 10 Bernhard Weisshuhn 2008-12-05 04:10:26 UTC
Sorry for having wasted your time on this. After I installed to /usr/local and
not /usr/local/ghostscript-8.64-svn (via configure --prefix), I got the same
result as You. I don't really understand why, truss did not show any open() of
old library files.

Anyway, I'm a happy camper now, thanks a bunch!
Comment 11 Till Kamppeter 2009-01-06 07:28:37 UTC
*** Bug 690220 has been marked as a duplicate of this bug. ***