consider this code public class Test { public static void main( String args[]){ Document doc = new Document(PageSize.A4, 0 , 0, 0 , 0); try{ PdfWriter writer = PdfWriter.getInstance( doc, new FileOutputStream( "new.pdf" )); doc.open(); PdfReader reader = new PdfReader( "d:\\file.pdf" ); PdfImportedPage p = writer.getImportedPage(reader, 1); Image pdf = Image.getInstance(p); doc.setPageSize( new Rectangle( pdf.getWidth(), pdf.getHeight())); doc.newPage(); PdfContentByte cb = writer.getDirectContent(); pdf.setAbsolutePosition( 0 ,0 ); cb.addImage( pdf ); ColumnText ct = new ColumnText(cb); ct.setSimpleColumn(5, 500, 100, 100, 9, Element.ALIGN_RIGHT); ct.addText( new Phrase( "the new phrase")); cb.setColorFill( Color.black ); cb.stroke(); ct.go(); doc.setPageSize( PageSize.A2 ); doc.newPage(); doc.add( new Paragraph( "new paragraph" )); }catch( Exception ex ){ ex.printStackTrace(); } doc.close(); } }
The new paragraph is not inserted. Is there anyone that can explain why? -- View this message in context: http://www.nabble.com/Question-on-how-to-stamp-and-create-new-pdf-in-the-same-creation-tp23556345p23557167.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/