Closed GoogleCodeExporter closed 9 years ago
When pdfsizeopt extracts the fonts in this file, it also pulls out an
initialization
for a stream dictionary that uses the pdf R operator to make indirect object
references to find object lengths. pdfsizeopt should probably either not pull
out
that section or else insert the referenced objects. This is an issue with
postscript
generated by pdfsizeopt not with gs, so switching versions of gs will probably
not
help. It looks like the object with the indirect references is not used. I
tried
defining R to do something simple, and it worked. I have a patch below, and I
have
attached my full set of patches.
William Bader
williambader@hotmail.com
--- pdfsizeopt/pdfsizeopt.py- 2010-03-24 21:06:15.000000000 +0000
+++ pdfsizeopt/pdfsizeopt.py 2010-04-13 19:14:33.000000000 +0100
@@ -3417,6 +3423,16 @@
% don't redefine `stream'
} bind def
+% Avoid errors if any extra indirect references are included
+/R where {
+ pop
+}
+{
+ /R { % <objnumber> <gennumber> R <indirectobject> (but just <objnumber> for
now)
+ pop
+ } bind def
+} ifelse
+
% Sort an array, from Ghostscript's prfont.ps.
/Sort { % <array> <lt-proc> Sort <array>
% Heapsort (algorithm 5.2.3H, Knuth vol. 2, p. 146),
Original comment by william.bader@gmail.com
on 13 Apr 2010 at 8:08
Attachments:
Thank you, that`s exactly what I needed
Original comment by hata.ra...@gmail.com
on 26 Apr 2010 at 2:50
Thank you for the detailed bug report, and thanks to William for the workaround.
I've just fixed the issue in r142.
Since the PDF spec requires valid values for Length1, Length2 and Length3, for
better future compatibility I chose a different way to fix the bug: I made
pdfsizeopt resolve indirect refs in Length1, Length2 and Length3.
Original comment by pts...@gmail.com
on 10 Feb 2011 at 7:45
Original issue reported on code.google.com by
hata.ra...@gmail.com
on 8 Apr 2010 at 10:58Attachments: