Bug 691928 - ps2write generates a bad PostScript file
Summary: ps2write generates a bad PostScript file
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Writer (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
: 691882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-02 06:29 UTC by Marcos H. Woehrmann
Modified: 2012-01-03 13:15 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2011-02-02 06:29:37 UTC
When converting the following files using ps2write the PostScript that is produced cannot be read by Ghostscript (the errors vary from file to file, I can attach a list of error messages if it is helpful):

tests__pdf__Bug6901014_Additional_testcase.pdf
tests__pdf__Bug6901014_Fourth_crash_signature_testcase.pdf
tests__pdf__Bug6901014_SMP_Warwick_14.pdf
tests__pdf__singular_ctm_3_tr_mode.pdf
tests_private__comparefiles__Bug687797.pdf
tests_private__comparefiles__Bug689614.pdf
tests_private__comparefiles__Bug690090.pdf
tests_private__comparefiles__Bug690300.pdf
tests_private__comparefiles__Bug690349.ps
tests_private__comparefiles__Bug690837.pdf
tests_private__comparefiles__Bug691031.pdf
tests_private__comparefiles__Bug691076.pdf
tests_private__comparefiles__bugsample.pdf
tests_private__comparefiles__p2b-100.pdf
tests_private__comparefiles__test-setweightvector.ps
tests_private__comparefiles__tpc2.ps
tests_private__pdf__PDFIA1.7_SUBSET__CATX0356.pdf
tests_private__pdf__PDF_1.7_FTS__fts_20_2005.pdf
tests_private__ps__ps3cet__09-11.PS
tests_private__ps__ps3cet__09-34.PS
tests_private__ps__ps3cet__09-47A.PS
tests_private__ps__ps3cet__09-47B.PS
tests_private__ps__ps3cet__12-07A.PS
tests_private__ps__ps3cet__18-02B.PS


I'm using the following commands:

  bin/gs -sDEVICE=ps2write -r300 -o test.ps ./$inputFile
  bin/gs -sDEVICE=ppmraw -r300 -o test.ppm ./test.ps
Comment 1 Ken Sharp 2011-02-02 07:50:18 UTC
This looks like a duplicate of 691882 ?
Comment 2 Ken Sharp 2011-02-02 13:32:46 UTC
*** Bug 691882 has been marked as a duplicate of this bug. ***
Comment 3 Ken Sharp 2011-12-12 10:26:59 UTC
(In reply to comment #0)

These files work for me with current code: 
> tests__pdf__Bug6901014_Additional_testcase.pdf
> tests__pdf__Bug6901014_Fourth_crash_signature_testcase.pdf
> tests__pdf__Bug6901014_SMP_Warwick_14.pdf
> tests_private__comparefiles__Bug687797.pdf
> tests_private__comparefiles__Bug690090.pdf
> tests_private__comparefiles__Bug690300.pdf
> tests_private__comparefiles__Bug690349.ps
> tests_private__comparefiles__Bug691076.pdf
> tests_private__comparefiles__p2b-100.pdf
> tests_private__comparefiles__test-setweightvector.ps
> tests_private__pdf__PDFIA1.7_SUBSET__CATX0356.pdf
> tests_private__pdf__PDF_1.7_FTS__fts_20_2005.pdf
> tests_private__ps__ps3cet__09-11.PS

This file contains a broken TT font, so its not too surprising that it fails after conversion. The conversion does generate a warning.
> tests_private__comparefiles__Bug690837.pdf

This file contains a font which cannot be embedded due to licencing restrictions, again a warning is raised.
> tests_private__comparefiles__bugsample.pdf

These files still fail and need further investigation
> tests__pdf__singular_ctm_3_tr_mode.pdf
> tests_private__comparefiles__Bug689614.pdf
> tests_private__comparefiles__Bug691031.pdf
> tests_private__comparefiles__tpc2.ps
> tests_private__ps__ps3cet__09-34.PS
> tests_private__ps__ps3cet__09-47A.PS
> tests_private__ps__ps3cet__09-47B.PS
> tests_private__ps__ps3cet__12-07A.PS
> tests_private__ps__ps3cet__18-02B.PS
Comment 4 Ken Sharp 2011-12-13 13:36:57 UTC
> tests__pdf__singular_ctm_3_tr_mode.pdf

This file has a degenerate text matrix (the scale factor in the y direction is 0). I don't think we should expect to be able to cope with that.

> tests_private__comparefiles__Bug689614.pdf

This looks like its the original file that the above reduced file came from:
This file can't be edited in Acrobat because 'An error exists on the page'.

> tests_private__comparefiles__Bug689614.pdf

The TrueType font 'Univers-Medium has a corrupted POST table. We copy the POST table, without validating, so the output PS file has a corrupt POST table. PDF doesn't use the POST table, but PostScript does.
Comment 5 Ken Sharp 2011-12-21 09:18:13 UTC
tpc2.ps is fixed with commit:
39182690d9d7242d7a8e6e2f5fe9aff52d0ee3ab
Comment 6 Ken Sharp 2012-01-03 09:34:37 UTC
Commit:
8cfb57fdd350cbda7578226b150ed0014d5949c9

Fixes 09-47a.ps, 09-47b.ps and 18-02b.ps
Comment 7 Ken Sharp 2012-01-03 13:15:42 UTC
Commit:
d48a3d162fd38aaa2582e32565c07df41e7c02cb

fixes 12-07a.ps as well as causing a progression in 12-02.ps. Somewhere along the way 09-34.ps has also been fixed, I'm not sure where this happened.

The 5 files which are damaged/broken/invalid, or in one case have a non-embeddable font, are not addressed, and can't be. Appropriate warnings are raised during conversion where possible and I don't propose to do anything further with these. All other files now work correctly so closing the bug report.