sudharakab / pdfsizeopt

Automatically exported from code.google.com/p/pdfsizeopt
0 stars 0 forks source link

maybe gswin32c error under windows xp #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
another issues under windows xp(I have successfully compiled jbig2.exe, and
got other
command I need, sam2p.exe, png22pnm.exe,pngtopnm.exe,pngout.exe, so if I
opt a image
only pdf, no problem)

gswin32c.exe "-ID:\basetools
\gs\gs8.64\lib;D:\basetools\gs\fonts;C:/WINDOWS/fonts"
-q -dNOPAUSE -dBATCH -sDEVICE=nullpage -sDataFile=pso.conv.parsedata.tmp.ps -f
pso.conv.parse.tmp.ps

Error: /typecheck in --read--
Operand stack:
   --nostringval--   --dict:3/3(L)--   vmajor   MY
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
  fa
lse   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3  
%oparray_
pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop  
--nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--  
--nostringv
al--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
 --nostringval--
Dictionary stack:
   --dict:1148/1684(ro)(G)--   --dict:0/20(G)--   --dict:85/200(L)--  
--dict:54
/106(ro)(G)--   --dict:8/30(L)--
Current allocation mode is local
Current file position is 9336
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
info: Type1CParser failed, status=0x1
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6002, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 5989, in main
    do_regenerate_all_fonts=do_regenerate_all_fonts)
  File "pdfsizeopt.py", line 4150, in UnifyType1CFonts
    data_tmp_file_name='pso.conv.parsedata.tmp.ps')
  File "pdfsizeopt.py", line 3887, in ParseType1CFonts
    assert 0, 'Type1CParser failed (status)'
AssertionError: Type1CParser failed (status)

Original issue reported on code.google.com by roc...@gmail.com on 28 Oct 2009 at 9:32

GoogleCodeExporter commented 9 years ago
Please attach the relevant source .pdf, the output to pdfsizeopt.py and the
pso.conv.parse.tmp.ps file it generates.

Original comment by pts...@gmail.com on 28 Oct 2009 at 8:07

GoogleCodeExporter commented 9 years ago

Original comment by roc...@gmail.com on 28 Oct 2009 at 11:21

Attachments:

GoogleCodeExporter commented 9 years ago
F:\2009\pdfsizeopt\win32>c:\Python25\python.exe pdfsizeopt.py --use-pngout=true
--use-jbig2=true --use-multivalent=true aa.pdf
info: This is pdfsizeopt.py rUNKNOWN.
info: loading PDF from: aa.pdf
info: loaded PDF of 5826921 bytes
info: separated to 4714 objs
info: found 0 Type1 fonts loaded
info: found 264 Type1C fonts loaded
info: writing Type1CParser (518267 font bytes) to: pso.conv.parse.tmp.ps
info: executing Type1CParser with Ghostscript: gs -q -dNOPAUSE -dBATCH -sDEVICE=
nullpage -sDataFile=pso.conv.parsedata.tmp.ps -f pso.conv.parse.tmp.ps

F:\2009\pdfsizeopt\win32>D:\basetools\gs\gs8.64\bin\gswin32c.exe "-ID:\basetools
\gs\gs8.64\lib;D:\basetools\gs\fonts;C:/WINDOWS/fonts" -q -dNOPAUSE -dBATCH -sDE
VICE=nullpage -sDataFile=pso.conv.parsedata.tmp.ps -f pso.conv.parse.tmp.ps
Type1CParser: using interpreter GPL Ghostscript 864 20090203
Error: /typecheck in --read--
Operand stack:
   --nostringval--   --dict:3/3(L)--   vmajor   MY
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_
pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
 --nostringval--
Dictionary stack:
   --dict:1148/1684(ro)(G)--   --dict:0/20(G)--   --dict:85/200(L)--   --dict:54
/106(ro)(G)--   --dict:8/30(L)--
Current allocation mode is local
Current file position is 9491
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
info: Type1CParser failed, status=0x1
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6027, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 6013, in main
    do_regenerate_all_fonts=do_regenerate_all_fonts)
  File "pdfsizeopt.py", line 4167, in UnifyType1CFonts
    data_tmp_file_name='pso.conv.parsedata.tmp.ps')
  File "pdfsizeopt.py", line 3904, in ParseType1CFonts
    assert 0, 'Type1CParser failed (status)'
AssertionError: Type1CParser failed (status)

Original comment by roc...@gmail.com on 28 Oct 2009 at 11:25

GoogleCodeExporter commented 9 years ago
This is to confirm that the file pso.conv.parse.tmp.ps is OK, and the command 

$ gs -q -dNOPAUSE -dBATCH -sDEVICE=nullpage 
-sDataFile=pso.conv.parsedata.tmp.ps -f
pso.conv.parse.tmp.ps

works fine with Ghostscript 8.54 and 8.61, but 8.64 yields the error above. All
Ghostscript versions were tried on Linux.

I'm investigating how I could make it work on 8.64.

Original comment by pts...@gmail.com on 31 Oct 2009 at 10:02

GoogleCodeExporter commented 9 years ago

Original comment by pts...@gmail.com on 31 Oct 2009 at 10:03

GoogleCodeExporter commented 9 years ago
Update to r101 fixes the Ghostscript error. Please note that that you must use
Ghostscript 8.61 or later (8.64 is OK), because 8.54 is buggy.

The root of the problem was that the way CFF fonts can be loaded has changed in
Ghostscript 8.64:

old: /FontSetInit /ProcSet findresource begin //true         ReadData
new: /FontSetInit /ProcSet findresource begin //true //false ReadData

Original comment by pts...@gmail.com on 31 Oct 2009 at 10:53

GoogleCodeExporter commented 9 years ago
I tried 8.70, 8.64, 8.61 on windows, only 8.61 is ok

Original comment by roc...@gmail.com on 31 Oct 2009 at 5:38