My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 3: NotImplementedError: generational refs not implemented
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  pts...@gmail.com
Closed:  Oct 2009


 
Reported by roc...@gmail.com, Oct 27, 2009
python pdfsizeopt.py --use-pngout=true --use-jbig2=true
--use-multivalent=true Seven.Steps.To.A.Successfull.Business.Pl
an.pdf


info: This is pdfsizeopt.py r91.
info: loading PDF from: Seven.Steps.To.A.Successfull.Business.Plan.pdf
info: loaded PDF of 5840924 bytes
info: separated to 5109 objs
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6002, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 5982, in main
    pdf = PdfData().Load(file_name)
  File "pdfsizeopt.py", line 3009, in Load
    file_ofs=obj_starts[obj_num])
  File "pdfsizeopt.py", line 415, in __init__
    raise NotImplementedError('generational refs not implemented')
NotImplementedError: generational refs not implemented

Seven.Steps.To.A.Successfull.Business.Plan.pdf
5.6 MB   Download
Oct 27, 2009
#1 roc...@gmail.com
forget one thing, I can use pdftk to rebuild the refs, and this error will not
display again.
Oct 27, 2009
#2 roc...@gmail.com
If I opt the pdf create by pdftk

pdftk Seven.Steps.To.A.Successfull.Business.Plan.pdf output aa.pdf

and 

python pdfsizeopt.py aa.pdf
I got the following error,
Type1CGenerator: all OK
info: loading PDF from: pso.conv.gen.tmp.pdf
info: loaded PDF of 516894 bytes
info: separated to 727 objs
info: found 179 fonts loaded
info: optimized Type1C fonts to size 436411 (73%)
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6002, in ?
    main(sys.argv)
  File "pdfsizeopt.py", line 5992, in main
    pdf.OptimizeImages(use_pngout=use_pngout, use_jbig2=use_jbig2)
  File "pdfsizeopt.py", line 4723, in OptimizeImages
    assert isinstance(colorspace, str)
AssertionError

btw, if needed, I will upload the aa.pdf
Oct 27, 2009
#3 roc...@gmail.com
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)


Oct 27, 2009
#4 roc...@gmail.com
And what does sam2p_np mean?
Oct 28, 2009
Project Member #5 pts...@gmail.com
Please open separate issues for each different topic. In this issue I'll respond only
to ``NotImplementedError: generational refs not implemented''

sam2p_np means sam2p.exe with ZIP compression, without predictor.

I'm quite surprised that pdfsizeopt.py works on Windows. Which Python distribution
and version are you using? Could you please attach the jbig2.exe you have compiled?


Oct 28, 2009
#6 roc...@gmail.com
I tried python 2.5 (directly download from python.org),of course I modified some
content of pdfsizeopt.py, I will paste the modification when I am back home.
and will attach jbig2.exe when I am back home.

Oct 28, 2009
#7 roc...@gmail.com
you can download jbig2.exe here,
http://soft.rubypdf.com/softwares/windows-version-jbig2-encoder-jbig2-exe
and the modification of pdfsizeopt.py I did,
line 66,
--return "'%s'" % string.replace("'", "'\\''")
++return "\"%s\"" % string.replace("'", "'\\''")
windows treats single quote as part of path, so have to use double quote.

line 5824
--ShellQuoteFileName(multivalent_jar)
++'Multivalent.jar'
the multivalent_jar variable does not get the correct path of Multivalent.jar, why
not directly use Multivalent.jar?

Oct 29, 2009
Project Member #8 pts...@gmail.com
To get rid of the ``generation refs not implemented'' error, please sync to r96 (svn
update), and try again.
Oct 29, 2009
#9 roc...@gmail.com
yes, fixed
Oct 31, 2009
Project Member #10 pts...@gmail.com
(No comment was entered for this change.)
Status: Fixed

Powered by Google Project Hosting