lcorbasson / pdfsizeopt

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

pdfsizeopt gives a traceback when processing the current pgf manual #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
While trying to test pdfsizeopt, I had a problem with the current pgf manual 
(using revision 223 of pdfsizeopt):

----
./pdfsizeopt.py pgfmanual.pdf.1 
info: This is pdfsizeopt.py rUNKNOWN size=316511.
info: using Java for Multivalent: /usr/bin/java
info: loading PDF from: pgfmanual.pdf.1
info: loaded PDF of 5346838 bytes
Traceback (most recent call last):
  File "./pdfsizeopt.py", line 7846, in <module>
    main(sys.argv)
  File "./pdfsizeopt.py", line 7808, in main
    ).Load(file_name)
  File "./pdfsizeopt.py", line 3474, in Load
    data, do_ignore_generation_numbers=self.do_ignore_generation_numbers)
  File "./pdfsizeopt.py", line 3818, in ParseUsingXref
    xref_ofs, xref_obj_num, xref_generation)
  File "./pdfsizeopt.py", line 3626, in ParseUsingXrefStream
    w0, w1, w2, index, xref_data = xref_obj.GetAndClearXrefStream()
  File "./pdfsizeopt.py", line 1466, in GetAndClearXrefStream
    xref_tuple = self.GetXrefStream()
  File "./pdfsizeopt.py", line 1459, in GetXrefStream
    (len(xref_data), widths, index))
__main__.PdfXrefStreamError: data length does not match /Index: 
xref_data_size=186135 widths=[1, 3, 1] index=(0, 37226)
----

If you need any extra information, please let me know.

Thanks,

Rogério Brito.

Original issue reported on code.google.com by rbr...@gmail.com on 19 Feb 2013 at 9:21

GoogleCodeExporter commented 8 years ago
Fixed in r224.

Thank you for reporting this problem.

FYI The offending pgfmanual.pdf is invalid PDF (see attached), because its 
cross-reference stream was one item too long (compared to its /Index). To fix 
the file, the 2nd number in its `/Index [0 37226]' should be increased by 1. 
Feel free to report this bug to whoever has created pgfmanual.pdf. Anyway, 
pdfsizeopt, as of r224 is able to parse such invalid PDF.

Original comment by pts...@gmail.com on 19 Feb 2013 at 10:29

Attachments: