sudharakab / pdfsizeopt

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

Optimization fails on long titles #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download 
http://www.emotion.uni-kiel.de/fileadmin/emotion/team/kaernbach/publications/198
7_kae_al_jasa.pdf (or attached file)
2. python pdfsizeopt.py 1987_kae_al_jasa.pdf

What is the expected output? What do you see instead?
info: This is pdfsizeopt.py rUNKNOWN size=281028.
info: loading PDF from: 1987_kae_al_jasa.pdf
info: loaded PDF of 320286 bytes
info: separated to 47 objs + xref + trailer
Traceback (most recent call last):
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 7029, in <module>
    main(sys.argv)
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 7002, in main
    ).Load(file_name)
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 3275, in Load
    do_ignore_generation_numbers=self.do_ignore_generation_numbers)
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 396, in __init__
    i = self.FindEndOfObj(other, skip_obj_number_idx, len(other))
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 839, in FindEndOfObj
    data=data, start=match.start(1), end_ofs_out=end_ofs_out)
  File "/home/tristan/arbeit/pdfsizeopt/pdfsizeopt.py", line 2098, in RewriteToParsable
    ' <%s>' % eval(''.join(string_output), {}).encode('hex'))
  File "<string>", line 1
    'On Riccati Equations Describing Impedance Relations for Forward and Back
                                                                            ^
SyntaxError: EOL while scanning string literal

What version of the product are you using? On what operating system?
r173, Ubuntu Linux

Original issue reported on code.google.com by TTSten...@gmail.com on 1 Apr 2012 at 3:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for your time and effort composing and submitting this bug report. 
Based on the information you provided I was able to diagnose and fix the 
problem in r174. Please download the latest pdfsizeopt.py and try again.

FYI I had to use Python 2.7 to reproduce the problem (it wasn't a SyntaxError 
in Python 2.6). It turned out that pdfsizeopt.py r173 didn't parse string 
literals with backslash-cr and backslash-cr-lf correctly.

Original comment by pts...@gmail.com on 2 Apr 2012 at 5:24

GoogleCodeExporter commented 9 years ago
Works now, thanks!

Original comment by TTSten...@gmail.com on 2 Apr 2012 at 5:29