ayeen wrote: > hi... > > i was trying to merge two pdf files, pdf1.pdf and pdf2.pdf.... pdf1.pdf has > 2 pages, pdf2.pdf just has 1.... after merging them, page 2 of pdf1.pdf gets > lost and instead of having 3 pages i only have 2 pages...... below are my > codes:
So you copy page 1 of the first document: > copy.addPage(copy.getImportedPage(reader,1)); And page 1 of the second document: > copy.addPage(copy.getImportedPage(reader,1)); Why do you only copy the first pages if some documents have more than one page? > did i forget to include something in my codes? You forgot to read the documentation. The parameters of getImportedPage are a PdfReader object and a PAGE NUMBER!!! -- This answer is provided by 1T3XT BVBA ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. 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