zackw / pdfsizeopt

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

__main__.PdfTokenParseError: unexpected stream in: 54 0 obj #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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!

Original issue reported on code.google.com by lev.bishop on 25 Jan 2010 at 4:16

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for reporting this bug. I've just fixed it in r145.

Original comment by pts...@gmail.com on 10 Feb 2011 at 10:04