Hmm.. that's not exactly what I mean.. 

At the moment, I generate a pdf with one image per page, each page has a 
different image. Now, I would like to add all the images in an attachment to 
the pdf, but I still want to show all the images in the pdf.

So, to put it in another way, I want to add some images as attachments to the 
pdf, and I want the attached images to be shown on different pages. So the 
images are not saved as an image object in the pdf and as an attachment.

(putting the image in attachment should make it easier for the user of the pdf 
to extract the images..)


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: maandag 7 april 2008 12:48
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Show image from attachment


Quoting "Tiesters, Timothy [PRDBE Extern]" <[EMAIL PROTECTED]>:

> Hi
>
> Is there any possibility to attach an image to a pdf, and show this   
> image in a pdf, without the image being stored a second time in the   
> pdf?

Of course that's possible. As a matter of fact iText does this
automatically. For instance: the following code adds the same
image on two different pages:

Image img = Image.getInstance(pathToImage);
document.add(img);
document.newPage();
document.add(img);

Internally, the bits and bytes of the image are added only once.
Of course, if you WANT the image to be added twice, you'd have
to do it like this:

Image img1 = Image.getInstance(pathToImage);
document.add(img1);
document.newPage();
Image img2 = Image.getInstance(pathToImage);
document.add(img2);

Here the bits and bytes are added twice because you are creating
two different instances of the iText Image object.

> I've read iText in action and the pdf-reference. But I'm not  sure I  
> found something.. Could an XObject help me with this?

I'm sure it's mentioned on different places, only:
why are you concerned with this? If you do it right
(first code snippet), you don't have to worry about
all this.

--
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to