Hi,
I need to copy one page from a document to another, the original file has the
page I need
to copy (page 6) in portrait orientation but I need it in landscape.
If I create the new document with landscape orientation and also use
cb.addTemplate(page1, 1, 0, 0, 1, 0, 0); the new file has the page in landscape
but the
content is portrait since that's the way it is in the original file.
How can I have the copy.pdf file with both page and content in landscape
orientation? If
I use the add method I only get a rectangle in the new file rather than the
whole
content. Is it possible to copy the page AS IS and after that rotate the page
so it is in
landscape orientation?
This is my code:
PdfReader reader = new PdfReader("C:\\test.pdf");
Document document = new Document(PageSize.A4.rotate()); //new doc in landscape
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("C:\\copy.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
document.newPage();
PdfImportedPage page1 = writer.getImportedPage(reader,6);
cb.addTemplate(page1, 1, 0, 0, 1, 0, 0);
//cb.add(page1);
cb.beginText();
cb.endText();
document.close();
Thanks in advance.
Miguel
___________________________________________________________
Do You Yahoo!?
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes.
http://net.yahoo.com.mx
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions