Thanks for the response.  I tried clipping, but for some reason, I can place a part of the pdf from another file where ever I want in the new pdf, but only the very botton left corner.

 

Here is an example of what I am doing

 

      PdfContentByte cb = writer.getDirectContent();

      int pagei = i; //for page i

      PdfImportedPage page1 = writer.getImportedPage(reader, pagei);

 

      PdfTemplate template = cb.createTemplate(100, 100);  //size of section to add

 

      //want to grab a square from pdf 1 and place in exact same spot on pdf2                        

      page1.moveTo(50,50);

      page1.rectangle(50,50,150,150);

      page1.clip();

      page1.newPath();

                       

                       

      template.addTemplate(page1,0,0);

//          template.rectangle(50,50,150,150);

//          template.moveTo(50,50);

//          template.clip();

//          template.newPath();

 

      cb.addTemplate(template,50,50);   //where you want it to appear, absolute position

 

 

Any help  would be appreciated.

 

Thanks

David

 

 

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 5:30 AM
To: David Capredoni; [EMAIL PROTECTED]
Subject: RE: [iText-questions] Select a area from one pdf and put in another

 

You must always place the complete page but you can define a clipping area to show only some parts of the page.

 

Best Regards,

Paulo Soares

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Capredoni
Sent: Wednesday, March 31, 2004 8:02 PM
To: '[EMAIL PROTECTED]'
Subject: [iText-questions] Select a area from one pdf and put in another

Hi

 

Does anyone know how to select an area (rectangle in a page) from one pdf file and place it at a certain location in a new pdf file.

 

Thanks

 

Reply via email to