Re: [iText-questions] PdfPTable Absolute Positioning
tamtam18 wrote: > Hello, I am using the following code to place a PdfPTable at an absolute > position: > > float yAbsolutePosition = iTextDoc.bottomMargin() + > iTextPdfPTable.getTotalHeight(); > iTextPdfPTable.writeSelectedRows(0, -1, iTextDoc.leftMargin(), > yAbsolutePosition, pdfWriter.getDirectContent()); > > However, if there is already a table or other text in that position, my > iTextPdfPTable simply writes on top of the existing text. Yes, of course. > I would really > like to check if there is anything already there (I really just need to know > if there is anything below the yAbsolutePosition, as this should be the > lowest element on the page), and if there is, start a new page and place the > PdfPTable on the new page. How can I check what is already at that > position? That's not possible. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/blackberry ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php 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/
RE: [iText-questions] PdfPTable absolute positioning mixed with non-absolute document.add()s
Have you tried just seeting the page margins? I solved similar situation with preformating this table before the page starts. It is possible to find out its height and this hight was used to reduce "printable" area for usual document.add() methods. In your case: info.getTotalHeight() My sequence: -->prepare table -->getTotalHeight() -->change page margins -->write to page -->onPageEnd: write table and (if wanted) change margins of next page But may be it is not suitable for your purpose. GG -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gabe Johnson Sent: Tuesday, December 02, 2003 11:14 PM To: [EMAIL PROTECTED] Subject: [iText-questions] PdfPTable absolute positioning mixed with non-absolute document.add()s I'm working with iText to create some invoices. I have a header that appears at the top of every page. This header is written at absolute coordinates using PdfPTable's writeSelectedRows() method in response to a page started event. My problem is that at this point, the 'cursor' is still pointing to the top of the page, so if I do a document.add(new Phrase("Foo")) at this point, Foo is written on top of my header. Is it possible to reposition the cursor (my own term, I don't know what the real word for this is, if there is one at all)? I've tried resetting the margins, but that didn't seem to work. Code example: (I believe this is all that is relevent) info.writeSelectedRows(0, -1, left, top, cb); document.add(new Phrase("Foo")); // Foo on top of my header -gabe --- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] PdfPTable absolute positioning
Use a PdfPTableEvent to get the cell positions. Best Regards, Paulo Soares > -Original Message- > From: Wojciech Wisniowski [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, June 04, 2002 18:55 > To: [EMAIL PROTECTED] > Subject: [iText-questions] PdfPTable absolute positioning > > Hello, > > I am a new user of the iText library. > It is very usefull for my project but I need a little help. > I'm using a PdfPTable/PdfPCell objects to create my pdf document. But in > order to complete my project I need export page layout (positions and > content of cells ) to external application. > I would like to get absolute position of all cells and save it to external > xml file. > How to do it? The methods left(), right() ... of PdfPCell objects always > return 0.0. > How can I solve my problem? > > Thank for any help > > Wojtek > > > ___ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > ___ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions