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 27: __main__.PdfTokenParseError: unexpected stream in: 54 0 obj
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  pts...@gmail.com
Closed:  Feb 2011


 
Reported by lev.bishop, Jan 24, 2010
What command do you run to optimize the PDF?
user@ubuntu804server:~/manypdfs/fail2$ ~/pdfsizeopt/pdfsizeopt.py
--use-pngout=false 0807.2882v1.pdf

What does pdfsizeopt display when running the command above?
info: This is pdfsizeopt.py r134.
info: loading PDF from: 0807.2882v1.pdf
info: loaded PDF of 648813 bytes
info: separated to 202 objs
info: found 0 Type1 fonts loaded
info: found 21 Type1C fonts loaded
info: writing Type1CParser (53441 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
Type1CParser: using interpreter GPL Ghostscript 861 20071121
Type1CParser: all OK
info: parsed 21 Type1C fonts
info: will optimize image XObject 54; orig width=2042 height=1267
colorspace=/De
viceGray bpc=1 filter=/CCITTFaxDecode dp=1 size=4504 gs_device=pngmono
Traceback (most recent call last):
  File "/home/user/pdfsizeopt/pdfsizeopt.py", line 6157, in ?
    main(sys.argv)
  File "/home/user/pdfsizeopt/pdfsizeopt.py", line 6143, in main
    pdf.OptimizeImages(use_pngout=use_pngout, use_jbig2=use_jbig2)
  File "/home/user/pdfsizeopt/pdfsizeopt.py", line 4803, in OptimizeImages
    mask, _ = PdfObj.ResolveReferences(obj.Get('Mask'), objs=self.objs)
  File "/home/user/pdfsizeopt/pdfsizeopt.py", line 2086, in ResolveReferences
    data = cls.PDF_REF_RE.sub(Replacement, data)
  File "/home/user/pdfsizeopt/pdfsizeopt.py", line 2071, in Replacement
    raise PdfTokenParseError(
__main__.PdfTokenParseError: unexpected stream in: 54 0 obj

What's wrong with the optimized PDF?
There isn't one!

0807.2882v1.pdf
633 KB   Download
Feb 10, 2011
Project Member #1 pts...@gmail.com
Thank you for reporting this bug. I've just fixed it in r145.
Status: Fixed

Powered by Google Project Hosting