[email protected] wrote: > I already tried to, but the PdfPTable is always printed ontop of the > rectangle
That's explained in the book (chapter 5 of the second edition). > I tried as followed: > > 1.: create an instance of Document OK > 2.: creating an instance of PDFWriter OK > 3.: creating an instance of PdfPTable OK > 4.: add cells to table instance OK, but you need to define a cell event for the cells that need to be overlapped. > 5.: call drawRectangles() // instead of 7. Not OK, the table will be drawn on top. > 6.: add table instance to document OK > 7.: call drawRectangles() // instead of 5. This could work, but it won't if your table spans more than one page. > 8.: close document OK The rectangle overlapping the cell should be drawn in the cell event. You have 4 different layers you can choose from: PdfPtable.BASECANVAS-anything placed here will be under the table. PdfPtable.BACKGROUNDCANVAS-the layer where the backgrounds are drawn. PdfPtable.LINECANVAS-the layer where the lines are drawn. PdfPtable.TEXTCANVAS-the layer where the text goes. Anything placed here will cover the table. You should pick the TEXTCANVAS. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ iText-questions mailing list [email protected] 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/
