Bug 692307 - ps2write Distiller font compatibility problem
Summary: ps2write Distiller font compatibility problem
Status: RESOLVED DUPLICATE of bug 692033
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Writer (show other bugs)
Version: 9.02
Hardware: PC Windows XP
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 14:06 UTC by steve166
Modified: 2011-06-30 08:16 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
postcript testfile, which produces a distiller error after converted with ps2write (248.21 KB, application/postscript)
2011-06-28 14:06 UTC, steve166
Details
zip archive with sample files (238.97 KB, application/octet-stream)
2011-06-28 15:27 UTC, Ken Sharp
Details
correct archive (178.68 KB, application/octet-stream)
2011-06-28 15:34 UTC, Ken Sharp
Details
second testcase (causes error with -dASCII85EncodePages=true) (140.00 KB, application/postscript)
2011-06-29 12:08 UTC, steve166
Details
testcase with another distiller font related compatibility problem (7.01 KB, application/postscript)
2011-06-29 13:53 UTC, steve166
Details

Note You need to log in before you can comment on or make changes to this bug.
Description steve166 2011-06-28 14:06:52 UTC
Created attachment 7614 [details]
postcript testfile, which produces a distiller error after converted with ps2write

Hello,

i have problems with the compatibility of the ps2write output
with Adobe Distiller and other Adobe based RIPs.
Some fonts seems not to be converted correctly.
I have attached a small postscript test file (distiller_ps2write_font_test.ps),
containing one of the problematic fonts and showing some text with it.
Distiller 5 ander Distiller 9 have no problems with converting this file
to pdf.
If i use Ghostscript to convert this file to ps using the ps2write device
Distiller 5 and Distiller 9 produces a error if i try to convert the output to pdf. It seems that the distiller have problems finding the 's' character.
Ghostview have no problem showing the ps2write output correctly.

Best regards,

steve166
Comment 1 Ken Sharp 2011-06-28 15:27:50 UTC
Created attachment 7616 [details]
zip archive with sample files


> If i use Ghostscript to convert this file to ps using the ps2write device
> Distiller 5 and Distiller 9 produces a error if i try to convert the output to
> pdf. It seems that the distiller have problems finding the 's' character.
> Ghostview have no problem showing the ps2write output correctly.

I am unable to reproduce this, either on the 9.02 release or the current master, on Windows. Since you haven't supplied a command line for ps2write I used three different (simple) ones:

gswin32c -sDEVICE=ps2write -sOutputFile=\out.ps distiller_ps2write_font_test.ps

gswin32c -sDEVICE=ps2write -dCompressPages=false -sOutputFile=\out.ps distiller_ps2write_font_test.ps

gswin32c -sDEVICE=ps2write -dCompressPages=false -dCompressFonts=false -sOutputFile=\out.ps distiller_ps2write_font_test.ps

I renamed the output files and then ran these through Adobe Acrobat Distiller 9.4 and 7.07 (I don't have access to 5 here), using the 'Standard' settings in Distiller. All files completed without error.

This may be a configuration difference, can you let me know the Ghostscript command line and the Distiller configuration please ? Probably easiest to use one of the standard Distiller configurations to avoid sending tedious config details.
Comment 2 Ken Sharp 2011-06-28 15:34:46 UTC
Created attachment 7620 [details]
correct archive

Uploaded wrong archive, this is the right one.
Comment 3 steve166 2011-06-28 16:04:04 UTC
I never set the -dCompressFonts=false parameter.
This caused the distiller problems.
I thought the CompressFonts parameter is set to false by default for the ps2write device. I read this somewhere at the ps2ps2.htm page.
But anyway thanks for your hint.
Then i think you can close this bug :-)

Best regards,

