Re: [iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread _apollo
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

Re: [iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread Iliadis Yannis
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

Re: [iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread 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 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

Re: [iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread _apollo
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

Re: [iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread 1T3XT info
_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

[iText-questions] Lose existing Bookmarks and Attachments with PdfCopy

2010-06-02 Thread _apollo
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