Thanks for your fast answer.
>If you want Document Level Attachments to be copied, you need to add
>them to PdfCopy explicitly (because now you're only copying annotations
>that belong to pages, you aren't copying the Document Level Attachments).
>Or you could use PdfStamper; that would simplify
Otherwise you can find the javadoc on
http://sourceforge.net/projects/itext/files/iText/iText%202.1.7
2010/6/2 1T3XT info
> _apollo wrote:
> > That seems to be ok. I wonder why getUnderContent(1) copies the whole
> pdf?
> > Where can i find such a documentation for iText 2.1.7?
>
> Didn't you r
_apollo wrote:
> That seems to be ok. I wonder why getUnderContent(1) copies the whole pdf?
> Where can i find such a documentation for iText 2.1.7?
Didn't you refer to the first edition of "iText in Action"?
The answer is in that book.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.co
PdfReader reader = new PdfReader("/tmp/a.pdf");
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream("/tmp/b.pdf"));
PdfContentByte under = stamper.getUnderContent(1);
stamper.addFileAttachment(null, null, "/tmp/a.xml", "a.xml");
stamper.close();
That seems to be ok. I wonder why getU
_apollo wrote:
> I've tried to make an copy of an existing PDF and add new attachments. It
> works with the following code, but I lose the old attachments and the old
> bookmarks, although I used PdfCopy, like described in the book from 2006.
I guess you're talking about Document Level Attachments
I've tried to make an copy of an existing PDF and add new attachments. It
works with the following code, but I lose the old attachments and the old
bookmarks, although I used PdfCopy, like described in the book from 2006.
I'am using iText 2.1.7
import java.io.FileOutputStream;
import java.io.IOEx