You must use PdfCopy and PdfStamper for that to work. The plain PdfWriter won't do, it doesn't import annotations.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Caoimhin Barry > Sent: Wednesday, September 07, 2005 5:53 PM > To: [email protected] > Subject: [iText-questions] PDF merge losing multimedia content > > Apologies if this sends more than once - my mails > keep bouncing back. > > Here is the scenario... > > I have a pdf document (A) that contains an > embedded movie file. I want to create a new pdf > (B), add some pages of my own and then import pdf > A and stamp a page number over it. > > When I try to do this the output file B is tiny > (28kb) considering the size of A (7mb). Instead > of the whole video clip getting imported, there > is just an image placeholder there. > > > Here is some extracted code to show you what I am > doing... I cant attach the input file as the > mailing list rejects it because of its size > > PdfReader reader=new PdfReader("A_input.pdf"); > Document document= new Document > (com.lowagie.text.PageSize.LETTER, 42f, 42f, 36f, > 36f); > PdfWriter writer = > PdfWriter.getInstance(document, new > FileOutputStream(mainBook)); > > document.open(); > > PdfImportedPage page; > PdfImportedPage blankPage; > PdfContentByte cb = writer.getDirectContent(); > page = writer.getImportedPage(reader, 1); > cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0); > > //code to stamp a page number over the current > page > cb.beginText(); > cb.setFontAndSize(bf, TextFontSize); > cb.setRGBColorFillF(255f, 255f, 255f); > cb.showTextAligned(PdfContentByte.ALIGN_CENTER, > String.valueOf(pageNumber), width-TextXIndent, > height-TextYIndent, rotation); > cb.endText(); > > > document.close(); > > > > > ______________________________________________________ > Click here to donate to the Hurricane Katrina relief effort. > http://store.yahoo.com/redcross-donate3/ > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
