Java Mailing List Archive

http://www.junlu.com/

Home » Post all your questions about iText here »

Re: [iText-questions] iText combine size large and
 fonts/backgroundsduplicated

Mark Storer

2010-09-02

Replies: Find Java Web Hosting

Author LoginPost Reply
If you use PdfSmartCopy, you at least won't get duplicates from the same
document. However, iText doesn't currently look to see if it has (for
example) two identical copies of a font from separate files.

It might be easier to come up with a separate utility to go over a given
PDF and remove redundant objects, and fix up references to them. Not
easy, but quite possible.

Ugh.. My initial thought was to build a hash for each object in a PDF,
and look closely at hash matches to find duplicates. But it won't work.
XObject A might be identical to XObject B, save that they reference
different copies of the same image. A single pass hash of their
toString output would not catch the match, though it would remove the
redundant image. Multiple passes would be necessary until a pass found
no matches. Not Efficient at all, but serviceable.

You might end up with a resource directory that had several aliases for
the same font/image/whatever, but I could live with that.


--Mark Storer
Senior Software Engineer
Cardiff.com

import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;



> -----Original Message-----
> From: mukkakishore@(protected)]
> Sent: Thursday, September 02, 2010 2:28 AM
> To: itext-questions@(protected)
> Subject: [iText-questions] iText combine size large and
> fonts/backgroundsduplicated
>
> Hello Everyone,
>
> We have an issue with huge size of combined PDF File using iText.
>
> We have written a logic to combine the pdf files using iText
> and we observed that, iText Combines PDF successfully. But,
> not removing duplicate fonts, backgrounds.
>
> We tried to perform the same merge using Adobe Standard
> version. The size out of it is 2 MB for 200 files.
>
> But, the same for iText Merge is 15MB. So,we missed something
> and upon investigation, we found that, it is with duplicate
> fonts and backgrounds. Adobe does a consolidation of
> duplication of fonts and page backgrounds.
>
> Our source of pdf files are output from a Single Crystal
> Report. Users will be combining these reports based on their
> requirement from the Crystal Output files. So, there is a
> single type of Crystal Report output in PDF format.
>
> Could you please advise, if we have any Class/function to do this.
>
> Thank you
> Kishore Mukka
>
> --
> This message was sent on behalf of mukkakishore@(protected)
> at openSubscriber.com
> http://www.opensubscriber.com/message/itext-questions@(protected)
urceforge.net/5762681.html
>
> --------------------------------------------------------------
> ----------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/ Check the
> site with examples before you ask questions:
> http://www.1t3xt.info/examples/ You can also search the
> keywords list: http://1t3xt.info/tutorials/keywords/
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.851 / Virus Database: 271.1.1/3102 - Release
> Date: 09/01/10 11:34:00
>

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
©2008 junlu.com - Jax Systems, LLC, U.S.A.