On May 6, 2010, at 1:18 PM, Mark Storer wrote:
> I believe the intial suggestion is to make the original pages smaller.
> 8.5x5.5 rather than 8.5x11 or some such.  Then you don't need to worry
> about clipping via any method:

Since I can control how the original "templates" are sized, it does  
make sense to create them at the correct size from the start, as you  
suggest here.

> PdfImportedPage inherits from PdfTemplate, so drawing multiple pages  
> on
> a single page isn't particularly hard, it's just a matter of getting
> them to fit, THUSLY:
>
> PdfTemplate topOfPage = writer.getImportedPage( reader, 1 );
> PdfTemplate bottomOfPage = writer.getImportedPage( reader, 2 );
>
> PdfContentByte content = writer.getDirectContent();
>
> // in PDF, "0, 0" is the lower left corner.
> content.addTemplate( bottomOfPage );
> content.addTemplate( topOfPage, 0, bottomOfPage.getHeight() );
> // stupid case correcting email client... Grumble grumble.  SEE!?


Thanks Mark, I'll give that a go!

A small preemptive follow-up: let's say the content in my PDF  
templates are not 1/2 of a 8.5"x11" page (as my original example), but  
actually 1/8 of a 8.5"x11" page, and I want to arrange the output as 8  
identically-sized parts (arranged in 2 rows and 4 columns) on a single- 
page PDF outputted from iText. Does the same idea (expressed in your  
sample code above) still apply?

--
Thomas Hauk
Shaggy Frog Software
www.shaggyfrog.com


------------------------------------------------------------------------------

_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

Reply via email to