hefronmedia / pdfsizeopt

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

Duplicate obj /Page can't be removed #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
version r134

If Obj /Page was duplicate in a PDF, pdfsizeopt remove duplicate Obj page
.... but PDF was corrupt Ex: 

1 0 obj<< 
/Type /Pages
/Count 3
/Kids [
 7 0 R
 11 0 R 
 12 0 R # same as 7 0 R
]
<<
pdfsizeopt produce ... 
1 0 obj<< 
/Type /Pages
/Count 3
/Kids [
 7 0 R
 11 0 R 
 7 0 R
]
<<

Acrobat reader cannot be show Page 3 ... small box 

I join a small dirty fix 

Original issue reported on code.google.com by j.lefebv...@gmail.com on 15 Jan 2010 at 11:37

Attachments:

GoogleCodeExporter commented 9 years ago
I join a correct small dirty Fix ;-)

Original comment by j.lefebv...@gmail.com on 15 Jan 2010 at 3:38

Attachments:

GoogleCodeExporter commented 9 years ago
Again again .... the true correct ... small dirty Fix ;-)

Original comment by j.lefebv...@gmail.com on 15 Jan 2010 at 4:03

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for the patch. Before I can apply it to pdfsizeopt, I'll make sure 
it's the
right thing to do.

Could you please send me a small example input and output PDF and also specify 
the
version of Acrobat Reader and the operating system you use?

Original comment by pts...@gmail.com on 16 Jan 2010 at 8:15

GoogleCodeExporter commented 9 years ago
I produce a better dirty patch ;-)

I have created a small PDF to illustrate the problem.

Tested on Acrobat Reader 7 8 9 same visual BUG

In  : intergral.merge.pdf
Out : intergral.merge.opt.pdf

info: This is pdfsizeopt-dev.py r134.
info: loading PDF from: integral.merge.pdf
info: loaded PDF of 183559 bytes
info: separated to 31 objs
info: found 0 Type1 fonts loaded
info: found 0 Type1C fonts loaded
info: eliminated 16 duplicate objs
info: writing Multivalent input PDF: pso.conv.mi.tmp.pdf
info: saving PDF with 14 objs to: pso.conv.mi.tmp.pdf
info: generated 61641 bytes (34%)
info: executing Multivalent to optimize PDF: java -cp
/home/stuff/dev/pdf/pdfsizeopt-read-only/Multivalent.jar tool.pdf.Compress
pso.conv.mi.tmp.pdf
file:/home/stuff/dev/pdf/pso.conv.mi.tmp.pdf, 61641 bytes
PDF 1.4, producer=itext-paulo-155 (itextpdf.sf.net-lowagie.com), creator=?pdftk 
1.41
- www.pdftk.com
additional compression may be possible with:
         -compact
=> new length = 61306, saved 0%, elapsed time = 0 sec
info: Multivalent generated pso.conv.mi.tmp-o.pdf of 61328 bytes (99%)
info: compressed xref stream from 32 to 149 bytes (466%)
info: optimized to 61198 bytes after Multivalent (100%)
info: saving PDF to: integral.merge.opt.pdf
info: generated 61198 bytes (33%)

Original comment by j.lefebv...@gmail.com on 17 Jan 2010 at 4:20

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by pts...@gmail.com on 11 Feb 2011 at 12:17

GoogleCodeExporter commented 9 years ago
The latest pdfsizeopt has a --do-unify-pages= flag. The default, 
--do-unify-pages=true may not work for you. Could you please attach a sample 
.pdf whose optimized version Acrobat Reader can display properly with 
--do-unify-pages=true, but not with --do-unify-pages=false? Please also specify 
the Acrobat Reader version. Please use the latest pdfsizeopt.

Unfortunately, I couldn't reproduce the problem with the integral.merge.pdf 
previously attached. I get very different output for it:

info: eliminated 5 duplicate objs
info: saving PDF with 14 objs with Multivalent to: 
/mnt/mandel/warez/tmp/issue24.psom.pdf
info: writing Multivalent input PDF: pso.conv.mi.tmp.pdf
info: generated object stream of 850 bytes in 9 objects (12%)
info: written 87341 bytes to Multivalent input PDF: pso.conv.mi.tmp.pdf
info: executing Multivalent to optimize PDF: java -cp .../Multivalent.jar 
-Djava.awt.headless=true tool.pdf.Compress -nopagepiece -noalt 
pso.conv.mi.tmp.pdf
file:/home/pts/prg/pdfsizeopt/trunk/pso.conv.mi.tmp.pdf, 87341 bytes
PDF 1.5, producer=itext-paulo-155 (itextpdf.sf.net-lowagie.com), 
creator=pdftk 1.41 - www.pdftk.com
additional compression may be possible with:
         -compact
=> new length = 83142, saved 4%, elapsed time = 0 sec
info: Multivalent generated pso.conv.mi.tmp-o.pdf of 83164 bytes (95%)
info: compressed xref stream from 85 to 200 bytes (235%)
info: optimized to 83031 bytes after Multivalent (100%)
info: generated 83031 bytes with Multivalent (47%)

I close this issue now. I'll reopen it once I have the file which which exposes 
the problem.

Original comment by pts...@gmail.com on 15 Apr 2012 at 9:13