Thank you
Brilliant answer..
Sent while on the move
Begin forwarded message:
> From: 1T3XT BVBA <i...@1t3xt.info>
> Date: 12 August 2011 08:21:31 GMT+01:00
> To: Post all your questions about iText here
> <itext-questions@lists.sourceforge.net>
> Subject: Re: [iText-questions] PdfConcatenate
> Reply-To: itext-questions@lists.sourceforge.net
>
> On 11/08/2011 21:11, John Renfrew wrote:
>> Just changed my code over to use PdfConcatenate instead of PdfSmartCopy and
>> it's really tightened things up, great improvement
>>
>> Can you tell me what the 'redundant content' smart parameter looks for
>> inside the files??
>
> First some general info: A PDF file consists of a sequence of objects.
> For instance: an image is a "stream" object composed of a "dictionary"
> (key/value pairs) followed by bytes delimited by the words stream/endstream.
> A page is a dictionary with key/value pairs, for instance a key named
> "Contents" referring to the content of the page and a key named
> "Resources" referring to the resources needed for the page.
> If you have two different pages showing the same image (for instance a
> logo that appears in the header), you have to avoid that the bytes of
> this image are stored twice in the same file.
> How is this solved in PDF? The image is referred to in the "Contents" of
> both pages using a name (e.g. /Img1). If you look inside the "Resources"
> of the page, you'll find an entry /Img1 in the "XObjects" resources.
> This /Img1 entry will refer to a stream object containting the image bytes.
>
> Now for your question:
> If you merge a page from one PDF with a page from another PDF, and both
> pages contain the same image (for instance: your company logo), the
> combined result will be a PDF with two pages each containing that image.
> If you use PdfCopy, the image bytes of the same logo will be present
> twice, in two different stream objects. If you use PdfSmartCopy, the
> image bytes will be present once, in one stream object that is
> referenced from different pages. How is this possible? PdfSmartCopy
> takes a hash of every stream object that is encountered and keeps those
> hashes in memory. If PdfSmartCopy detects that you try to add the same
> stream twice, a reference to the first stream will be used instead of
> adding a redundant stream.
>
> This is why:
> - PdfCopy is faster, but you'll possibly end up with bloated files.
> - PdfSmartCopy is slower and more memory-consuming, but you'll end up
> with smaller file sizes.
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it.
> http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php