steve166
Comment 4 Ken Sharp 2011-06-28 16:10:29 UTC
(In reply to comment #3)

> I never set the -dCompressFonts=false parameter.
> This caused the distiller problems.

Sorry, are you saying that setting -dCompressFonts=false causes a Distiller error ? I don't see that here.

> I thought the CompressFonts parameter is set to false by default for the
> ps2write device. I read this somewhere at the ps2ps2.htm page.

Hmm, I'll look for that, it certainly isn't the case. Fonts and pages (and prolog) are always compressed by default.

> But anyway thanks for your hint.
> Then i think you can close this bug :-)

I'd still like to reproduce and understand the error, can you give me a command line which produces a PS file which fails ?
Comment 5 steve166 2011-06-28 16:44:44 UTC
I can reproduce the error with the following commandline:

gswin32c -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -dCompressPages=false -sOutputFile=out.ps -dASCII85EncodePages=false distiller_ps2write_font_test.ps

The problem is caused by not setting -dCompressFonts to false and
using -dASCII85EncodePages=false.

I have set ASCII85EncodePages to false because i also get problems
with the distiller if i set this param to true (with other data).
But maybe this was the font error in disguise.
Comment 6 Ken Sharp 2011-06-29 07:13:57 UTC
(In reply to comment #5)
> I can reproduce the error with the following commandline:
> 
> gswin32c -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -dCompressPages=false
> -sOutputFile=out.ps -dASCII85EncodePages=false distiller_ps2write_font_test.ps
> 
> The problem is caused by not setting -dCompressFonts to false and
> using -dASCII85EncodePages=false.
> 
> I have set ASCII85EncodePages to false because i also get problems
> with the distiller if i set this param to true (with other data).
> But maybe this was the font error in disguise.

OK, finally I can reproduce this, and it errors on other interpreters too. I'm not sure why this is a problem but it clearly is, so I'll look into it. It looks like the LZWEncoded data is incorrect, clearly its OK when not compressed, and when the LZW data is ASCII85 encoded.

I don't think there is a font error here at all, not compressing the font simply means that the image data is not LZW compressed. Whatever your reason for not using ASCII85, its not the same thing.
Comment 7 steve166 2011-06-29 12:08:32 UTC
Created attachment 7630 [details]
second testcase (causes error with -dASCII85EncodePages=true)
Comment 8 steve166 2011-06-29 12:12:09 UTC
All other commandline parameters stay the same for the second testcase.
If you use -dASCII85EncodePages=false with the second example the distiller produces no error !
Comment 9 Ken Sharp 2011-06-29 12:16:24 UTC
(In reply to comment #8)
> All other commandline parameters stay the same for the second testcase.
> If you use -dASCII85EncodePages=false with the second example the distiller
> produces no error !

I *think* (I'm still in the middle of proving it) that the problem is that there is a bug in LZWEncode. The ASCII85Encode filter 'sometimes' seems to mask this problem, but I believe it genuinely only masks it.

I suspect this is a duplicate of Bug #692033:

http://bugs.ghostscript.com/show_bug.cgi?id=692033

But as I said I'm in the middle of proving it, by looking at the LZWEncoded data.
Comment 10 steve166 2011-06-29 13:53:08 UTC
Created attachment 7631 [details]
testcase with another distiller font related compatibility problem

I have found another font which, after converted with ps2write, does not work
with Adobe distiller 9. This maybe a different problem, because
-dCompressFonts=false does not help here anymore. Also the output
works with distiller 5 but not with distiller 9.0 (both using the same
compatibility setting). With Distiller 9.0 i get a limitcheck error (see attached log). The font is a type42 font generated from a truetype font.
Comment 11 Ken Sharp 2011-06-30 08:16:56 UTC
(In reply to comment #10)

> I have found another font which, after converted with ps2write, does not work
> with Adobe distiller 9. This maybe a different problem,

I'm sure it will be, please open a different bug report for this one.

I've now proven to my satisfaction that this problem is due to the LZWEncode filter producing garbage. It appears to be a duplicate of #692033, so I'm closing this as a duplicate and raising the priority of that bug as ps2write makes extensive use of the LZWEncode filter.

*** This bug has been marked as a duplicate of bug 692033 ***