Need to add content of one pdf file to the end of the other

hello Experts ,
I am using itext for pdf manupilation ,
I have 2 files ,
I need to add the content of one file to the end of the other file , this is the code i have right now but for some reason instead of appending the content it completely overwrites the content of the file


PdfReader reader = new PdfReader(scr_filename.getInputStream());
                    reader.consolidateNamedDestinations();
                    // we retrieve the total number of pages
                    int n = reader.getNumberOfPages();
                    pageOffset += n;
                    List bookmarks = SimpleBookmark.getBookmark(reader);
                    if (bookmarks != null) {
                        if (pageOffset != 0)
                               SimpleBookmark.shiftPageNumbers(bookmarks, pageOffset, null);
                              master.addAll(bookmarks);
                    }


                        // step 1: creation of a document-object
                        document = new Document(reader.getPageSizeWithRotation(1));
                        // step 2: we create a writer that listens to the document
                        writer = new PdfCopy(document , new FileOutputStream(outFile,true));
                        // step 3: we open the document
                        document.open();
                        System.out.println(document.getPageNumber() );

                    // step 4: we add content
                    PdfImportedPage page;
                    for (int i = start_page; i < n; ) {
                        ++i;
                        page = writer.getImportedPage(reader, i);
                        writer.addPage(page);
                    }


plz advice
eldoz12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eldoz12Author Commented:
plz help
brettmjohnsonCommented:
eldoz12Author Commented:
I need to use itext plz
Mayank SAssociate Director - Product EngineeringCommented:
Is this duplicate of http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21780746.html ?

You can post a link of 20 points instead of putting 500 points.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.