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 74: Traceback when computing stats for a PDF file that uses tikz/pgf
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Feb 2013


 
Reported by rbr...@gmail.com, Feb 15, 2013
When trying to use pdfsizeopt (from trunk, revision 221) to show stats of a PDF file that contains a drawing in tikz/pgf, I get the following traceback:

pdfsizeopt --stats entrada-algoritmo-saida.pdf 
info: This is pdfsizeopt rUNKNOWN size=316358.
info: computing statistics for PDF: entrada-algoritmo-saida.pdf
info: PDF size is 10613 bytes
Traceback (most recent call last):
  File "/usr/bin/pdfsizeopt", line 7841, in <module>
    main(sys.argv)
  File "/usr/bin/pdfsizeopt", line 7757, in main
    PdfData.ComputePdfStatistics(file_name=args[0])
  File "/usr/bin/pdfsizeopt", line 6890, in ComputePdfStatistics
    setitem_callback=SetItemCallback)
  File "/usr/bin/pdfsizeopt", line 6745, in ParseSequentially
    setitem_callback(obj_num, pdf_obj, i)  # self.objs[obj_num] = pdf_obj
  File "/usr/bin/pdfsizeopt", line 6848, in SetItemCallback
    for head in PdfObj.ParseArray('[%s]' % obj_data):
  File "/usr/bin/pdfsizeopt", line 1204, in ParseArray
    return cls._ParseTokens(data, start, end, end)
  File "/usr/bin/pdfsizeopt", line 1344, in _ParseTokens
    (match.start(1), value1[0 : 16], exc))
__main__.PdfTokenParseError: bad array at 98, got '<< /pgf@CA.5 << '...: invalid name '.5' with stack ['-', '<', '<']

I will attach both the source and the PDF that caused the problem to this issue.

I am using a Debian unstable system (but I don't really think that this would matter give the above). If you need further information, please let me know.


entrada-algoritmo-saida.tex
562 bytes   View   Download
entrada-algoritmo-saida.pdf
10.4 KB   Download
Feb 17, 2013
Project Member #1 pts...@gmail.com
Fixed in r222 based on the information you've provided. If it still doesn't work, please let me know.

Thank you for reporting this bug, and thank you for providing details about what was going wrong. Based on the information you have provided it was very easy for me to reproduce and diagnose the problem.

Indeed, pdfsizeopt was buggy, beacuse it could parse the PDF numeric token `.5'. I've fixed it by modifying the regexp for numeric tokens.
Status: Fixed

Powered by Google Project Hosting