Thomas Hauk wrote: > Let's say I have two PDF templates created with Adobe Acrobat, which > are both single-page, 8.5x11 documents. The first template (A.pdf) has > content for the top half of the page. The second template (B.pdf) has > content for the bottom half of the page. (It just so happens the > content in both templates does not "overlap" each other.) > > I would like to use iText to take these two templates and create a > single, "merged" template from it (C.pdf) that is only a single page > (with A.pdf's content on the top half and B.pdf's content on the > bottom half). > > (I do not want to "merge" these two files into a 2-page document. I > need the final product to be a single page.) > > I will be running iText in a servlet environment (Tomcat 6) but I > don't think that makes a difference to the answer. > > Is this possible?
Your question is almost a literal copy of: http://itextpdf.com/faq.php?branch=faq.pdf_in_general&node=pdl "Once in a while people post the question "After merging two PDFs, I am seeing some unnecessary white space. How can I remove or filter these blank areas?" Asking a question like this, demonstrates a lack of understanding of PDF. In PDF you work with complete pages, it's not possible to "reflow" the content. If you concatenate two PDF documents with half a page of content, the end result is NOT a PDF with one full page. The end result is a PDF with two pages that are only half full (as they are only half full in the original PDFs)." However, if you ARE SURE that both documents only take half a page, you could use the TextMarginFinder to find the boundaries of the text part and copy clipped templates to a single page (which is different from reflowing content). -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ _______________________________________________ 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/