dylanroy / pdfsizeopt

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

Cannot process file with embedded Turkish font #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What command do you run to optimize the PDF?

python pdfsizeopt.py --use-pngout=true --use-jbig2=true --use-multivalent=false 
19CU15.pdf

What does pdfsizeopt display when running the command above?

info: This is pdfsizeopt.py rUNKNOWN size=279540.
info: loading PDF from: 19CU15.pdf
info: loaded PDF of 951946 bytes
info: separated to 79 objs + xref + trailer
info: found 0 Type1 fonts loaded
info: found 9 Type1C fonts loaded
info: writing Type1CParser (29197 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 862 20080229
Type1CParser: all OK
info: parsed 9 Type1C fonts
Traceback (most recent call last):
  File "pdfsizeopt.py", line 6977, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 6957, in main
    do_regenerate_all_fonts=do_regenerate_all_fonts)
  File "pdfsizeopt.py", line 5017, in UnifyType1CFonts
    type1c_objs[obj_num].FixFontNameInType1C(objs=self.objs)
  File "pdfsizeopt.py", line 2528, in FixFontNameInType1C
    ('\x00' * (off_size - 1), offset2_str))
TypeError: %c requires int or char

What's wrong with the optimized PDF?

No output PDF

What should be there in the optimized PDF instead?

a PDF file

Original issue reported on code.google.com by h...@yore.com.tr on 19 Nov 2011 at 10:54

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for submitting this detailed and useful bug report. It seems that 
there are multiple, non-obvious bugs in the FixFontNameInType1C function. Until 
I fix them, you can to use `pdfsizeopt.py --do-unify-fonts=false' as a 
workaround.

Original comment by pts...@gmail.com on 23 Nov 2011 at 10:17

GoogleCodeExporter commented 8 years ago
Based on your bug report, I investigated related bugs and fixed all of them in 
r171. Please download the latest pdfsizeopt.py and try again. It works now for 
the attached 19CU15.pdf . If it doesn't work for you, please reply.

Thank you for reporting this bug, it was very helpful for improving 
pdfsizeopt.py .

Original comment by pts...@gmail.com on 23 Nov 2011 at 11:48